Gametrailers - support thread (1 Viewer)

offbyone

Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    AW: Gametrailers - new and improved version

    I already have a version scheduled for the next OV release that will let you chose SD or HD when available.
     

    sleepydog

    Portal Member
    October 20, 2011
    6
    1

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Currently working on a new version since Gametrailers 2.0 launched and messed everything up, hoping to have it done in a few days tops.

    /Edit:

    My draft so far is listed below, know how to get it working but stuck at the PlaylistUrlRegexp step because Online Videos doesn't seem to allow more then 1 named regex group in the PlaylistUrl step.

    For Gametrailers I need to retrieve 2 strings from the html source (token / video_id) and got both matched but can't parse them for the next step (FileUrl) :(
    Anyone know of a solution for this besides making a custom util?

    HTML:
    <Site name="GT 2.0" util="GenericSite" agecheck="false" enabled="true" lang="English">
      <Description>-</Description>
      <Configuration>
        <item key="videoListRegEx"><![CDATA[<meta\sitemprop="url"\scontent="(?<VideoUrl>[^"]*)"/>\s*<meta\sitemprop="name"\scontent="(?<Title>[^"]*)"/>\s*<meta\sitemprop="thumbnail"\scontent="(?<ImageUrl>[^"]*)"/>\s*<meta\sitemprop="description"\scontent="(?<Description>[^"]*)"/>\s*<meta\sitemprop="uploadDate"\scontent="(?<Airdate>[^"]*)"/>\s*<meta\sitemprop="duration"\scontent="(?<Duration>[^"]*)"/>]]></item>
        <item key="videoListUrlDecoding"><![CDATA[HtmlDecode]]></item>
        <item key="nextPageRegEx"><![CDATA[<li\sclass="next"><a\sclass="override_nav_background_color\soverride_nav_text_color"\srel="next"\shref="(?<url>[^"]*)">&rarr;</a></li></ul></div>]]></item>
        <item key="nextPageRegExUrlDecoding"><![CDATA[HtmlDecode]]></item>
        <item key="playlistUrlRegEx"><![CDATA[\s*data-contentId='(?<url>[^']*)'*.*data-token="(?<token>[^"]*)"]]></item>
        <item key="playlistUrlFormatString"><![CDATA[[URL][URL][URL][URL][URL][URL]http://www.gametrailers.com/feeds/video_download/[/URL][/URL][/URL][/URL][/URL][/URL]{0}/{1}]]></item>
        <item key="baseUrl"><![CDATA[[URL][URL][URL][URL][URL][URL]http://www.gametrailers.com[/URL][/URL][/URL][/URL][/URL][/URL]]]></item>
        <item key="videoThumbFormatString"><![CDATA[<meta\sitemprop="thumbnail"\scontent="(?<ImageUrl>[^"]*)"/>]]></item>
      </Configuration>
      <Categories>
        <Category xsi:type="RssLink" name="Xbox">[URL][URL][URL][URL][URL][URL]http://www.gametrailers.com/xbox-360/videos-trailers[/URL][/URL][/URL][/URL][/URL][/URL]</Category>
      </Categories>
    </Site>

    /Edit 2:

    See that OffByOne has already made a siteutil for this one, will update it with the new regex and search code if he doesn't mind :)
     
    Last edited:

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    New version send to Offbyone :) , still not perfect but it's a good base version.
    Things that aren't working yet:

    -Search
    No way to directly link the category trailers/videos (javascript calls) so only game results are given, did add it so someone else might get it fixed.

    - Subcategories
    Javascripts calls are made to switch Categories now, couldn't find any direct links to these.

    - SD/HD support
    Using the download button for the direct link and can't find out how to parse it along so it reverts to HD.

    For the rest it's all good though :D , was a little tricky to get working since they don't even support RSS anymore but oh well it might get better once they have ironed out all the bugs.
     
    Last edited:

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    Thanks a lot for your help! I committed your changes to SVN and updated the site now.
     

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Your welcome :) , happy to help out when I can.
    Almost done with Subcategories support as well, will post it when it's completed (hopefully today :p )

    /Edit: New version completed and send the new link, changelog:

    - Added Dynamic SubCategory support (all subcategories on the site are now supported)
    - Bugfix for description text (added htmldecode for special characters).
    - Changed NextPage function and Regexp.
    - Code cleanup

    Also found a way to get the search working but requires some more testing, so maybe in a few days or so.

    /Edit 2: Was quicker then I thought but search function is now fully working and send new link to Offbyone
     
    Last edited:

    SiLenTYL

    Retired Team Member
  • Premium Supporter
  • April 23, 2004
    1,144
    159
    Melbourne
    Home Country
    Australia Australia
    hi.. just tried the updated gametrailers in online videos plugin and i see categories and thumbnails even.. but it says url not found when i try playing any video
     

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Best to wait for when the newer version is online, it might be fixed already but if not please let me know.

    /edit: Offbyone transferred maintainer rights for Gametrailers.com to me, so I will be publishing updates for this site from now on.
    The new update is live so please let me know if there are still any issues :)

    PS: If it breaks at some point due to site change for instance then PM me and it will get fixed.
     
    Last edited:

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Some regional settings were adding quotations around the video_url (my en-US workmachine had no troubles) and broke playback, this has now been resolved and after updating it will work correctly in all cases.

    /Edit: The Gametrailers devs thought it would be funny to rename the <A> tag link with the VideoURL to "Thumbnail" (which is of course wrong ;) )
    New XML published and playback is working again.
     
    Last edited:

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Added new console categories and E3 2013 to "ALL" category for the time being.
     

    Users who are viewing this thread

    Top Bottom