Expressions/Rules requests (2 Viewers)

Smash

Portal Member
November 18, 2009
22
0
Home Country
Denmark Denmark
Hi

Need an regexp for my Top Gear Specials. Like:
Code:
Top Gear\Specials\Top Gear - 00222 - Hammond - Top Gear Uncovered

00 is the season number for specials and 222 is the episode number. I have tried with 0x222 and 0222

It's being parsed as Top Gear 0 - S02 E22 - titel.

It seems the problem is double digit season and tripple digit episode.
 

RivaSA

Portal Member
June 24, 2009
35
3
Home Country
South Africa South Africa
Hi

Need an regexp for my Top Gear Specials. Like:
Code:
Top Gear\Specials\Top Gear - 00222 - Hammond - Top Gear Uncovered

00 is the season number for specials and 222 is the episode number. I have tried with 0x222 and 0222

It's being parsed as Top Gear 0 - S02 E22 - titel.

It seems the problem is double digit season and tripple digit episode.
Hi Smash, I have the same problem. If some-one can help this will be awsome. my requirements are a little different. thetvdb lists the Top Gear specials in 4 digit episodes. A little optimistic if you ask me but I can see the logic. However thats another discussion. If some-one can help then can it be done so that it will work a majority.

It is listed as Top Gear s00 eXXXX

Any help will be apreciated. I have just downloaded a book on creting expresions if any-one is interested in the view on contributing to the forum instaed of posting these types of messages.

Thanks again

Lyall
 

