# How to get Season number and Episode Number?



## jsrober (Mar 8, 2010)

Hi,

I have Java code that downloads all my TiVo shows, tivodecode's them, and handbrakes them into MP4 so I can watch on phones and tablets. It works great.

I name my files based on the information in the XML data that the tivo provides. Here's an example:
60_Minutes-WJZDT-20161016_1900

I want to change this so that I name the files with correct Season Number and Episode Number so that Plex can properly recognize the files.

How do I use the data that's in the TiVo XML to get the Season Number and Episode Number for each recording?

I have fields like this available:

<ProgramId>EP0000018964-0361801749</ProgramId>
<SeriesId>SH0000018964</SeriesId>
<ProgramServerId>361801749</ProgramServerId>
<SeriesServerId>18964</SeriesServerId>
<IdGuideSource>10420201</IdGuideSource>

Do I need to query some other API to get Season Number and Episode Number?
Thanks,
John


----------



## Dan203 (Apr 17, 2000)

You have to use the mind interface like kmttg uses. Or you can use the series ID from the XML to query theTVDB via their API. Although with the new Rovi data I'm not 100% sure that still works.


----------



## bradleys (Oct 31, 2007)

Dan203 said:


> You have to use the mind interface like kmttg uses. Or you can use the series ID from the XML to query theTVDB via their API. Although with the new Rovi data I'm not 100% sure that still works.


No, it doesn't....


----------

