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


RE: Extra REGEX for TV Show Episode matching - locust - 2014-03-24

Hello - is this advancedsettings.xml fully compatible with the new version 13 betas?

The second season of Breaking Bad will not scan in due to unrecognizable filenames (bb201-clue.rar), and I'm hoping by simply modifying some of the other entries in this advancedsettings.xml I can fix this as well


RE: Extra REGEX for TV Show Episode matching - mcfreiz - 2014-05-07

can anyone help me out or point me in the some direction to figure out regexs in general. im trying to scrape 24 and it finds some episodes but not others. here is a example

V:\Videos\TV_Shows\24\24 S01 dvdrip\24.s01e01.12am - 1am.avi (OK)
V:\Videos\TV_Shows\24\24 S01 dvdrip\24.s01e02.1am - 2am.avi (NO GOOD)


RE: Extra REGEX for TV Show Episode matching - _Shorty - 2014-05-09

Easiest fix would be to simply remove the episode name portion of the filename, I imagine.

24.s01e01.avi
24.s01e02.avi

May not be desirable, but I bet it's the quickest fix.
(2014-05-07, 23:36)mcfreiz Wrote: can anyone help me out or point me in the some direction to figure out regexs in general. im trying to scrape 24 and it finds some episodes but not others. here is a example

V:\Videos\TV_Shows\24\24 S01 dvdrip\24.s01e01.12am - 1am.avi (OK)
V:\Videos\TV_Shows\24\24 S01 dvdrip\24.s01e02.1am - 2am.avi (NO GOOD)



RE: Extra REGEX for TV Show Episode matching - Quiksmage - 2014-05-09

I've been looking for this for a while, but for the life of me I cannot figure this out.
I have a structure for certain anime where they have a season 1 and season 2, but the episodes do not contain season in their name, but rather in the folder above
for instance
Darker than Black/Season 1/Darker_Than_Black_01_blah.mkv
Darker than Black/Season 2/Darker_Than_Black_-_Ryuusei_no_Gemini_01_blah.mkv
because of the way different seasons tend to work in anime I'd like to keep the structure this way rather than renaming them s01e01 s02e02
The above is not identical for all cases as some have spaces instead of underscore or periods, etc
Is it possible to have a regex work for this?

I've tried all of these, but none of them will scrape anything similar to above
Code:
    <regexp>(?i)[/\\](?:s|season)\s?(\d{1,2})[/\\](\d{1,2})([^/\\]*)</regexp>    
    <regexp>(?i)[/\\](?:s|season)\W?(\d{1,2})\D*[/\\]\D+[\. _-](\d{1,2})[\. _-]\D+</regexp>
    <regexp>Season[\._ ]([0-9]+)[\\/]([0-9]+)([^\\/]*)$</regexp>
    <regexp>(?i)[/\\](?:s|season)\W?(\d{1,2})\D*[/\\].*?\Wchapter\W?(\d{1,2})\W([^/\\]*)</regexp>

I wish i understood regex more so I didn't feel so helpless.
Beyond helping with my above problem, can anyone give me examples of what exactly each of the above regex examples will accomplish? If it's too much trouble, I understand.


RE: Extra REGEX for TV Show Episode matching - unsynaps - 2014-06-15

OK. It looks like XBMC 13 took out what was once a VALID way (Working in XBMC 11 & 12) of naming TV episodes to be scraped.

All of my TV episodes are named in the following way:

<show name>_[sXX]_[eXX]_<other random stuff like release group, codec, source, ect>.<extension>

After upgrading to 13 none of my TV shows scrape at all and after 30 min of ripping my hair out I found out that a change in 13 is the problem.

Basically you can not encase season and episode in brackets anymore.

I have been digging around to find the old regexep commands for at least v12 so I can add them to advancedsettings.xml but can not find they anywhere. Does anyone have them or know of a regexp string that will work so I do not have to rename hundreds of TV episodes?

EDIT: Answered my own question. Found what I needed digging even further back in this thread.

