Lookup by Episode NAME (1 Viewer)

RoChess

Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    Hi all,

    I decided to go a little further with the Google idea, and believe I found a search that would always return a page with all of the episodes and their season and episode numbers:

    site:tvrage.com "Family Guy" "Death has a shadow" printable "Click Here To Print"

    I have substituted different show names and episode names, and this seems to ALWAYS return a printable episode guide which appears to be condensed. One would only have to parse this file to get the season and episode numbers. Any takers for a program?

    No need to expand on the search, the smaller you keep it the less trouble you will run into, and the regular expression takes care of the scraping.

    So site:tvrage.com "Show Name" "Episode Title" + \((\d+x\d+)\)\s@\sTVRage.com would be enough, because there is no need to actually follow the resulting link, the Google HTML code already contains all the information required. Now just finding somebody to program it :D
     

    bnsaflsujt

    Portal Pro
    January 12, 2010
    60
    3
    Home Country
    United States of America United States of America
    OK, I will be completely honest... I understand booleans and such, but I have no clue what you added to that search (\((\d+x\d+)\)\s@\sTVRage.com)! Unless that was meant to be something to go into the actual code. If that would work on a per episode basis, it shouldn't be a problem...

    The search term that I had posted was in the understanding that it would download the only result (Printable episode listing) so that the computer for future episodes wouldn't have to connect to the net for each query... If you were to do it for every show, that would be something like 20000 queries (the number of tv listings in one guide for me). However, my thinking was to just get the episode listings for the show that I have set to record, and the program could just reference those... Then, if a new one were to show up in my schedule, it would download the episode listing for that show as well, then update the guide and import into 4tr accordingly.

    I hope I didn't confuse anyone with that but do you understand what I mean? Which is more feasible to implement? I am guessing episode by episode would be the easier to implement short term, but would google block your ip after being bombarded by 20000 queries?
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    The "\((\d+x\d+)\)\s@\sTVRage.com" is a regular expression that looks for:

    \( = (
    ( = start of capture group
    \d+ = capture decimal numbers
    x = x
    \d+ = capture decimal numbers
    ) = end of capture group
    \) = )
    \s = space
    @ = @
    \s = space
    TVRage.com = TVRage.com

    So the result is that it looks for "(00x00) @ TVRage.com" where 00 can be 00 through 99, and it then outputs the "00x00" string, in our example 01x01, which could be directly used to rename filename into "Family Guy 01x01.avi" and MP-TVSeries will do the rest.

    So only a single Google query is needed, the results can be immediatly scraped for what is needed. Google has no problem processing massive amount of queries, and is in a much better position then thetvdb.com who is also dealing with a lot of queries to their website from people updating their TV collection.

    And the idea is to only process this on filenames, so not your entire EPG list, but the actual files you plan to import into MP-TVSeries.
     

    bnsaflsujt

    Portal Pro
    January 12, 2010
    60
    3
    Home Country
    United States of America United States of America
    So you are talking about post processing... See, I was talking about editing the XMLTV file with the correct information before it even entered 4TR or MediaPortal to be used as a guide. That way recordings are created instantly with the correct name, and you do not have to wait for the recording to finish airing before you can rename it and have is show up in MP-TV Series in MediaPortal. The show would be created with the correct name, and you could watch the file in MediaPortal without ever changing a name, or waiting until the recording was done.
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    Well Google wouldn't have a problem handling the load if you process your entire EPG data either. I've ran scripts that processed 2.5 million queries with them in a weeks time and never had a problem. But there has to be a way in which it can be limited, because you wouldn't watch everything in your EPG.

    And the scraping doesn't have to go after the file is recorded, but could start the moment you select a show to be recorded.
     

    bnsaflsujt

    Portal Pro
    January 12, 2010
    60
    3
    Home Country
    United States of America United States of America
    The limiting as I was saying would be done by your recordings in your scheduler. The script would:

    1. Download an XMLTV file (I use mc2xml)
    2. Look at what shows you have set to record
    3. Parse the XMLTV file for those show names
    4. When one is encountered, look at the title information
    5. Armed with the Show name and Title, would query Google
    6. Find the Season and Episode numbers in the Google result
    7. Look for the <episode-num system="xmltv_ns"> attribute and replace the missing/erroneous information there with that retrieved in step 6
    8. Repeat steps 4-7 for the rest of the XMLTV file
    9. Copy the file into the directory for 4TR to import

    Then, 4TR will record the show, with the correct file name, and MP-TV series will scrape the information for the file as it is created.
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: Lookup by Episode NAME

    All german speaking people can use my episodescanner (see signature) - it fills in all episodedata into the epg for all programmed recordings.
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    So now all we need is a German to English translation, assuming that disaster123 is willing to share his source code :D
     

    bnsaflsujt

    Portal Pro
    January 12, 2010
    60
    3
    Home Country
    United States of America United States of America
    If I could speak German, I would most certainly try... Although, I couldn't understand if his program only changed the EPG database in MP, or if it also worked in 4TR... However his program seems to be like I was talking about, but instead of working on the EPG file before import, it just worked on the EPG database after import... I don't know which would be easier...

    Any takers yet???

    -Sincerely,
    James
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: Lookup by Episode NAME

    bnsaflsujt
    yes it modifies the EPG Database afterwords or let me say it searches every X seconds for new recordings and then epg entries which do not have an episode / seriesnumber stored.
     

    Users who are viewing this thread

    Top Bottom