RoChess

Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    It is listed as Top Gear s00 eXXXX

    Ok, first attempt at a new default expression:

    ^.*?\\?(?<series>[^\\$]+?)[ .-]+[\#s]?(?<season>\d+)[ .-]?[ex.](?<episode>\d+)[+-]?(?<episode2>\d+)?[ .-]*(?<title>(?![^\\]*?sample)[^$]*?)\.(?<ext>[^.]*)$

    This should work for the following files:

    • Show.Name.S01E01.avi
    • Show Name - s01e01.avi
    • Show Name - S01E01 - Episode Title.avi
    • Show Name - S01 E01 - Episode Title.avi
    • Show Name - S01.E01 - Episode Title.avi
    • Show Name - S01-E01 - Episode Title.avi
    • Show Name 1x01.avi
    • Show Name #1.01.avi
    • Show Name #1.01 - Episode Title.avi
    • Show Name - S01E01-02 - Two Part Episode.avi
    • Show Name - S01E01+02 - Two Part Episode.avi
    • Show Name - S01E100 - Three Digit Episode.avi

    There are a lot more combinations, but you get the general idea.

    I need feedback from tester, or these type of modifications will never make it into the plugin by default.

    PS: Be sure to put this expression at the first position to prevent interference from the other expressions. Preferably disable all the other expressions and let me know which filenames do not work, so I can improve it. This expression is not meant to work for the "\Series Name\Season 1\01 - Episode Title.avi" scheme, but those will be supported via a seperate one.

    The 4-digit episodes from TopGear will work as well, provided there is a 'S00E0000' or '00x0000' or 'S00 E0000' or 'S00.E0000' or 'S00-E0000' syntax present. Without the seperator it won't work. That doesn't mean it is not possible to support 00222 for S00E222, but that would require hardcoded exceptions which run a high risk of false positives.

    Smash: you would do better adding a String Replacement rule that turns "Top Gear - 00" into "Top Gear - S00E" (with 'before' enabled), so that the above expression works without having to rename a lot of files.
     

    Smash

    Portal Member
    November 18, 2009
    22
    0
    Home Country
    Denmark Denmark
    Smash: you would do better adding a String Replacement rule that turns "Top Gear - 00" into "Top Gear - S00E" (with 'before' enabled), so that the above expression works without having to rename a lot of files.

    Thank RoChess, it seems to work perfectly.
     

    Sinbe

    Portal Pro
    December 12, 2007
    70
    0
    Home Country
    Finland Finland
    Can anyone help me with these?

    \The Daily Show With Jon Stewart\The.Daily.Show.2010.05.10.Jack.Rakove.HDTV.XviD-FQM
    \The Colbert Report\The.Colbert.Report.2010.05.10.Gary.Johnson.720p.HDTV.x264-BAJSKORV
    \The Late Late Show with Craig Ferguson\Craig.Ferguson.2010.05.12.Bryan.Cranston.HDTV.XviD-2HD
    \Bill Maher\Real.Time.With.Bill.Maher.2010.05.14.HDTV.XviD-aAF

    They all seem to be pretty much the same, but I can't figure out how the regexps are supposed to work :confused: I'm fine with the series showing up with the month as the season and date as the episode as long as they are shown in the MP-TV Series.
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    Can anyone help me with these?

    \The Daily Show With Jon Stewart\The.Daily.Show.2010.05.10.Jack.Rakove.HDTV.XviD-FQM
    \The Colbert Report\The.Colbert.Report.2010.05.10.Gary.Johnson.720p.HDTV.x264-BAJSKORV
    \The Late Late Show with Craig Ferguson\Craig.Ferguson.2010.05.12.Bryan.Cranston.HDTV.XviD-2HD
    \Bill Maher\Real.Time.With.Bill.Maher.2010.05.14.HDTV.XviD-aAF

    They all seem to be pretty much the same, but I can't figure out how the regexps are supposed to work :confused: I'm fine with the series showing up with the month as the season and date as the episode as long as they are shown in the MP-TV Series.

    The problem is that MP-TVSeries relies on TheTVdB match for any show, so you need to have the Season + Episode information available for a proper match up. There are programs that can do this for you, and if you search the forum you will find how other users solve this. They are also working on redoing the importer system for MP-TVSeries where this will be possible, via Episode title match-up.

    To answer your request, you could use something like:

    ^.*?\\?(?<series>[^\\$]+?)\.(?<season>\d{2})\.(?<episode>\d{2})\.(?<title>.+)\.(?=720p|HDTV)?​

    Which will add the year to the show name as to avoid a matchup with the actual show, otherwise you get wrong results, as for example S05E10 on "The Daily Show With Jon Stewart" is an episode from 2000.

    But you would be better off looking into the auto-rename methods to get the Season+Episode info.
     

    Sinbe

    Portal Pro
    December 12, 2007
    70
    0
    Home Country
    Finland Finland
    Renaming isn't possible because I want to seed the same files, but as I said, I'm fine with the season and episode being shown incorrectly for a few shows until there's a fix other than renaming the files. Anyways, I can't get that script you gave me working either and as I don't understand the logic behind regexp (believe me, I tried to), I can't fix it myself. If it's working for you It must be something wrong with my string replacements.

    I noticed I didn't give the file name, only the folder the video file is in, so here's an example of a file included in the folder:

    \The Late Late Show with Craig Ferguson\Craig.Ferguson.2010.05.12.Bryan.Cranston.HDTV.XviD-2HD\craig.ferguson.2010.05.12.bryan.cranston.hdtv.xvid-2hd.r00

    I have MP set up to recognize .r00 as a video format and I'm using rarfilesource to open the videos without extracting. Using .rar caused problems as some of the movies have subtitles in .rar files.
     

    RivaSA

    Portal Member
    June 24, 2009
    35
    3
    Home Country
    South Africa South Africa
    You a legend, works like a charm.

    If thats your idea of a first try I'd like to see what happens when you put your mind to it.

    !!!Cheers!!!
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    Renaming isn't possible because I want to seed the same files, but as I said, I'm fine with the season and episode being shown incorrectly for a few shows until there's a fix other than renaming the files. Anyways, I can't get that script you gave me working either and as I don't understand the logic behind regexp (believe me, I tried to), I can't fix it myself. If it's working for you It must be something wrong with my string replacements.

    \The Late Late Show with Craig Ferguson\Craig.Ferguson.2010.05.12.Bryan.Cranston.HDTV.XviD-2HD\craig.ferguson.2010.05.12.bryan.cranston.hdtv.xvid-2hd.r00

    I tested the expression purely in Expresso forgetting the default string replacements of MP-TVSeries, since you are giving me a full filename example, I was able to come up with the following:

    ^.*?\\?(?<series>[^\\$]+?)\.(?<season>\d{2})\.(?<episode>\d{2})\.(?<title>[^\-]+)​

    The Expresso result is then:

    Series = Craig Ferguson 2010
    Season = 05
    Episode = 12
    Title = Bryan Cranston HDTV XviD = Bryan Cranston​

    The "HDTV XviD" will be removed by the default string replacement entries.

    Let me know if that works for you.
     

    Sinbe

    Portal Pro
    December 12, 2007
    70
    0
    Home Country
    Finland Finland
    It somewhat does work, BUT... How the heck can one of these files parse correctly and the other one not. Bryan Cranston doesn't work in MP while Ben Kingsley does. There are also a few other episodes that parse correctly and few that won't that look about the same.

    \The Late Late Show with Craig Ferguson\Craig.Ferguson.2010.05.12.Bryan.Cranston.HDTV.XviD-2HD\craig.ferguson.2010.05.12.bryan.cranston.hdtv.xvid-2hd.r00

    \The Late Late Show with Craig Ferguson\Craig.Ferguson.2010.05.21.Ben.Kingsley.HDTV.XviD-2HD\craig.ferguson.2010.05.21.ben.kingsley.hdtv.xvid-2hd.r00
     

    Users who are viewing this thread

    Top Bottom