<tvshowmatching>
<regexp>\[[Ss]([0-9]+)\]_\[[Ee]([0-9]+)([^\\/]*)</regexp>
</tvshowmatching>

All my TV shows are now scraping again.


RE: Extra REGEX for TV Show Episode matching - jpichie - 2014-08-12

hey guys, trying out kodi 14 (XBMC 14) Alpha 2, as I am debating making the move from mediaportal. (mostly for the android box support)
Movies imported no problem, my problem is with my tvshows (series).

they are in the following format
tvshow\Seaon n\ep# - epname.ext
ie
scrubs\Season 1\01 - pilot.mkv

Could someone help me out with the regex required to get this to import correctly?
thanks

no need to reply, I got this working with
<advancedsettings>
<tvshowmatching action="prepend">
<regexp>Season[\._ ]([0-9]+)[\\/]([0-9]+)[^\\/]*</regexp>
</tvshowmatching>
</advancedsettings>

the issue I was having was, since I am using version 14 the advancedsettings.xml had to be put under a different location (C:\program files\XBMC\system)
good thing the logs were helpful with locating this


RE: Extra REGEX for TV Show Episode matching - cheeseblock - 2014-08-15

Hi!

I am struggling to get my library of TV shows to display. My folder/file structure is as follows:
[Show name]
-- Season [n (with leading zero if less than 10)]
---- [Show name] - Season [n (with leading zero if less than 10)] - Episode [n (with leading zero if less than 10)].ext

For example: Veep\Season 01\Veep - Season 01 - Episode 02.mkv.

Also, if the TV show is British I use Series in place of Season, as that's what we tend to use here.

I noticed in the FAQ on the Wiki that this regexp should suit my needs:
Quote:4.3.1 Examples
A fairly straightforward example to begin.
Season ## - Episode ##
"Season [season#] - Episode [episode#]" anywhere in the file name
<tvshowmatching action="prepend">
<regexp>Season ([0-9]+) - Episode ([0-9]+)([^\\/]*)$</regexp>
</tvshowmatching>
Example : TV Shows\Scrubs\Season 1\Scrubs - Season 1 - Episode 01 - Pilot.avi
The first two capturing groups should be obvious, the third group ([^\\/]*) captures everything up to the end of the file name $, this allows for multi-part file names such as name.Season 1 - Episode 01 - Season 1 - Episode 02.ext as well as the simpler name.Season 1 - Episode 01-02.ext

So I put that in advancedsettings.xml and shoved it in my userdata folder but after adding my library source every TV show listed is empty.


RE: Extra REGEX for TV Show Episode matching - oggie62 - 2014-09-25

(2014-08-12, 17:25)jpichie Wrote: hey guys, trying out kodi 14 (XBMC 14) Alpha 2, as I am debating making the move from mediaportal. (mostly for the android box support)
Movies imported no problem, my problem is with my tvshows (series).

they are in the following format
tvshow\Seaon n\ep# - epname.ext
ie
scrubs\Season 1\01 - pilot.mkv

Could someone help me out with the regex required to get this to import correctly?
thanks

no need to reply, I got this working with
<advancedsettings>
<tvshowmatching action="prepend">
<regexp>Season[\._ ]([0-9]+)[\\/]([0-9]+)[^\\/]*</regexp>
</tvshowmatching>
</advancedsettings>

the issue I was having was, since I am using version 14 the advancedsettings.xml had to be put under a different location (C:\program files\XBMC\system)
good thing the logs were helpful with locating this

Hi

I use exactly the same file format as you so I used the same regex string as you but all I get is the show title but no seasons or episodes.

Before I was using V3.04 but am trying the current stable release (4.07)

Before, I had this :

Code:
<advancedsettings>
<tvshowmatching action="prepend">
     <regexp>Season[\._ ]([0-9]+)[\\/]([0-9]+)([^\\/]*)$</regexp>
</tvshowmatching>
</advancedsettings>

I noticed that whatever I put in advancedsettings, it seems xbmc simply ignores it Sad

Also, the tvshows are being marked as watched.....
Any idea what's wrong ?


RE: Extra REGEX for TV Show Episode matching - oggie62 - 2014-09-26

(2014-08-12, 17:25)jpichie Wrote: hey guys, trying out kodi 14 (XBMC 14) Alpha 2, as I am debating making the move from mediaportal. (mostly for the android box support)
Movies imported no problem, my problem is with my tvshows (series).

they are in the following format
tvshow\Seaon n\ep# - epname.ext
ie
scrubs\Season 1\01 - pilot.mkv

Could someone help me out with the regex required to get this to import correctly?
thanks

no need to reply, I got this working with
<advancedsettings>
<tvshowmatching action="prepend">
<regexp>Season[\._ ]([0-9]+)[\\/]([0-9]+)[^\\/]*</regexp>
</tvshowmatching>
</advancedsettings>

the issue I was having was, since I am using version 14 the advancedsettings.xml had to be put under a different location (C:\program files\XBMC\system)
good thing the logs were helpful with locating this



RE: Extra REGEX for TV Show Episode matching - oggie62 - 2014-09-27

First of all, sorry for double post Sad

In the Userdata folder there is a file called profiles.xml - in it is this line :

Code:
<directory pathversion="1">special://masterprofile/</directory>

but should be

Code:
<directory pathversion="1">special://masterprofile/advancedsettings.xml</directory>

Question is why ?

Obviously I could edit profiles.xml but every time I reboot, the line Is back as before....what am I doing wrong ?


RE: Extra REGEX for TV Show Episode matching - oggie62 - 2014-09-27

I know that modifying that line in profiels.xml is not the way to do it but when I add a show and scrape it, it either only returns the title or title & 1 season.....ignoring the other seasons. Sad


RE: Extra REGEX for TV Show Episode matching - oggie62 - 2014-09-28

After a weekend of experiments and tweaks, I seem to have solved the problem - thanks anyway Big Grin


RE: Extra REGEX for TV Show Episode matching - renne - 2014-09-30

OnlineTvRecorder.com is an online service recording more than 100 north american and european TV stations for millions of users. Unfortunately TheTVDB scraper does not match the filenames.

Example:

31570_NCIS__Los_Angeles__Between_the_Lines_14.03.18_21-00_uswcbs_61_TVOON_DE.mpg.HQ.cut.mp4

Cutlist number (optional): 31570_
Show title: NCIS__Los_Angeles
Episode title (optional):__Between_the_Lines
Year.month.day: _14.03.18
Hour-minute: _21-00
TV station: _uswcbs
Uncutted runtime: _61
Software (optional): _TVOON_DE
Video codec (always): .mpg
High resolution (optional): .HQ|.HD
Cutted (optional): .cut
File extension/container: .avi | .mp4 | .ac3 | .mp3 | .flv

Whitespaces and special characters are replaced by underscore. Underscore and Dot are used to separate elements.

I've created the following RegExp:

Code:
<advancedsettings>
    <tvshowmatching action="prepend">
        <regexp bydate="true">^.+_([0-9]{2})\.([0-9]{2})\.([0-9]{2})_.+$</regexp>
    </tvshowmatching>
</advancedsettings>

How can I insert "20" for a 4-digit year?

Thanx for any hint,

Renne


RE: Extra REGEX for TV Show Episode matching - lukemb - 2014-11-27

Hi xexe (and others),

We at team Media Browser are creating a managed version of Kodi's file naming support. You can see details about the project here:

http://mediabrowser.tv/community/index.php?/topic/13206-contribute-to-the-new-file-naming-project
https://github.com/MediaBrowser/MediaBrowser.Naming

It will become the new file naming engine for Media Browser Server, and the data will flow through the api to our clients such as XBMB3C.

The library will be heavily unit tested. If anyone would like to help share their expertise, all are welcome. Thanks!


RE: Extra REGEX for TV Show Episode matching - quade1337 - 2014-12-19

i downloaded the lastest advancedsettings.xml it helped me scrape alot of tv shows... but there is till one show not working

Could not enumerate file beavis_and_butthead.v02s01.plastic_surgin.dvdrip_xvid-fov.avi

wat do i gotta add or edit in the advancedsettings.xml