Kodi Community Forum
Extra REGEX for TV Show Episode matching - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Tips, tricks, and step by step guides (https://forum.kodi.tv/forumdisplay.php?fid=110)
+--- Thread: Extra REGEX for TV Show Episode matching (/showthread.php?tid=51614)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26


- jrubenol - 2009-11-30

Thanks for the help, I'm going to check into it and see what I come up with. I think that my method of backup is actually fairly common (DVD Shrink is probably the most common backup tool available). I have tried per episode and I find two things:

1. Backing up to avi diminishes quality
2. It's a pain in the...to figure out where one episode begins and what ends because they don't match .vob's to episode numbers, this turns it into an almost guessing game -- someone has told me that there is software available that will do it for me, but I'm happy with k9copy so, I think the quality of the backup is great and I also like the dvd menus and what not when I want to play something using VLC.

Forgot to mention also that they aren't .iso's, they are just folders, DVDShrink and DVD Decrypter, K9Copy, etc... just basically move the vob's to folders and somehow compress them down to about 4 gigs (or less). Between those three programs I think that there are a ton of people who have this type of setup

Lastly, I have to make an nfo file for each show? Is this normal? I'm still not getting why my foo.401.avi didn't get detected, unless it is necessary to do a .nfo file in each location. Thanks again, really appreciate the help (I have spent hours trying to solve this so I'm definitely trying to pull my own weight Wink )


- xexe - 2009-11-30

foo.401 did get detected. if your not seeing it in your library thats a different story.


- outleradam - 2009-11-30

xexe Wrote:I cant see anything in http://www.xbmc.org/wiki/?title=AdvancedSettings.xml thats gives me the abilty to do REGEX date matches so I see no way of doing anything date related.
ok, thank you. I am now starting a project to reference TVDB as a mythtv job which will first access the mythtvdb, then get the showname and the episodename, then access TVDB, get the showID from the showname [url=http://www.thetvdb.com/api/GetSeries.php?seriesname="family%20guy"]http://www.thetvdb.com/api/GetSeries.php?seriesname="family%20guy"[/url] <<family guy, grab the XML for the showID which contains all tvdb information about the show including season and episode http://www.thetvdb.com/api/3B81A89C73E4EE95/series/75978/all/en.xml, then rename the show to showname - SxxExx (episodename)


- xexe - 2009-11-30

XBMC can lookup by air date though its just not something you can tweak and I have no experience of using it.

Realistically though its problematic as it assumes that your recording is from the first airing on the original network (the field tvdb stores)


- jrubenol - 2009-11-30

Hi All,

Back for a bit more help, I know that this method isn't being supported in the forum but so far what xexe has told me has greatly improved what I've been able to accomplish.

My results thus far:

The number of episodes are being detected, they show up in XBMC but they all show up as the same title (title of the show) and they all link to the DVD root menu, not the episodes themselves.

To accomplish this I have the following:
advancedsettings.xml
Quote:
Quote:<advancedsettings>

<tvshowmatching append="no">
<regexp>\[[Ss]([0-9]+)\]_\[[Ee]([0-9]+)\]?([^\\/]*)(?Sad?:[\\/]VIDEO_TS)[\\/]VIDEO_TS.IFO)?</regexp>
</tvshowmatching>

</advancedsettings>

then inside of the disc folder for a show (let's say S2E1E2E3E4 of Big Bang Theory) I have this VIDEO_TS.nfo

Quote:<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<tvshow>
<title>The Big Bang Theory</title>
<episodeguideurl>http://www.thetvdb.com/api/1D62F2F90030C444/series/80379/all/en.zip</episodeguideurl>
<rating>0.000000</rating>
<year>0</year>
<top250>0</top250>
<season>-1</season>
<episode>0</episode>
<displayseason>-1</displayseason>
<displayepisode>-1</displayepisode>
<votes></votes>
<outline></outline>
<plot></plot>
<tagline></tagline>
<runtime></runtime>
<mpaa></mpaa>
<playcount>0</playcount>
<lastplayed></lastplayed>
<id></id>
</tvshow>

The episodeurlguide there is correct as it links me to a zip that contains all the names of the episodes. Here is my log:

http://pastebin.com/m6999d996


There are definitely others interested in this as I have gotten a couple responses in another forum from people awaiting if I'm able to make progress....xexe I really appreciate any advice/help/assistance you can give, I know your time is valuable


- outleradam - 2009-11-30

yeah, that is entirely possible. if you look at the values I listed, they are all origonal air date, I removed the worthless recording dates. how do I name my files for an origonal air date? I tried looking at regex but it's like greek.


- xexe - 2009-11-30

I am pretty sure its just american date format you insert in. But if your going to the effort of looking up an airdate you might as well add season and ep which is far more reliable with better coverage.

the vast majority of tvdb has no air dates entered


- jrubenol - 2009-12-01

hopefully this is my last post (sorry for spamming), I gave up and did an episode of big bang (was able to do it from the dvd folder so that was nice, much faster). But still not getting what I want:

Code:
14:57:49 T:139757739780368 M:3322638336   ERROR: CVideoInfoScanner::OnProcessSeriesFolder: Asked to lookup episode /home/joel/Videos/My Videos/TV Shows/The Big Bang Theory/Season 2/BigBangTheory - 2 x 19.mkv online, but we have no episode guide. Check your tvshow.nfo and make sure the <episodeguide> tag is in place.


Here is my tvshow.nfo (which is inside of the root folder for the show)

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<tvshow>
    <title>The Big Bang Theory</title>
    <rating>0.000000</rating>
    <episodeguideurl>http://www.thetvdb.com/api/1D62F2F90030C444/series/80379/all/en.zip<episodeguideurl>    
    <year>0</year>
    <top250>0</top250>
    <season>-1</season>
    <episode>0</episode>
    <displayseason>-1</displayseason>
    <displayepisode>-1</displayepisode>
    <votes></votes>
    <outline></outline>
    <plot></plot>
    <tagline></tagline>
    <runtime></runtime>
    <thumb>http://image.com.com/tv/images/content_headers/program_new/58056.jpg</thumb>
    <mpaa></mpaa>
    <playcount>0</playcount>
    <lastplayed></lastplayed>
    <id></id>
    <genre></genre>
    <set></set>
    <credits></credits>
    <director></director>
    <premiered></premiered>
    <status></status>
    <code></code>
    <aired></aired>
    <studio></studio>
    <trailer></trailer>
    <artist></artist>
</tvshow>

I have your regex set up now, and my naming scheme is

TVSHOWS/SHOW/Season/BigBangTheory - 2 x 19

TVSHOWS is being scanned, the nfo file is inside of each SHOW folder.

Also, I have verified the URL for episode guide and it does have the zip I am looking for. I got the code from the import/export portion of the wiki. Thanks!


- jrubenol - 2009-12-01

turns out there's a bug, I'm talking to one of the developers in IRC trying to pinpoint it Wink


- xexe - 2009-12-01

You know thats an XML nfo and you only need one line in a non XML nfo namely the tvdb show link. your just making it complicated for youself as per the OP


- xexe - 2009-12-05

There is a problem with the EXCLUDE pattern matching. It turns out it is case sensitive which i "thought" explained the problem but so far no luck making it work.

More testing will be done.

Also I found another 2,343 episodes that dont match that likely can be made to match reliably. Expect an update soon.


- xexe - 2009-12-06

Something is very wrong here. I have manually confirmed that alot of these eps that didnt match should match with the exiting REGEX. It is as if XBMC isnt loading some of the REGEX.

Can anyone confirm similar at their end?


- outleradam - 2009-12-10

Just as a follow-up to something I posted earlier in here...

To get MythTV recordings in the library, use MythSExx. It's a program I created to be run as a user job after each show for the purpose of renaming episodes recorded by MythTV
Show Name.SxxExx (Episode Title).ext
http://wiki.xbmc.org/?title=MythSExx
I hope it helps someone looking for information on that here.

It works well! Laugh


- xexe - 2009-12-11

outleradam Wrote:Just as a follow-up to something I posted earlier in here...

To get MythTV recordings in the library, use MythSExx. It's a program I created to be run as a user job after each show for the purpose of renaming episodes recorded by MythTV
Show Name.SxxExx (Episode Title).ext
http://wiki.xbmc.org/?title=MythSExx
I hope it helps someone looking for information on that here.

It works well! Laugh

Nice follow up. :0


I have managed to fid the problem with the current REGEX. Essentially XBMC mis captures a load of files and since this regex appends to the native XBMC regex it would never work.

Changing most to prepend makes it work again.

However the exclude REGEX still doesnt work and I am at a complete loss why and how to check any further. Waiting for a dev in IRC to assist.

A complete new as.xml will be posted once I am happy.


- xexe - 2009-12-13

OK an update.

The source of the exclude REGEX issues has been traced thanks to some real time support by Vdrfan. Essentially the logic of how the REGEX is applied is not what is implied in the wiki (or it can be read more than one way).

Some code changes are happening and once they make it into the SVN (hopefully) I will post a new set with some nice new additions.