Extra REGEX for TV Show Episode matching

  Thread Rating:
  • 15 Votes - 4.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
kwanbis Offline
Senior Member
Posts: 105
Joined: Sep 2011
Reputation: 0
Post: #286
(2013-02-11 10:22)scudlee Wrote:  1x10 isn't found because of the .7 immediately after the episode number:

Speaking of episode titles... The reason season 2 isn't included should become apparent if you compare the file names to the titles being scraped.
Thanks scudle for the s01e10 comment.

Now, I can not seem to understand what is the problem with the season 2 episodes:

21:09:33 T:3796 DEBUG: VideoInfoScanner: No NFO file found. Using title search for 'W:\Once Upon A Time\Once.Upon.A.Time.S02e01.Broken.720p.Webdl.mkv'
21:09:33 T:3796 DEBUG: VIDEO::CVideoInfoScanner::OnProcessSeriesFolder - no match for show: 'Once Upon A Time', season: 2, episode: 1.0, airdate: '01/01/1601', title: ''

The S02 episodes are the same as the S01, the only difference is that it includes the 720p text.

It is weird that is looking for anairdate 01/01/1601, but I do not know why is that happening.
(This post was last modified: 2013-02-11 20:04 by kwanbis.)
find quote
scudlee Offline
Team-Kodi Member
Posts: 839
Joined: Jul 2011
Reputation: 51
Post: #287
Sorry, I was being a little facetious. I meant if you compare the file name of a file that scraped to the episode title that it shows up as in XBMC, you'd notice a discrepancy. e.g.

once.upon.a.time.s01e03.snow.falls.webdl.mkv is scanned in as 1x3. Katy No Pocket (i.e. not 1x3. Snow Falls).

This is because the series is being picked up as Once Upon a Time, and not Once Upon a Time (2011). The earlier series only had one season, so none of the second season episodes will be scanned.

To fix it you just need to add the "(2011)" to the folder name.
find quote
kwanbis Offline
Senior Member
Posts: 105
Joined: Sep 2011
Reputation: 0
Post: #288
(2013-02-11 20:59)scudlee Wrote:  To fix it you just need to add the "(2011)" to the folder name.
That was it! Perfect. I decided to remove all the titles from my episodes, as in any case, XBMC would add them for me. Thanks!
find quote
Kinematics Offline
Junior Member
Posts: 20
Joined: Feb 2013
Reputation: 2
Post: #289
Been spending today working on getting proper regexes for anime. Seems to be solid, and mostly complete. Posting here in case it can help anyone else.

The example files were each tested against the regex to make sure they work. At the moment, every anime TV show I have is properly matched, aside from a few multi-episode files.

Aside: The docs on how multiple episodes per files work (and how the regex is constructed for them) is rather vague, so I just left that out since I couldn't get it to work right. If someone has suggestions, I'd appreciate it.

Simple, uncommented version:
Code:
<advancedsettings>
    <tvshowmatching action="prepend">
        <regexp>(?i)[-._ ]+S(?:eason ?)?(\d{1,3})[-._ ]*(?:ep?[ .]?)?(\d{1,3})(?:[_ ]?v\d+)?[-._ ]*(?:[[({][^])}]+[])}][-_ ]*)*?(?:[[({][\da-f]{8}[])}])</regexp>
        <regexp>(?i)(Special|OVA|OAV)[-._ ]+(?:ep?[ .]?)?(\d{1,3})(?:[_ ]?v\d+)?[-._ ]*(?:[A-Za-z_ ]+)?(?:[[({][^])}]+[])}][-_ ]*)*?(?:[[({][\da-f]{8}[])}])</regexp>
        <regexp>(?i)()[-._ ]+(?:ep?[ .]?)?(\d{1,3})(?:[_ ]?v\d+)?[-._ ]*(?:[A-Za-z_ ]+)?(?:[[({][^])}]+[])}][-_ ]*)*?(?:[[({][\da-f]{8}[])}])</regexp>
    </tvshowmatching>
    
    <tvshowmatching action="append">
        <regexp>(?i)(Special|OVA|OAV)[-._ ]+(?:ep?[ .]?)?(\d{1,3})(?:[_ ]?v\d+)?[-._ ]*(?:[[({][^])}]+[])}][\s-_]*)*[^\\/]+$</regexp>
        <regexp>(?i)()[-._ ]+(?:ep?[ .]?)?(\d{1,3})(?:[_ ]?v\d+)?[-._ ]*(?:[[({][^])}]+[])}][\s-_]*)*[^\\/]+$</regexp>
    </tvshowmatching>
