[Solved] Video Mediaset new website (2 Viewers)

cecet23

MP Donator
  • Premium Supporter
  • March 18, 2009
    137
    16
    Perugia
    Home Country
    Italy Italy
    Hi folks,
    I created my first site parser for video mediaset, it's a beta, here the code:

    XML:
    <Site name="Video Mediaset" util="GenericSite" agecheck="false" enabled="true" lang="it">
      <Configuration>
    	<item key="dynamicSubCategoriesNextPageRegEx"><![CDATA[<a\stitle="Vai\salla\spagina\ssuccessiva"\shref="(?<url>[^"]*)">&raquo;</a>]]></item>
    	<item key="videoListRegEx"><![CDATA[<a\stitle="(?<Title>[^"]*)"\shref="(?<VideoUrl>[^"]*)"\srel="nofollow"><img\salt="(?<Description>[^"]*)"\ssrc="(?<ImageUrl>[^"]*)"></a>]]></item>
    	<item key="nextPageRegEx"><![CDATA[<a\stitle="Vai\salla\spagina\ssuccessiva"\shref="(?<url>[^"]*)">&raquo;</a>]]></item>
    	<item key="playlistUrlRegEx"><![CDATA[var\svideoMetadataId\s=\s'(?<url>[^']*)';]]></item>
    	<item key="playlistUrlFormatString"><![CDATA[http://lazzavd.byethost11.com/script/vd.php?id={0}]]></item>
    	<item key="fileUrlRegEx"><![CDATA[<video\ssrc="(?<m0>[^"]*\.(?<n0>[mp4]*))"/>|<video\ssrc="(?<m0>[^"]*\.(?<n0>[wmv]*))"/>]]></item>
      </Configuration>
      <Categories>
    	<Category xsi:type="RssLink" name="Puntate Intere">http://www.video.mediaset.it/puntate-intere/puntate-intere.shtml</Category>
    	<Category xsi:type="RssLink" name="Clip Intrattenimento">http://www.video.mediaset.it/clip/intrattenimento.shtml</Category>
    	<Category xsi:type="RssLink" name="Clip News">http://www.video.mediaset.it/clip/news.shtml</Category>
    	<Category xsi:type="RssLink" name="Clip Sport">http://www.video.mediaset.it/clip/sport.shtml</Category>
    	<Category xsi:type="RssLink" name="Più visti di ieri">http://www.video.mediaset.it/piu-visti/piuvisti-ieri.shtml</Category>
    	<Category xsi:type="RssLink" name="Più visti della settimana">http://www.video.mediaset.it/piu-visti/piuvisti-settimana.shtml</Category>
    	<Category xsi:type="RssLink" name="Più visti del mese">http://www.video.mediaset.it/piu-visti/piuvisti-mese.shtml</Category>
      </Categories>
    </Site>

    It works but I need your help.
    In some pages part of the html source code is hidden probably because generated by javascript at run time, than I'm not able to get the list of videos.
    Some example:
    http://www.video.mediaset.it/programma/motogp/archivio-video.shtml
    or
    http://www.video.mediaset.it/programma/superbike/archivio-video.shtml

    and in all pages where there are a combobox. In the search link as well:
    http://www.video.mediaset.it/ricerca/ricerca.shtml?q={0}, for example:
    http://www.video.mediaset.it/ricerca/ricerca.shtml?q=iene

    All suggestions will really appreciated, otherwise I have to think to write a siteutil in c#.

    Thank you and enjoy with the first part of video mediaset.
     
    Last edited:

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    4,566
    2,938
    Nuenen
    Home Country
    Netherlands Netherlands
    I don't see any hidden stuff, when I test the site (and those urls from which you can't find videos) in the siteparser, I do see the videos. However the structure is a bit different to the ones you've found.
    I suggest creating a new videolist regex for those pages and concatenating it to your already existing one.
    So the final regex should be like (regex1)|(regex2)
    In that way, if a video matches one of those 2 it will be listed.

    Good luck!
     

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    4,566
    2,938
    Nuenen
    Home Country
    Netherlands Netherlands
    Indeed you're right, I tested the motogp page and that seemed ok.

    But it's most annoying, as you can only grab 2 vids each time. I've been digging around, playing with the urls, but for now, I can't seem to find a way which is going to work with the genericsite.
    So I guess it's c# time
     

    cecet23

    MP Donator
  • Premium Supporter
  • March 18, 2009
    137
    16
    Perugia
    Home Country
    Italy Italy
    So I guess it's c# time

    Yep, I think so, I was expecting that.
    I noticed, if you save the page on your pc and than grab the saved page, your are able to see all the video links. I don't know if it can help.
     

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    4,566
    2,938
    Nuenen
    Home Country
    Netherlands Netherlands
    I guess somehow it accesses the other pages (http://www.video.mediaset.it/progra...ssen_strip.shtml?page=1&dim=2&_=1367529403019) and similar automagically then, but that's probably browser-dependant

    But you probably can guess easily from the videolist page what those urls must be (hint: search for id="programma|superbike|full_sb_assen_strip"> )
    Don't know if there is a number of pages to get (page=1..???) but you'll get there
     

    cecet23

    MP Donator
  • Premium Supporter
  • March 18, 2009
    137
    16
    Perugia
    Home Country
    Italy Italy
    I saw some siteutils, and some of them inherit from genericsiteutil, some from BrightCoveUtil and so on, which are the difference ?
     

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    4,566
    2,938
    Nuenen
    Home Country
    Netherlands Netherlands
    The brightcove utli adds (amongs others) handling of the brightcove way of getting the url to the video (through AMF3 protocol).
    Best is, get your stuff as far as you can get with the siteparser, then, create an util derived of genericsite, and override the methods which aren't working as they should. (In your case: the getvideolist)
     

    cecet23

    MP Donator
  • Premium Supporter
  • March 18, 2009
    137
    16
    Perugia
    Home Country
    Italy Italy
    Sorry guys, but I didn't understand how to debug, I launch the debug and Mediaportal start, but it says that onlinevideos in not compatible and the breakpoints are disabled.

    Edit. Solved.
     
    Last edited:

    Users who are viewing this thread

    Top Bottom