Expressions/Rules requests (2 Viewers)

MrGrymReaper

MP Donator
  • Premium Supporter
  • July 28, 2009
    53
    37
    Home Country
    United Kingdom United Kingdom
    Thanks. It has mostly got the Smallville file recognised structure however I have the full tv show series (Seasons 1 to 10 with all episodes). The file structure is handled by iTunes. The last parts of the recognition by the primary rule just gives number based series recognition (parsing) not series names (let alone season and episode).
     

    MrGrymReaper

    MP Donator
  • Premium Supporter
  • July 28, 2009
    53
    37
    Home Country
    United Kingdom United Kingdom
    Last edited:

    hawk425

    New Member
    December 19, 2016
    9
    2
    44
    Home Country
    United States of America United States of America
    Hi, I am coming from Windows Media Center and was wondering if it was possible to get parsing for that format. I saw someone ask this before, but the post was several years old and I am hoping it is possible now.

    Example of format:
    Family Guy_ABC_2015_12_10_01_00_04.wtv

    Thanks!
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    Hi, I am coming from Windows Media Center and was wondering if it was possible to get parsing for that format. I saw someone ask this before, but the post was several years old and I am hoping it is possible now.

    Example of format:
    Family Guy_ABC_2015_12_10_01_00_04.wtv

    The problem you are having is that TheTVdB is used as a source, and they store the date on say a daily talk show, but usually not for a TV show like "Family Guy" that goes by Season/Episode normally.

    So even if you write a parsing expression that filters out "Show name", and then the "air-date", it might still fail miserably.

    Your best bet would be a 3rd party tool that can act as a translator and obtain the Season/Episode info for a perfect match. Search the threads, there have been discussions on such a tool before.
     

    hawk425

    New Member
    December 19, 2016
    9
    2
    44
    Home Country
    United States of America United States of America
    Hmm, something must have changed because I am seeing date on the TVDB now. I got this work for anyone interested in this for the future. I used the below regex expression, and also set up a String Replacement of "_" for "-" to make sure the air date was read correctly. Hope this helps someone in the future.

    (?<series>[^_-]*)([-_])([A-Za-z]{1,7})([-_])(?<firstaired>[0-9]{4}[-_][0-9]{2}[-_][0-9]{2})([^.]*).(?<ext>[^.]*)
     

    Neoculture

    Portal Pro
    November 20, 2011
    75
    3
    Brisbane
    Home Country
    Australia Australia
    I have looked but I can't seem to find a solution anywhere.

    I have been collecting TV files for a long time and have got them split across 3 fileservers. My import paths are:
    \\NAS-001\Animation
    \\NAS-002\Japanese
    \\NAS-003\TV_Series

    All fileservers follow the same naming pattern:
    directory/series_name/season/filename

    "directory" is a way of breaking down the listing into something manageable, e.g.:
    0-9
    A
    B
    etc...

    "series name" is the name of the series as close to the TVDB's version as I can, e.g.:
    Mythbusters
    Star Blazers
    etc...

    "season" is the season and can be either:
    0
    Season <number>
    Season <year>
    where "0" denotes the specials, and the other are because sometimes a series has season numbers and sometimes (like Mythbusters) has season years.

    "filename" is:
    <episode#> - <title>.ext
    <episode#>-<episode#> - title.ext
    the second one being for two-parters.

    So, for example, one of the "filenames" that MPT-TV Series finds when doing the import is
    S\Star Blazers\Season 01\04 - Test Warp to Mars.avi
    which should hopefully become:
    SERIES: Star Blazers
    SEASON: 01
    EPISODE: 04
    NAME: Test Warp to Mars
    EXTENSION: avi

    Similarly:
    M\Magnum,P.I.\Season 01\01-02 - Don't Eat the Snow in Hawaii.avi
    should become:
    SERIES: Magnum, P.I.
    SEASON: 01
    EPISODE: 01
    EPISODE2: 02
    NAME: Don't Eat the Snow in Hawaii
    EXTENSION: avi

    And:
    M\Mythbusters\Season 2003\04 - Exploding Toilet.avi
    should become:
    SERIES: Mythbusters
    SEASON: 2003
    EPISODE: 04
    NAME: Exploding Toilets
    EXTENSION: avi

    While:
    B\Babylon 5\0\03 - Thirdspace.avi
    should become:
    SERIES: Babylon 5
    SEASON: 0
    EPISODE: 03
    NAME: Thirdspace
    EXTENSION: avi

    I tried using the regexp:
    ^.*?\\<series>\\Season (?<season>[0-9]{1,2})\\(?<episode>[0-9]{1,2})(?:-(?<episode2>[0-9]{1,2})) - <title>.<ext>$
    but that didn't seem to don anything.

    Can anyone tell me where I am going wrong. (and no, renaming files is not an option - I currently have over 21,000 of them)
    Thanks.
     

    bta489

    Portal Pro
    March 17, 2013
    177
    99
    Home Country
    Germany Germany
    You didn't specify patterns for <series>, <title> and <ext>. Try (?<series>[^\\]+) and (?<title>.*)\.(?<ext>.+)

    Additional notes: Personally, I like to specify white spaces with \s instead of an actual whitespace, it should work either way, though. [0-9] can also be written as \d. Again, more of a personal preference, but I think it's a bit more readable and shorter. Lastly, I'm not sure the line start and end flags are strictly necessary (I could be wrong, though).
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    Your season stuck at 1 or 2 digits would also fail for Mythbuster example with "2003" as the season, so as @bta489 suggested stick with \d+ when you aren't use.

    This would work: ^.*?\\(?<series>[^\\]+)\\Season (?<season>\d+)\\(?<episode>\d+)(?:\-(?<episode2>\d+))?\s-\s(?<title>.+?)\.(?<ext>.+)$
     

    Neoculture

    Portal Pro
    November 20, 2011
    75
    3
    Brisbane
    Home Country
    Australia Australia
    I am, of course, a complete a*hole for not realising my previous thanks did not take and waiting this long to come back to the Forum.

    orz

    I am profoundly thankful for the help you gave me with my problem.
     

    Users who are viewing this thread

    Top Bottom