</advancedsettings>

Fully commented version:
Code:
<advancedsettings>
    <tvshowmatching action="prepend">
        <!-- Regex notes: -->
        <!-- First capturing match is assigned to the season.  Second capturing match is assigned to the episode. -->
        <!-- (?i) turns on case-insensitive matching -->
        <!-- (?:stuff) is a non-capturing group for 'stuff', so as not to interfere with season/episode numbers. -->

        <!-- Anime specific matching. -->
        
        <!--
        Building the regex from back to front:
        
        Closing checksum (optionally followed by random text, but we don't have to match that)
        Preceded by any number of bracketed items of any sort of content, with possible spacing, dashes or underscores in between
        Possibly preceded by unbracketed, non-numeric text
        Preceded by the episode number (optionally labelled), with possible version number
        Preceded by various combinations of dash, dot, underscore or space, to separate the title from the episode number
        Possibly preceded by a season number, or 'Special' or 'OVA'
        -->
        
        <!-- Regexes listed in order of match preference -->
        <!-- Put these ahead of normal XBMC matchings, since the names are anchored to checksums. -->
        
        <!-- Include season marker -->
        
        <!-- EG: [CoalGuys] K-ON!! S2 - 05 [4B19B10F] -->
        
        <regexp>(?i)[-._ ]+S(?:eason ?)?(\d{1,3})[-._ ]*(?:ep?[ .]?)?(\d{1,3})(?:[_ ]?v\d+)?[-._ ]*(?:[[({][^])}]+[])}][-_ ]*)*?(?:[[({][\da-f]{8}[])}])</regexp>


        <!-- Special/OVA/OAV marker, which is interpreted as Season 0 by XBMC. -->
        <!-- Not entirely sure about using OAV/OVA in here; can remove if it doesn't work for you. -->
        
        <!-- EG: [SHiN-gx] Fight Ippatsu! Juuden-chan!! - Special 1 [720x480 AR h.264 FLAC][v2][FF09021F].mkv -->
        <!-- EG: [gleam] Kurenai OVA - 01 [OAD][0e73f000].mkv -->

        <regexp>(?i)(Special|OVA|OAV)[-._ ]+(?:ep?[ .]?)?(\d{1,3})(?:[_ ]?v\d+)?[-._ ]*(?:[A-Za-z_ ]+)?(?:[[({][^])}]+[])}][-_ ]*)*?(?:[[({][\da-f]{8}[])}])</regexp>

        
        <!-- Normal non-seasoned names with checksums. -->
        
        <!-- EG: [avatar-nyanko] Koikoi 7 - 01 (DVD) [5E95FA4A] -->
        <!-- EG: [gg]_Chuunibyou_Demo_Koi_ga_Shitai!_-_01_[5B6EFD1F] -->
        <!-- EG: [Eclipse] Akane-iro ni Somaru Saka - 01 (1024x576 h264) [39920E63].mkv -->
        <!-- EG: [gg]_Bakemonogatari_-_01_[CC0CF5D2].mkv -->
        <!-- EG: [Doki]_Asobi_ni_Iku_yo!_-_03v2_(1280x720_h264_AAC)_[B5B9C6F3].mkv -->
        <!-- EG: [Coalgirls]_Yuru_Yuri_02_(1280x720_Blu-Ray_FLAC)_[43E5A6B4] -->
        <!-- EG: Touch 01(DVD) - (112ceb61) Central Anime  -->
        <!-- EG: Cross Game 02 - Central Anime (1280x720) [BF23052D].mp4 -->
        <!-- EG: [Taka]_Naruto_Shippuuden_135_[480p][9073B8C2] -->

        <regexp>(?i)()[-._ ]+(?:ep?[ .]?)?(\d{1,3})(?:[_ ]?v\d+)?[-._ ]*(?:[A-Za-z_ ]+)?(?:[[({][^])}]+[])}][-_ ]*)*?(?:[[({][\da-f]{8}[])}])</regexp>

        <!-- Not working, not sure how to get working yet - multiple episodes per file. -->
        
        <!-- EG: [Triad]_Dokuro-chan_-_01-02.mkv -->
        
    </tvshowmatching>
    
    <tvshowmatching action="append">
        <!-- Alternate version that does not include checksums. Put this after normal XBMC patterns. -->
        <!-- Since it doesn't use the checksum anchor, need to make sure it's not a directory name. -->
        
        <!-- EG: [a.f.k.] Lucky Star - 01.avi -->
        <!-- EG: Air Master - 04 [HQA&N!].avi -->
        <!-- EG: [ANE] Yosuga no Sora - Ep01v2 [BDRip 1080p x264 FLAC] -->
        <!-- EG: [DeadFish] Jinrui wa Suitai Shimashita - Special 01 [BD][720p][AAC].mp4 -->

        <regexp>(?i)(Special|OVA|OAV)[-._ ]+(?:ep?[ .]?)?(\d{1,3})(?:[_ ]?v\d+)?[-._ ]*(?:[[({][^])}]+[])}][\s-_]*)*[^\\/]+$</regexp>

        <regexp>(?i)()[-._ ]+(?:ep?[ .]?)?(\d{1,3})(?:[_ ]?v\d+)?[-._ ]*(?:[[({][^])}]+[])}][\s-_]*)*[^\\/]+$</regexp>

    </tvshowmatching>
