New site request: firstrow.tv (1 Viewer)

xfx

Portal Pro
February 1, 2011
85
9
Santiago, Dominican Republic
Home Country
Spain Spain
Sure, here it is:

Code:
<Site name="FirstRow Sports" util="GenericSite" agecheck="false" enabled="true" lang="en">
      <Description>Sports</Description>
      <Configuration>
        <item key="dynamicCategoriesRegEx"><![CDATA[<a\shref="(?<url>[^"]*)">(?<title>[^<]*)</a>]]></item>
        <item key="dynamicSubCategoriesRegEx"><![CDATA[<a\sclass="accordlink"\s*href='(?<url>[^']*)'\starget="_blank">\s<img\sclass="chimg"\salt="(?<title>[^"]*)"\ssrc="(?<thumb>[^"]*)"/>]]></item>
        <item key="videoListRegEx"><![CDATA[<a\sstyle='font-size:12pt;color:limef;'\s*title='(?<Title>[^']*)'href='(?<VideoUrl>[^']*)'>]]></item>
        <item key="baseUrl"><![CDATA[http://firstrow.tv]]></item>
      </Configuration>
    </Site>

Yesterday I downloaded the source for OnlineVideos and looking at how it works it occurred to me that maybe (and this is a huge maybe) it would be nice to provide an alternate option to the "Generic Site Creator" utility.

What if it would be able to write plugins for it? So, instead of relying on a bunch of regex expressions to parse the HTML code in web sites we could be able to write simple plugins that do the parsing themselves and expose a series of lists/arrays containing all the information that is parsed through the regexs?

Having a plugin interface for OnlineVideos would allow a much more robust parsing mecanism as we would be able to work with the "generated HTML code" instead of the pages static code.
Let me explain: most pages obscure their movies' links using encrypted javascript (often hidden inside iframes) which are only available after the page has been rendered by the browser. This code is completely hidden away from the "Generic Site Creator" as it only works with the static (pre-rendered) source code.

This would not only solve this problem but would probably make OnlineVideos a lot simpler by taking away all the parsing code and moving it to separate instances (the plugins).

...hope my English is clear enough to understand what I mean...
 

doskabouter

Development Group
  • Team MediaPortal
  • September 27, 2009
    4,592
    2,993
    Nuenen
    Home Country
    Netherlands Netherlands
    I think it eventually boils down to a parser for each site, because the html is so much different...

    The thing is, genericsiteutil is for the more straightforward websites, when things get complicated you will have to code your util in c#. As you have probably seen, there are a number of utils with only one or two methods in it, so, generally speaking, it is fairly easy to add an util to onlinevideos.
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    You will never be able to implement a framework that has all the feature to get the links, because the methods how websites hide links are always changing (speaking with years of experience here). In order to adapt best (easiest and fastest), you need to have full C# possibilities at hand.

    If you are up for a challenge, dukus once has started adding cornerstone framework for scripting (taken from mov pics I think) into OV. That way a site could be created via xml.
     

    xfx

    Portal Pro
    February 1, 2011
    85
    9
    Santiago, Dominican Republic
    Home Country
    Spain Spain
    You will never be able to implement a framework that has all the feature to get the links, because the methods how websites hide links are always changing

    That's exactly why I think OV should support a plugin mechanism so that each site is parsed through its own plugin, written in any .NET language (C++/C#/VB).
    This way OV would simply load a bunch of external DLLs (each one being an specific site parser) which expose all the information that OV would expect to make things work: name of the site, language, description, list of categories/sections, sub-categories and finally a list of fully parsed links to the actual videos.

    I have done quite a few HTML parsers for many projects and, as you point out, each one requires its own set of "tricks" -- making this plugin-based approach, probably, the only feasible solution to keep expanding OV support for additional (and more complex) web sites.
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    I am not sure if you have fully understood the OnlineVideos API? Every single site is backed by a full blown C# class inside a dll that can even be reloaded at runtime and downloaded froma central server...
     

    Users who are viewing this thread

    Top Bottom