Same-name daily shows recordings fail to record

(Please excuse the username, I am not a PLEX administrator in any way.)

I created a simple program with python to fix this exact issue.

It takes an xml guide input file (-i), an xml guide output file (-o), and anything you want to exclude (-x) but will default to excluding ‘paid programming’, ‘pay-per-view’, ‘on demand’, ‘sign off’, ‘to be announced’, and “Shopping” if nothing is specified.

It adds an original-air-date record parsed from the actual air-date to the xml entries that are series (not movies) that do not adhere to the standard season-episode format nor already have an original-air-date entry.

I run this after running zap2it to get the xml tvguide, and then Plex picks up the resulting file. It works great for me. I can provide the source code if you need it.

example: TVGuideFix -i “c:\temp\PreGuide.xml” -o “c:\temp\TVGuide.xml” -x “Paid Programming” “RadiantTV Programming” “Pay-Per-View”

FixTVGuide.zip (7.0 MB)FixTVGuide_Source.zip (1.4 KB)

Sounds promising, is it possible to compile it for linux or share at github? I run plex on a linux machine.

Awesome - could you provide the Python (I am on a Mac)?

I just added the python source code on my original message.

1 Like

Thank you for the source! I don’t use zap2it or categories, just need to parse every airing and inject the tag, looks like the script could be modified for that if I learn python a bit :wink:

I dont use Plex categories either, but in the zap2it xml files, the categories are already in there. I just use the category of “series” to denote that it is not a movie since Plex treats movies differently than TV shows for the guide.

Here is a sample of what zap2it comes out with, and I just key off of the category element. This one has no original-air-date, nor the proper series-episode format.

<programme start="20210215200000 -0500" stop="20210215230000 -0500" channel="I304.16616.zap2it.com">
		<title lang="en">Mysteries of the Abandoned</title>
		<desc lang="en">Some of the world&apos;s most incredible engineering projects now lie in ruins; cities that are now empty ghost towns, bridges that were never finished, and roads to nowhere; these deserted places are home to extraordinary mysteries and untold secrets.</desc>
		<category lang="en">Series</category>
		<length units="minutes">180</length>
		<icon src="https://zap2it.tmsimg.com/assets/p13959449_b_v13_ah.jpg" />
		<url>https://tvlistings.zap2it.com//overview.html?programSeriesId=SH02649635&amp;tmsId=SH026496350000</url>
		<episode-num system="dd_progid">SH02649635.0000</episode-num>
		<audio>
			<stereo>stereo</stereo>
		</audio>
		<new />
		<subtitles type="teletext" />
	</programme>

As you can see, “category” is already included as “series”. This particular example is what I would call an orphaned episode because it should have a series-episode number (see second example) or an original-air-date, but does not. Therefore, Plex treats it as if it were the same episode as a previous “Mysteries of the Abandoned” recording even though the description is clearly different. By simply adding
<episode-num system="original-air-date">2021-02-15</episode-num> to this xml entry, Plex treats it correctly in the guide.

A normal entry for this show should look like this:

<programme start="20210206150000 -0500" stop="20210206160000 -0500" channel="I48.11150.zap2it.com">
		<title lang="en">Mysteries of the Abandoned</title>
		<sub-title lang="en">Secret of Supervillain Island</sub-title>
		<desc lang="en">On a strange island off the coast of Croatia, the mysterious ruins of a long-abandoned hideout look like they once belonged to a James Bond super-villain, and new discoveries reveal why it was built and why they were abandoned.</desc>
		<category lang="en">Series</category>
		<length units="minutes">60</length>
		<icon src="https://zap2it.tmsimg.com/assets/p16785917_e_v9_aa.jpg" />
		<url>https://tvlistings.zap2it.com//overview.html?programSeriesId=SH02649635&amp;tmsId=EP026496350085</url>
		<episode-num system="common">S04E02</episode-num>
		<episode-num system="dd_progid">EP02649635.0085</episode-num>
		<episode-num system="xmltv_ns">3.1.</episode-num>
		<audio>
			<stereo>stereo</stereo>
		</audio>
		<previously-shown />
		<subtitles type="teletext" />
		<rating>
			<value>TV-PG</value>
		</rating>
	</programme>

You can see that there is an element showing “S04E02” here, and Plex picks up on that and treats it correctly. For whatever reason, there are shows that seemingly at random don’t adhere to this format like in the first example, so adding the original-air-date element becomes necessary for those.

Local news series, cooking shows, and the like are also notorious for not including SxxExx, and thus makes recording them automatically troublesome without the inserted element to fix it.

But, if whatever xml guide provider you are using doesn’t come with categories like that, then I am sure you can modify the script a bit to accommodate your needs.

I have only these fields per any program:

<programme start="20210215200000 -0500" stop="20210215230000 -0500" channel="I304.16616.zap2it.com">
		<title lang="en">Mysteries of the Abandoned</title>
		<desc lang="en">Some of the world&apos;s most incredible engineering projects now lie in ruins; cities that are now empty ghost towns, bridges that were never finished, and roads to nowhere; these deserted places are home to extraordinary mysteries and untold secrets.</desc>
	</programme>

That’s pretty minimal… Regardless, I modified the script for your situation, but I do not recommend doing this for anyone that has the luxury of using something like zap2it as the xml guide provider where there is alot more information.

Try this python script. It removes the restrictions for “series” and just adds the original-air-date element to every program entry. It still pays attention to the exclude parameter if you want to exclude things.

NOTE: As I stated previously, Plex treats movies and tv shows differently in the guide so this particular modified solution will make Plex do strange things if you already use something like zap2it that has more complete information.

TVGuideFix_Modified.zip (1.2 KB)

Great, it works! The unicode text in the desc is translated into &# html notation, is it an expected behavior, or I miss some python module in my setup?

The script doesn’t (shouldn’t anyway) modify the description. The only things that this python script uses are ElementTree and argparse.

When you import the guide into Plex, does Plex display the description correctly? It does display correctly for me, so if it still does for you, I would just let it be with whatever translation happened…

Yes, Plex recognizes the &# encoding, so not an issue, thank you!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.