</advancedsettings>
find quote
gahenna Offline
Junior Member
Posts: 19
Joined: Oct 2010
Reputation: 0
Post: #290
I have been trying to get XBMC to scrape the shows I have without manually adding the nfo's with no sucess. I have TheRenamer put the files in the format Show/Show.s01e01.name.mkv. I have read through the REGEX that you have been posting and I'm not sure how it will help in me. They seem to help if you keep the files in a format other than the preferred XBMC formats.
Q1. Is there a format I can use that will allow the XBMC scraper to actually do it's job?

Q2. Is there a way I can set up the code to direct certain files to certain shows? Eg. Recognize the show format as Once Upon a Time and start scraping on that?

I have attached my debug code below. pastebin

Thank you
find quote
scudlee Offline
Team-Kodi Member
Posts: 839
Joined: Jul 2011
Reputation: 51
Post: #291
According to your log, you have a tvshow.nfo file (containing xml) in the Once Upon a Time (2011), but it doesn't have an <episodeguide> tag in it. All your episodes are being enumerated correctly, but without the episodeguide URL, there's nothing to match them against.

Delete the tvshow.nfo and everything should work.
find quote
gahenna Offline
Junior Member
Posts: 19
Joined: Oct 2010
Reputation: 0
Post: #292
So by having Ember Media scrape some episodes I am doing a disservice to my media? XBMC should handle it all or have it all handled 3rd party?
find quote
jenkins Offline
Junior Member
Posts: 27
Joined: Jul 2010
Reputation: 0
Post: #293
Hi!

I know this is old stuff but i was wondering if it is possible to have one folder full of tvshow files?

like:
MyTVShows/some.serie.bla.SxxExx.bla.mkv
MyTVShows/some.other.serie.bla.SxxExx.bla.mkv

do some one know of a way to do this?

If I've helped you, hit me with some points...

OpenELEC rTorrent Service addon HERE
Optimized remote.xml HERE

find quote
vandark Offline
Junior Member
Posts: 12
Joined: Apr 2013
Reputation: 0
Post: #294
hello my series located in a remote ftp server in movies not have a problem but in tv shows the scrappers not recognice the foders and not work correctly ( im tested xem and theTVDB)

the sctructure is:

Tv Shows/_seasons_completes_/The.serie.example.s01.complete.blabhah.2008.blablah/The.serie.example.s01e01..blabhah.720p.blablah/blahblah.the.serie.s01e01.720p.mkv


if I give right click and obtain information from the TV series and manually put the name of the TV series if I updated everything inside that folder correctly.

the problem is that all folders in the series instead of putting a space put a point. (.)

If I put the number with spaces works well
find quote
vandark Offline
Junior Member
Posts: 12
Joined: Apr 2013
Reputation: 0
Post: #295
in advancedsettings.xml

<advancedsettings>
<video>
<cleanstrings>
<regexp>[ \,\.\(\)\[\]\-](spanish|[Ss]([0-9]+)[\.\-]?[Ee]([0-9]+)|\[.*\])([ \,\.\(\)\[\]\-]|$)</regexp>
<regexp>(\[.*\])</regexp>
</cleanstrings>
</video>
</advancedsettings>


tvshows in the folder ftp://series scan correcty and works great

but

the tv shows in http://ftp._seasons.completes./ dont scan and not working correctly around the 90% fault on detecting tv shows,


any iddea ??

HELP!!!!
find quote
vandark Offline
Junior Member
Posts: 12
Joined: Apr 2013
Reputation: 0
Post: #296
this is the log for help.

