Parsing invalid episode names (1 Viewer)

ultimatejoe

Portal Member
October 14, 2007
44
5
Home Country
Canada Canada
Country flag
For whatever reason, SchedulesDirect is getting bad EPG data from my service provider (Beanfield in Canada) and as a result I'm getting wonky episode names; it happens for about 10% of the shows I record. That being said, the correct information is IN the filename, I just can't figure out the parsing string I need to use to get it. When I do get bad filenames they come in one of two flavours (below), and I'm hoping the tall foreheads here can help me:

I use the following format: <SeriesName> - S<SeriesNumber>E<EpisodeNumber> - <EpisodeTitle> which should produce something like: Brooklyn Nine-Nine - S05E18 - DFW

Issue one:
\Brooklyn Nine-Nine - SEP01739009E518 - DFW
The XML has a wonky series number ("EP01739009"), then includes the series number AND epside number as the episode value ("518"). Basically I need to figure out how to ignore the wonky series number, and split out the series and episode numbers from the last three digits in the text string.

Issue two:
\S05E518 - DFW
Sometimes after MCEBuddy has done it's thing it will capture the series number in the episode number. I'm assuming this is related to the bad XML issue I've described above but I can't figure out how to manage on the MCEBuddy side so I'm hoping there's a way I can set up My TvSeries to read this correctly as well.

Any help would be greatly appreciated.
 

Edalex

Community Plugin Dev
  • Premium Supporter
  • January 3, 2008
    2,931
    1,234
    Saratov
    Home Country
    Russian Federation Russian Federation
    Country flag
    If you want to import them in MP-TVSeries you could creare replacement strings in config. If replacement are not so simple you could use regex.
     

    ultimatejoe

    Portal Member
    October 14, 2007
    44
    5
    Home Country
    Canada Canada
    Country flag
    Thanks. That much I've figured, where I'm struggling is how to configure the replacement strings. Regex is a bit over my head, and the series number is unique so I can't just use a single value. I'm hoping that someone here can suggest what replacement strings or parsing strings would work.
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,402
    1,877
    Country flag
    @ultimatejoe

    It would have been easy to create one, but no full source filename example was provided, so I cannot build a proper RegExp for it.

    Going on the hypothesis that it would be "Brooklyn Nine-Nine - SEP01739009E518 - DFW.mkv" you can use:

    Code:
    (^.*?\\?(?<series>[^\\$]+?)[ .-]+(?:SEP\d+E)?(?<season>\d+)(?<episode>\d{2}))[ .-]*(?<title>(?![^\\]*?(?<!the)[ .(-]sample[ .)-]).*?)\.(?<ext>[^.]*)$

    This will remain effective even when Brooklyn Nine-Nine moves into season 10+

    For the 2nd one, you will have to use string replacement if MCEBuddy at least puts it in the right folder, so you can expand upon that knowledge, or provide better folder+file examples of your situation.
     
    Last edited:

    ultimatejoe

    Portal Member
    October 14, 2007
    44
    5
    Home Country
    Canada Canada
    Country flag
    Sorry, you're absolutely right. Here's an example of a file with the weird season/episode values, from the root "series" recording folder:

    series\Bob's Burgers\Bob's Burgers - SEP01279298E801 - Go Tina on the Mountain.ts

    Here's the example where the root "TV Recordings" folder:

    TV Recordings\Brooklyn Nine-Nine\Season 05\S05E514-The Puzzle Master.mkv
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,402
    1,877
    Country flag
    The RegExp provided works on 1st one as:

    Series = Bob's Burgers
    Season = 8
    Episode = 01
    Title = Go Tina on the Mountain
    Extension = ts​

    For The other scenario, use:

    Code:
    (^.*?\\?(?<series>[^\\$]+?)\\Season \d+\\S\d+E(?<season>\d+)(?<episode>\d{2}))[ .-]*(?<title>(?![^\\]*?(?<!the)[ .(-]sample[ .)-]).*?)\.(?<ext>[^.]*)$
     

    ultimatejoe

    Portal Member
    October 14, 2007
    44
    5
    Home Country
    Canada Canada
    Country flag
    You are my hero. If you're ever in Toronto I'll buy you a beer. Both strings worked perfectly. I can finally use the plugin to manage TV before AND after I record the episodes. I've been trying to make that work since 2009.
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,402
    1,877
    Country flag
    Could have done this for you 9 years ago if you made the forum request :)
     

    Edalex

    Community Plugin Dev
  • Premium Supporter
  • January 3, 2008
    2,931
    1,234
    Saratov
    Home Country
    Russian Federation Russian Federation
    Country flag
    You are my hero. If you're ever in Toronto I'll buy you a beer. Both strings worked perfectly. I can finally use the plugin to manage TV before AND after I record the episodes. I've been trying to make that work since 2009.
    Also you could've asked SchedulesDirect to fix EPG data since you're paying for it.
     

    Users who are viewing this thread

    Similar threads

    The matching table adds flexibility, and we can use any provider for the data, or even multiple providers at once. The logic changes aren't too big either, add an internal ID, a provider, and that's about it. And at the stage of receiving information translation from one ID to another.
    The matching table adds flexibility, and we can use any provider for the data, or even multiple providers at once. The logic...
    I'm experiencing issues with My TVSeries scanning new series that aren't currently in my DB. In the popup in MePo it will say new...
    Replies
    12
    Views
    1K
    I believe that it is possible to use different EPG sources for different channels. For the channels where "Schedules Direct" does not provide any data, you can use the data from the broadcast EPG. The relevant settings are described on this page in the Wiki. You need to enable "Store data only for the selected channels", and then...
    I believe that it is possible to use different EPG sources for different channels. For the channels where "Schedules Direct" does...
    After much testing with MP1 and MP2 (moving from MCE) I have finally got MP2 up to a standard where it is now active and my wife...
    Replies
    10
    Views
    2K
    Update: I kept at this until I found a solution (or 2 rather). I didn't know it at the time, but perhaps this post would have been better served in the EPG discussion area. To those viewing this that might have the same problem: Thanks to @lightshock and @Lehmden for this development and for their posts to help me find this solution...
    Update: I kept at this until I found a solution (or 2 rather). I didn't know it at the time, but perhaps this post would have been...
    I've been at this for days, and I can't seem to get the advanced record settings to name TV recordings with Series and Episode...
    Replies
    1
    Views
    1K
    You can add internet channels with the virtual "RadioWebStream" tuner inside the TV- config tool. How to do so can be read in our wiki: Radio WebStreams It depends on the station, if you can use it this way but it's worth a try.
    You can add internet channels with the virtual "RadioWebStream" tuner inside the TV- config tool. How to do so can be read in our...
    I'm rebuilding my HTPC system, thread link in my sig, and I'm trying to compare EPG buddy with Schedules Direct, which I have been...
    Replies
    4
    Views
    2K
    WJW, Thank you for all your suggestions. I am making progress but it is not yet working for me. I see, in your batch file, that you rename the xml file to tvguide.xml which I believe is the file that the mp plugin is looking for. I do have the SED program in the same folder with all the xml stuff. In TV Server, when I click the...
    WJW, Thank you for all your suggestions. I am making progress but it is not yet working for me. I see, in your batch file, that...
    (Media Portal 1.17) I've been using mc2xml to get guide data from the "new" Microsoft servers. It generally works, but will go...
    Replies
    9
    Views
    5K
    Top Bottom