Questions about regex and scraper for a special directory-structure for tv-show
#1
Hi @all,

i've posted the nearly same question some days before into this thread, but maybe this is a question for a more common place. So sorry for this double-posting...

I'm using the pvr-branch of xbmc-eden with vdr as tv-backend. In vdr there is a script which is sorting new recorded episodes in a special directory order:
Code:
/<some_dir>/<some_dir>/<name_of_the_tvshow>/<season><number>/<number><episode name>/<special_vdr_directory>/<filename>

So as example this will give for Lost, Season 1, Episode 03 (Tabula Rasa):
Code:
/recordings/TVShows/Lost/Season_01/03._Tabula_Rasa/2010-09-27.23.25.17-0.rec/00001.ts

I thought i could start with this:
Code:
<regexp>(?i)[/\\](?:s|season)\W?(\d{1,2})\D*[/\\](\d{1,2})\W([^/\\]*)</regexp>

because in xexe's above mentioned thread this regex would match a dir-structure like this:
Code:
/UFO/Season 1/02.Computer.Affair.Divx e.g. lame sequntial numbering witout season

but the problem is that in this example the episode-name is within the filename. In my case the name of the episode is in the directory (here: Tabula Rasa) and the videofile itself is located some hierarchy-levels below (here: 00001.ts). How can i put this together for xbmc? Which information is needed by xbmc at all?
So, this is just the first part of the problem. Second is, that the filename has not always the *.ts-extension, because vdr had also its own video-format with the extension *.vdr. And the video files also can be splitted into 00001.vdr, 00002.vdr and so on.

Any hint? Thanks in advance, my brain is losing always some persent of its healthy cells when it has to think about regex, so if could help me you would really save me from death or worse Wink

regards, Jens
Reply
#2
Keep things simple: If you want to match the Season_##/##. then match just that:

Code:
<regexp>Season_([0-9]+)[/\\]([0-9+])\.</regexp>

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
Hi jmarshall,

thanks for your answer, but sadly your example doesnt do it in my case. I tried something again, and i found something which is working in the evaluators @ the web, but not within xbmc.

With this regex-line:

Code:
(?i)[/\\](?:s|staffel_)\W?(\d{1,2})\W?(\d{0,2})\W?\w([\wßöäüÖÄÜ]+)

for this recording-path:

Code:
pvr://recordings/Serie/Body_of_Proof/Staffel_02/03._Das_größte_Opfer/2012-03-09.21.12.7-0.rec/00001.ts

i got this output at http://regexp-tester.mediacix.de/exp/regex/:

Code:
Array
(
    [0] => /Staffel_02/03._Das_größte_Opfer
    [1] => 02
    [2] => 03
    [3] => Das_größte_Opfer
)