23:49:23 T:2866803776 DEBUG: scraper: CreateSearchUrl returned <url cache="cache-crimen.en.el.paraiso.s01.xml">http://www.thetvdb.com/api/GetSeries.php?seriesname=crimen.en.el.paraiso.s01&amp;language=es</url>
23:49:23 T:2866803776 DEBUG: CurlFile::Open(0xa8312a78) http://www.thetvdb.com/api/GetSeries.php...anguage=es
23:49:23 T:2866803776 DEBUG: scraper: GetSearchResults returned <?xml version="1.0" encoding="utf-8" standalone="yes"?><results></results>
23:49:23 T:2866803776 WARNING: No information found for item 'ftp://user:pass@ftpserver/SERIES/_Temporadas.Completas_/Crimen.En.El.Paraiso.S01.SPANiSH.720p.HDTV.x264-XPERT_HD/', it won't be added to the library.
23:49:24 T:2866803776 DEBUG: VideoInfoScanner: No NFO file found. Using title search for 'ftp://user:pass@ftpserver/SERIES/_Temporadas.Completas_/Cronicas.Vampiricas.S03.SPANiSH.720p.HDTV.x264-sPHD/'
23:49:24 T:2866803776 DEBUG: FindMovie: Searching for 'Cronicas Vampiricas S03' using XEM scraper (path: '/home/pi/.xbmc/addons/metadata.thexem.de', content: 'tvshows', version: '1.0.5')
23:49:24 T:2866803776 DEBUG: scraper: CreateSearchUrl returned <url cache="cache-cronicas%20vampiricas%20s03.xml">http://www.thetvdb.com/api/GetSeries.php?seriesname=cronicas%20vampiricas%20s03&amp;language=es</url>
23:49:24 T:2866803776 DEBUG: CurlFile::Open(0xa262e3e0) http://www.thetvdb.com/api/GetSeries.php...anguage=es
23:49:25 T:2866803776 DEBUG: scraper: GetSearchResults returned <?xml version="1.0" encoding="utf-8" standalone="yes"?><results></results>
23:49:25 T:2866803776 DEBUG: FindMovie: Searching for 'Cronicas.Vampiricas.S03' using XEM scraper (path: '/home/pi/.xbmc/addons/metadata.thexem.de', content: 'tvshows', version: '1.0.5')
23:49:25 T:2866803776 DEBUG: scraper: CreateSearchUrl returned <url cache="cache-cronicas.vampiricas.s03.xml">http://www.thetvdb.com/api/GetSeries.php?seriesname=cronicas.vampiricas.s03&amp;language=es</url>
23:49:25 T:2866803776 DEBUG: CurlFile::Open(0xa262e3e0) http://www.thetvdb.com/api/GetSeries.php...anguage=es
23:49:25 T:2866803776 DEBUG: scraper: GetSearchResults returned <?xml version="1.0" encoding="utf-8" standalone="yes"?><results></results>
23:49:25 T:2866803776 WARNING: No information found for item 'ftp://user:pass@ftpserver/SERIES/_Temporadas.Completas_/Cronicas.Vampiricas.S03.SPANiSH.720p.HDTV.x264-sPHD/', it won't be added to the library.
23:49:26 T:2866803776 DEBUG: VideoInfoScanner: No NFO file found. Using title search for 'ftp://user:pass@ftpserver/SERIES/_Temporadas.Completas_/Cuentame.Como.Paso.S13.SPANISH.720p.HDTV.x264-sPHD/'
23:49:26 T:2866803776 DEBUG: FindMovie: Searching for 'Cuentame Como Paso S13' using XEM scraper (path: '/home/pi/.xbmc/addons/metadata.thexem.de', content: 'tvshows', version: '1.0.5')
find quote
MasterCATZ Offline
Junior Member
Posts: 33
Joined: Feb 2012
Reputation: 0
Post: #297
<regexp>[Ss]([0-9]+)[][ ._-]*[Ee][Pp]([0-9]+)([^\\/]*)$</regexp> <!-- foo.s01.ep01, foo.s01_ep01, S01EP02 foo -->


just came across some files named foo.S02.Ep01.foo

for some reason after adding in the [Pp] it was regex'd properly .. it was adding all episodes as season 1 and ignoring all the season numbering

what I could not work out is it was getting the episode numbers right
find quote
JaKXz Offline
Junior Member
Posts: 4
Joined: Aug 2013
Reputation: 0
Post: #298
Hi, I have the following example of a TV show and it's path and filename:

Code:
/Volumes/Data/Media/TV/Suits/Season 3/04 - Conflict of Interest [720p].mkv

And this regex to get the season #, episode #, and name:

Code:
(?i)(?<season>se|season\W?(\d{1,2}))\D*[/\\](?<episode>\d{1,2})\W*(?<name>(\w*.\b){1,})

