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


- Varazir - 2010-07-14

I have this file/folder structure

\TV\STARGATE SG-1 - COMPLETE - PAL DVD DD2.0 x264 MMI\STARGATE SG-1 - SEASON 01 - PAL DVD DD2.0 x264 MMI\STARGATE SG-1 - S01 E01 - CHILDREN OF THE GODS PAL DVD DD2.0 x264 MMI.mkv

The generic or default can't even find the show


And this can't find found

TV\MacGyver\MacGyver Season 2\MacGyver - 201 - The Human Factor.avi
TV\MacGyver\MacGyver Season 3\macgyver.301-med.avi
TV\MacGyver\MacGyver.Complete.S01.DVDRip.XviD_MEDiEVAL\MacGyver.S01E01.Pilot.DVDRip.XviD-MEDiEVAL.avi


- Varazir - 2010-07-17

After some help from xexe

I got it to work

What I did was to change the source point from the drive K:\ to the TV folder
Then I got MacGyver EP's to work


Adding this <regexp>(?i)\-\ ?s(\d\d?)\ ?e(\d\d?)([^/\\]*)</regexp>
and a tvshow.nfo with http://thetvdb.com/?tab=series&id=72449&lid=7

I got my Stargate EP to work

Thanks again xexe


- Faldaani - 2010-07-17

I've got a multi part episode thats named using . instead of -... so its S01E19.E20 instead of S01E19-E20... so the multi part stuff doesn't work.

It hits on this regexp:
22:18:48 T:3100 M:875225088 DEBUG: found episode based match rar://smb%3a%2f%2fxxxx%2fone%2ftv%2dseries%20%2d%20archive%20%2d%20dvdrip%2fbattlestar%20galactica%2fbattlestar%2egalactica%2es01e19%2ee20%2edvdrip%2exvid%2dsfm%2fbattlestar%2egalactica%2es01e19%2ee20%2edvdrip%2exvid%2dsfm%2erar/battlestar.galactica.s01e19.e20.dvdrip.xvid-sfm.avi (s1e19) [(?x)rar://.*%(?:2f|5c).*%(?:5f|2[ed]) s(\d+) (?:%(?:5f|2[ed]))?e(\d+)(?:%(?:5f|2[ed]))? e (\d+) %(?:5f|2[ed]).*%(?:2f|5c).*%2erar/[^/]+[.](?:avi|ogm|mkv)]

EDIT: Raw regexp from xml file instead:
Code:
<regexp>(?x)rar://.*%(?:2f|5c).*%(?:5f|2[ed]) S(\d+)            (?:%(?:5f|2[ed]))?E(\d+)(?:%(?:5f|2[ed]))? E  (\d+)                              %(?:5f|2[ed]).*%(?:2f|5c).*%2erar/[^/]+[.](?:avi|ogm|mkv)</regexp>

I've been trying to modify that particular regexp to include the .E20 in the match, and possibly replace the . with a -, but I simply don't understand what the regexp does... Anyone that can explain it? :)

(Yes, I know.. those regexps are unsupported, but hoping someone with a bit more regexp knowledge can throw me a bone :))


- Faldaani - 2010-07-18

nevermind, solved it...