In this array i see the season-number [1], the episode-number [2] and the episode-name [3]. But this doesnt seems to be enough, as xbmc shows this in the log:
Code:
16:17:32 T:2953850880   DEBUG: VideoInfoScanner: No NFO file found. Using title search for 'pvr://recordings/Serie/Body of Proof/Staffel 01/'
16:17:32 T:2953850880   DEBUG: FindMovie: Searching for 'Body of Proof/Staffel 01' using The TVDB scraper (path: '/Applications/XBMC.app/Contents/Resources/XBMC/addons/metadata.tvdb.com', content: 'tvshows', version: '1.2.4')
16:17:32 T:2953850880   DEBUG: scraper: CreateSearchUrl returned <url>http://www.thetvdb.com/api/GetSeries.php?seriesname=body%20of%20proof%2fstaffel%2001&amp;language=de</url>
16:17:32 T:2953850880   DEBUG: CurlFile::Open(0xb0102674) http://www.thetvdb.com/api/GetSeries.php?seriesname=body%20of%20proof%2fstaffel%2001&language=de
16:17:32 T:2953850880    INFO: easy_aquire - Created session to http://www.thetvdb.com
16:17:33 T:2953850880   DEBUG: scraper: GetSearchResults returned <?xml version="1.0" encoding="utf-8" standalone="yes"?><results></results>
16:17:33 T:2953850880   DEBUG: FindMovie: Searching for 'Body of Proof/Staffel 01' using The TVDB scraper (path: '/Applications/XBMC.app/Contents/Resources/XBMC/addons/metadata.tvdb.com', content: 'tvshows', version: '1.2.4')
16:17:33 T:2953850880   DEBUG: scraper: CreateSearchUrl returned <url>http://www.thetvdb.com/api/GetSeries.php?seriesname=body%20of%20proof%2fstaffel%2001&amp;language=de</url>
16:17:33 T:2953850880   DEBUG: CurlFile::Open(0xb0102674) http://www.thetvdb.com/api/GetSeries.php?seriesname=body%20of%20proof%2fstaffel%2001&language=de
16:17:33 T:2953850880   DEBUG: scraper: GetSearchResults returned <?xml version="1.0" encoding="utf-8" standalone="yes"?><results></results>
16:17:33 T:2953850880   DEBUG: VideoInfoScanner: No NFO file found. Using title search for 'pvr://recordings/Serie/Body of Proof/Staffel 02/'
16:17:33 T:2953850880   DEBUG: FindMovie: Searching for 'Body of Proof/Staffel 02' using The TVDB scraper (path: '/Applications/XBMC.app/Contents/Resources/XBMC/addons/metadata.tvdb.com', content: 'tvshows', version: '1.2.4')
16:17:33 T:2953850880   DEBUG: scraper: CreateSearchUrl returned <url>http://www.thetvdb.com/api/GetSeries.php?seriesname=body%20of%20proof%2fstaffel%2002&amp;language=de</url>
16:17:33 T:2953850880   DEBUG: CurlFile::Open(0xb0102674) http://www.thetvdb.com/api/GetSeries.php?seriesname=body%20of%20proof%2fstaffel%2002&language=de
16:17:34 T:2953850880   DEBUG: scraper: GetSearchResults returned <?xml version="1.0" encoding="utf-8" standalone="yes"?><results></results>
16:17:34 T:2953850880   DEBUG: FindMovie: Searching for 'Body of Proof/Staffel 02' using The TVDB scraper (path: '/Applications/XBMC.app/Contents/Resources/XBMC/addons/metadata.tvdb.com', content: 'tvshows', version: '1.2.4')
16:17:34 T:2953850880   DEBUG: scraper: CreateSearchUrl returned <url>http://www.thetvdb.com/api/GetSeries.php?seriesname=body%20of%20proof%2fstaffel%2002&amp;language=de</url>
16:17:34 T:2953850880   DEBUG: CurlFile::Open(0xb0102674) http://www.thetvdb.com/api/GetSeries.php?seriesname=body%20of%20proof%2fstaffel%2002&language=de
16:17:34 T:2953850880   DEBUG: scraper: GetSearchResults returned <?xml version="1.0" encoding="utf-8" standalone="yes"?><results></results>
16:17:34 T:2953850880   DEBUG: VideoInfoScanner: No (new) information was found in dir pvr://recordings//Serie/
16:17:34 T:2953850880  NOTICE: VideoInfoScanner: Finished scan. Scanning for video info took 00:01
16:17:34 T:2953850880    INFO: Video scan was stopped or finished ... restoring FindRemoteThumbs

It seems xbmc looks at a completely different string like "Body of Proof/Staffel 02", but in this string there is no information about the episode. Anybody has some more hints for me?

Thanks, Jens
Reply
#4
Find MOVIE. Set content to tvshows.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
(2012-05-13, 03:05)jmarshall Wrote: Find MOVIE. Set content to tvshows.
Hi,

i think it is set to tvshow. Look at the whole line:
FindMovie: Searching for 'Body of Proof/Staffel 01' using The TVDB scraper (path: '/Applications/XBMC.app/Contents/Resources/XBMC/addons/metadata.tvdb.com', content: 'tvshows', version: '1.2.4')