which from the target string example returns
Code:
Season 3/04 - Conflict of Interest

What am I missing in my advancedsettings.xml (I have it under
Code:
<tvshowmatching action="append">
) to make this find all the episodes that are missing from my TV subfolders? I.e. How can I make XMBC recognize the three things I (think) I have pulled from the file string and thus properly list all my episodes?

Please let me know if I can clarify this question better, thanks in advance! Smile
(This post was last modified: 2013-08-11 06:12 by JaKXz.)
find quote
luhanmcs Offline
Junior Member
Posts: 2
Joined: Jun 2013
Reputation: 0
Location: Brazil
Post: #299
I need help because I have some episodes of series that are divided into pieces and languages​​.
Ex1. Futurama - 00x01 - Bender's Big Score [Part 1].avi, Futurama - 00x01 - Bender's Big Score [Part 2].avi, Futurama - 00x01 - Bender's Big Score [Part 3].avi
Ex2. Hunter x Hunter - 01x01 - [br].avi, Hunter x Hunter - 01x01 - [jp].avi
I want the text that is written within brackets is shown in my xbmc library for the titles shown are not repeated.
It's Possible editing the file "advancedsettings.xml" without having to create NFO files?
find quote
snyft Offline
XBMC Fan
Posts: 168
Joined: Jul 2010
Reputation: 0
Location: Sweden
Post: #300
So i was wondering if i use the xbmc standard stacking regexp commands:
<moviestacking>
<!-- <cd/dvd/part/pt/disk/disc/d> <0-N> -->
<regexp>(.*?)([ _.-]*(?:cd|dvd|p(?:ar)?t|dis[ck]|d)[ _.-]*[0-9]+)(.*?)(\.[^.]+)$</regexp>
<!-- <cd/dvd/part/pt/disk/disc/d> <a-d> -->
<regexp>(.*?)([ _.-]*(?:cd|dvd|p(?:ar)?t|dis[ck]|d)[ _.-]*[a-d])(.*?)(\.[^.]+)$</regexp>
<!-- movienamea-xvid.avi, movienameb-xvid.avi -->
<regexp>(.*?)([ ._-]*[a-d])(.*?)(\.[^.]+)$</regexp>
</moviestacking>

Do they cover the ones included in this settingsfile (ie is it outdated)?
<regexp>(?i)(.*-done[\. _-])(\d)(\.)(\w{3})$</regexp> <!-- movie name.blah.DVDRip.XviD-DoNE.1.avi -->
<regexp>(?i)(.*?[\. _-]cd)(\d)([\. _-].*?\.)(\w{3})$</regexp> <!-- movie name.blah.iNTERNAL.DVDRip.XViD.CD1-TWiST.avi -->
<regexp>(?i)(.*?[\. _-]cd)(\d)(\.)(\w{3})$</regexp> <!-- group-40yearoldv-cd1.avi -->
<regexp>(?i)(.*?cd)(\d)(\.)(\w{3})$</regexp> <!-- group-30doncd1.avi -->
<regexp>(?i)(.*[\. _-])([abc])(\.)(\w{3})$</regexp> <!-- group-310ty-a.avi -->
<regexp>(?i)(.*?)([abc123])(\.)(\w{3})$</regexp> <!-- group-outa.avi -->
<regexp>(?i)(.*?)([abc123])([\. _-](?:xvid|divx|int)\.)(\w{3})$</regexp> <!-- group-moviea-xvid.avi -->
<regexp>(?i)(.*)(\d{1,2})(\.)(\w{3})$</regexp> <!-- group-movie2.avi -->
<regexp>(?i)(.*)(\d{1,2})([\. _-]\w{3,10}\.)(\w{3})$</regexp> <!-- movie1-grp.avi -->
<regexp>(?i)(.*?[\. _-])(\d{1,2})(\.)(\w{3})$</regexp> <!-- movie-name-01.avi.avi -->
<regexp>(?i)(.*?[\. _-]part)(\d{1,2})([\. _-].*?\.)(\w{3})$</regexp> <!-- Movie.name.DvDrip.Part1-group.avi -->
<regexp>(?i)(.*[\. _-])([123abc])([\. _-].*\.)(\w{3})$</regexp> <!-- the.movie.dual.audio-a-group.avi -->
<regexp>(?i)(.*)(\w)(Of[123].*\.)(\w{3})$</regexp> <!-- the movie - blah1Of2-.avi -->
<regexp>(?i)(.*)([123abc])(-int\.)(\w{3})$</regexp> <!-- group-movie4a-int.avi -->
find quote
Post Reply