Moved a ( a few steps to the left and the multi episode matching started to work..

Commented out regexp is the old one
Code:
<!-- <regexp>(?x)rar://.*%(?:2f|5c).*%(?:5f|2[ed]) S(\d+)            (?:%(?:5f|2[ed]))?E(\d+)(?:%(?:5f|2[ed]))? E  (\d+)                              %(?:5f|2[ed]).*%(?:2f|5c).*%2erar/[^/]+[.](?:avi|ogm|mkv)</regexp> -->
    <regexp>(?x)rar://.*%(?:2f|5c).*%(?:5f|2[ed]) S(\d+)            (?:%(?:5f|2[ed]))?E(\d+)(?:%(?:5f|2[ed]))? (E  \d+)                              %(?:5f|2[ed]).*%(?:2f|5c).*%2erar/[^/]+[.](?:avi|ogm|mkv)</regexp>



- gaborm - 2010-07-25

To scrape miniseries from TheTVDB like the lates mini The Pillars of the Earth :

The.Pillars.Of.The.Earth.Part2.720p.HDTV.x264-IMMERSE

I use the following:

Code:
<advancedsettings>
  <tvshowmatching action="append">
    <regexp>[\._ \-]p(?:ar)?t[._ -]?()([0-9]+)([\._ \-][^\\/]*)</regexp>
  </tvshowmatching>
</advancedsettings>



don't scan sample folders - Kringlan - 2010-08-07

When indexing I do pick up lots of samples as the movie "Blood simple".

From what i can tell (which isn't nessecarily alot or enough) there is no regex to stop XBMC from indexing movies in folders named "Sample".
Is this so? Is there a reason for this?

Wouldn't something like:

<regexp>[\//]sample[\//]</regexp>
<!-- Any movies in a folder called sample (recursive and case insensitive) will be ignored -->

in the part of the regex listed below do some kind of trick that one might want?

Code:
<!--
    #######################################################################################
    Stop XBMC indexing some unwanted common items
    #######################################################################################
-->
<video>
  <excludefromscan action="prepend">
    <regexp>[\//]extras[\//]</regexp>
    <!-- Any movies in a folder called extras (recursive and case insensitive) will be ignored -->
    <regexp>[\//]sample\.</regexp>
    <!-- Any movies called sample.*  ignored -->
   </excludefromscan>
  <excludetvshowsfromscan action="prepend">
    <regexp>[\//]extras[\//]</regexp>
    <!-- Any TV in a folder called extras (recursive and case insensitive) will be ignored) -->
    <regexp>[\//]sample\.</regexp>
    <!-- Any TV called sample.*  ignored -->
  </excludetvshowsfromscan>
</video>

Unrelated: sometimes CD2 is beeing indexed as "Code two", this is where CD1 is beeing indexed as the real movie.


- rbrohman - 2010-08-14

Thank you very much for this! I had a number of Topaz releases that were previously driving me nuts. 2 minutes after finding this thread and my problems are solved!

I do have a number of shows that ran more than 9 seasons and for those I have used the folder structure: \ShowName\Season 01\

Rather than: \ShowName\Season 1\

Is it possible to modify your REGEX to pickup on both of these folder structures?

Thanks


- snyft - 2010-08-15

Got an issue with X-Files s04e01 it wont add.
Structure:
D:\rar1\series\X-Files\Season 4\The.X-Files.S04EP01.Herrenvolk.REPACK.DVDRip.XviD-SLeTDiVX\sdx-txfs4ep01-repack.part01.rar
The.X-Files.S04EP01.Herrenvolk.DVDRip.XviD-SLeTDiVX.avi

All the other episodes work fine.
Structure:
D:\rar1\series\X-Files\Season 4\The.X-Files.S04EP02.Unruhe.DVDRip.XviD-SLeTDiVX\sdx-txfs4ep02.part01
The.X-Files.4x02.Unruhe.DVDRip.XviD-SLeTDiVX

Edit: Another issue:
G:\rar7\series\Le Comte De Monte Cristo\Le.Comte.De.Monte.Cristo.1998.SUBBED.Part01.STV.DVDRiP.XViD-HLS
Le.Comte.De.Monte.Cristo.1998.SUBBED.Part01.STV.DVDRiP.XViD-HLS.avi

Can somebody please help me fix these issues?


- snyft - 2010-09-02

Need help with a multiepisode of flashforward getting it to scan correctly:
flashforward.s01e11e12.dvdrip.xvid-reward.avi

debug log: http://pastebin.com/Pasab44m


- Ebany - 2010-09-03

Ok, so let me know if I have the wrong thread here. (and forgive any syntax errors, english is difficult when Im this tired)

I downloaded XBMC about 2 weeks ago and started the process of scanning and sorting my movies and tv shows. I had no problems at all with movies apart from making a few basic changes and updates. TV shows are causing me no end of trouble. I have changed everthing from dirctory structure to file structure and still run into the same problem;

When I add the "source" and run a scan it lists the correct serires and downloads the correct information about the series, but lists the series as having no episodes in library.

This is the log without REGEX;

http://pastebin.com/22TVuRJ5

*I have noticed it seems to be having trouble find the information due to a lack of *.nfo but it was my understanding that this build of XBMC did not require a *.nfo file. I created a tvshow.nfo file with correct tag infomation but this caused XBMC to not even recognise the file structure at all an list incorrect information.

This 2nd log is using a copy of the REGEX file provided by xexe (v1.7);

http://pastebin.com/AEavsBZ4

*Same problem as 1st try. I thought the tvshow.nfo file was purely to help the scraper get the correct series (eg. SG <folder> could be SG1 or SGU) and hence, download the correct information.

I have tried all the scrapers to no avail, but only used *.nfo file with one scraper. I am going to try different scrapers/*.nfo and see what happens.

Any advice or help would be great, the more eyes the better Smile


- Ebany - 2010-09-03

Flomaster Wrote:WTF would be making my file look like this ?
http://imgur.com/cdLX6.jpg

I can't even get it working properly

I have seen this type of error when a scraper is trying to retrieve information from an incorrect source.

i.e. If you have the url in your tvshow.nfo as TheTVDB.com but your XBMC scraper set to use TV.com


- xexe - 2010-09-04

gillux on irc found a bug in the exlcude regex. thanks Smile

taking submissions for V1.9 now. Testing against Dharma over the next week.


- zwat - 2010-09-05

have a few issues which this regex maybe can solve.

1) have a few nature tvshow that don't have season just episode.
tv/galapagos/galapagos.partX.blablabla
tv/ganges/ganges.e0X.blabla

2) have beavis and butt-head that is named as volume not season
tv/beavis.and.butthead/beavis.and.butthead.v01e01
can this be added to my library?


- Ebany - 2010-09-06

**Update to my situation**

Have now successfully got my TV Shows working, but in a limited fashion.
I set the scraper to TheTVBD.com and made a tvshow.nfo for Archer (which is the first listed). Unfortunately this was the last scraper I tried, wish it had been the first Smile

Source T:\TV Shows (Current)\
Dir: ..\Archer (2009)\Season 1\Archer *x**.avi
NFO: ..\Archer (2009)\tvshow.nfo

Previously XBMC only detected and retrieved information about the general series but listed no episodes in the dir structure. For reasons I cannot yet work out, this *.nfo in Archer kick started a whole flood of episode information, not just for Archer but also other TV shows in the same source directory (the *.nfo in the archer dir is the only one currently)! By the end of the update process about 8 of the 26 TV shows currently on the source drive became listed with episodes and artwork.

I continued to create *.nfo for any TV shows still not working properly, working down my list in alphabetical order, exiting and restarting XBMC each time to allow for incremental updates (time restraint issues forced me in to practicing this while testing scrapers). Each time I updated a new TV show directory with a *.nfo file, other shows (in most cases) also became visible and had their information updated.

I am now creating a tvshow.nfo file for each series just to be on the safe side. Now I can see shows in all their true XBMC beauty I will cease my error finding and enjoy some hard earned viewing time Smile


- xexe - 2010-09-06

zwat Wrote:have a few issues which this regex maybe can solve.

1) have a few nature tvshow that don't have season just episode.
tv/galapagos/galapagos.partX.blablabla
tv/ganges/ganges.e0X.blabla

There is no way for me to fix that. The current regex allows you to extract information but i cant do replacements. So for instance even if I could match the "X" i couldnt tell XBMC it means 10.

zwat Wrote:have a few issues which this regex maybe can solve.

2) have beavis and butt-head that is named as volume not season
tv/beavis.and.butthead/beavis.and.butthead.v01e01
can this be added to my library?

I have specifically not included that format because almost always V does not mean S. I suspect you can see for your self if you lookup say V01e10 on tvdb and compare it to what your ep is. I am confident you will find it is not the same ep.