thanks, jennix
Reply
#6
Right (we've really got to fix that message), but the searching is done for shows, and given the folder it's looking in, it's one folder too deep.

It looks like you've "Set content" on the wrong folder and/or not enabled the "this folder contains a single tvshow".
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#7
(2012-05-13, 11:43)jmarshall Wrote: Right (we've really got to fix that message), but the searching is done for shows, and given the folder it's looking in, it's one folder too deep.

It looks like you've "Set content" on the wrong folder and/or not enabled the "this folder contains a single tvshow".
Hmm. I'm using xbmc with pvr, and the folder, which i want to read is a sub-directory of my VDR. This folder is holding all my tvshows in this way:

Code:
/Video/Serie/<TVShow_Name1>/
/Video/Serie/<TVShow_Name1>/<Season_01>/
/Video/Serie/<TVShow_Name1>/<Season_01>/<Ep-01>._<Episodename>/2011-02-09.21.12.7-0.rec/00001.ts
/Video/Serie/<TVShow_Name1>/<Season_01>/<Ep-02>._<Episodename>/2011-03-09.21.12.7-0.rec/00001.ts
[...]
/Video/Serie/<TVShow_Name1>/<Season_02>/
/Video/Serie/<TVShow_Name1>/<Season_02>/<Ep-01>._<Episodename>/2012-02-07.21.12.7-0.rec/00001.ts
/Video/Serie/<TVShow_Name1>/<Season_02>/<Ep-02>._<Episodename>/2012-02-14.21.12.7-0.rec/00001.ts
[...]
/Video/Serie/<TVShow_Name2>/<Season_01>/
/Video/Serie/<TVShow_Name2>/<Season_01>/<Ep-01>._<Episodename>/2009-12-21.21.12.7-0.rec/00001.ts
/Video/Serie/<TVShow_Name2>/<Season_01>/<Ep-02>._<Episodename>/2009-12-28.21.12.7-0.rec/00001.ts
[...]

If i read them over the pvr-module, then the first part of these paths "/Video" will be substituted by "pvr://recordings", so i get this new path:

pvr://recordings/Serie/<TVShow_Name2>/<Season_01>/<Ep-01>._<Episodename>/2009-12-21.21.12.7-0.rec/00001.ts

If i want to get the TV-Shows-Folder into my database, i browse to pvr://recordings/Serie. So i didnt have to set "one show in this folder", because there are many shows in it. If i do it in this way, xbmc is recognizing none of the shows.

If i try to get this folder via smb (the whole /video-Folder is exported as Samba-Share), and not via pvr, xbmc is recognizing the shows, but not the episodes, so i got some fanart for the shows but cannot view any single episode.

If it try to go one folder deeper (not only pvr://recordings/Serie, but as example pvr://recordings/Serie/Body of Proof), xbmc just found nothing, no matter if i set "one show in this folder" or not. Same as i tried it via samba.

Maybe you can tell me which information exactly the scaper needs to do some good work?

thanks, jennix
Reply
#8
If you set content on folder A then:

1. If you have "This folder contains a single TV show" enabled then it will use "A" as the showname to lookup.

2. If you have "This folder contains a single TV show" disabled (the default) then it will use the direct subfolders inside A as the shownames to lookup.

XBMC does not look further than this for shows. First step is getting the shows found.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#9
(2012-05-13, 22:00)jmarshall Wrote: If you set content on folder A then:

1. If you have "This folder contains a single TV show" enabled then it will use "A" as the showname to lookup.

2. If you have "This folder contains a single TV show" disabled (the default) then it will use the direct subfolders inside A as the shownames to lookup.

XBMC does not look further than this for shows. First step is getting the shows found.

Cheers,
Jonathan
Except in neither scenario would XBMC use the names of two folders as the show name to look up, and based on the log, that seems to be what's happening, i.e. "Body of Proof/Staffel 02". That's a little odd.

Reply
#10
XBMC uses the routine CFileItem::GetMovieName() to determine the show name based on the folder we get.

Looks like the PVR builds have something (a bug) that is causing this to do the wrong thing.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#11
Hi @all,

thanks for your answers. Today evening i'll try to go back and delete my tv.db in xbmc and then i'll try to import my tvshow-folder step by step. I will post every step here together with the xbmc-debug-log, so i hope that we will have success. At some day... Wink

regards, jennix
Reply
#12
Hi @all,

as i said before i tried to do the whole video-in-database-stuff from scratch and step by step. So i deleted the tv20.db and started to import the tvshows-folder via PVR. I selected the directory directly above the tvshow-name-folders, select content=tvshows, language=de and click at OK. XBMC founds nothing. The part of the xbmc.log for these actions is here: http://pastebin.com/Ge1gwcSc

Then i tried it via Samba-Share, not PVR, but all other settings are the same. Now xbmc is recognizing the tvshows, but not the episodes. Look here: http://pastebin.com/x3AahUst

Sometimes xbmc believes to found something, but its based on airtimes, and these "airtimes" xbmc is getting from the vdr-folders between the episode-name-folder and the video-file, so these matches are wrong:

Code:
21:59:45 T:2958716928   DEBUG: VideoInfoScanner: Found date based match smb://yavdr4/recordings//serie/terra_nova/staffel_01/10._der_spion/2012-04-30.20.12.3-0.rec/00001.ts (30.04.2012) [([0-9]{4})[\.-]([0-9]{2})[\.-]([0-9]{2})]

regards, jennix
Reply
#13
For you custom tvshowmatching in your advancedsettings.xml, did you use action="prepend" or action="append" (or even append="yes")?
Because you want to prepend to ensure it gets tested first, otherwise the date-based regex will get the match before yours.

If you did prepend, then there's probably still an issue with your regex.
Reply
#14
(2012-05-15, 21:39)scudlee Wrote: For you custom tvshowmatching in your advancedsettings.xml, did you use action="prepend" or action="append" (or even append="yes")?
Because you want to prepend to ensure it gets tested first, otherwise the date-based regex will get the match before yours.

If you did prepend, then there's probably still an issue with your regex.

Hi,

sorry, i forgot to tell that i even had deleted all regex-lines in my advancedsettings.xml, just to have a clean start. So at the moment it uses only the builtin-regex from xbmc. Before i had the latest version of xexe's regex (http://pastebin.com/UPPrk7VU) from this thread : http://forum.xbmc.org/showthread.php?tid=51614

regards, jennix
Reply
#15
...But didn't you need a custom regex to find the episodes in the first place? It shouldn't be too surprising then that nothing is matching, or is matching the wrong regex.
Reply

Logout Mark Read Team Forum Stats Members Help
Questions about regex and scraper for a special directory-structure for tv-show1