OnlineVideos JSON parsing

howudodat

Portal Pro
February 20, 2007
75
8
I am trying to create a generic site for OnlineVideos. The site returns JSON for categories, subcategories and videos. I have the categories working and subcategories partially. The problem I am having is how to ignore the first description and only process the subcategories array. Here is my regex, and the JSON

Code:
{"description":"(?<description>[^"]*)","key":"(?<url>[^"]*)","name":"(?<title>[^"]*)","type(?:(?!vert).)*"vert(?:(?!sm").)*sm":"(?<thumb>[^"]*)",(?:(?!}},).)*}},
Code:
{
    "category": {
        "description": "useless category description",
        "key": "useless category key",
        "name": "Useless Category Name",
        "type": "container",
        "tags": ["cat tag"],
        "images": {
           
        },
        "subcategories": [{
            "description": "Description1",
            "key": "subcat1",
            "name": "SubCat 1",
            "type": "container",
            "tags": ["blahtag"],
            "images": {
                "horizontal": {
                    "md": "http://foo.bar/hm.png",
                    "sm": "http://foo.bar/hs/png"
                },
                "vert": {
                    "md": "http://foo.bar/vm.png",
                    "sm": "http://foo.bar/vs/png"
                }
            }
        },
        {
            "description": "Description2",
            "key": "subcat2",
            "name": "SubCat 2",
            "type": "container",
            "tags": ["blahtag"],
            "images": {
                "horizontal": {
                    "md": "http://foo.bar/hm.png",
                    "sm": "http://foo.bar/hs/png"
                },
                "vert": {
                    "md": "http://foo.bar/vm.png",
                    "sm": "http://foo.bar/vs/png"
                }
            }
        }]
    }
}
The video list is formated very similar, but I think once I get the sub categories I can get the video list.
Also if there is subcategories of sub categories, is that possible?
ie;
Code:
Audio
    80s
       <song list>
    70s
       <songlist>
Video
    Action
       <movie list>
    Comedy
       <movie list>
...
 

FreakyJ

Development Group
  • Team MediaPortal
  • July 25, 2010
    4,023
    113
    Country flag
    I know my post might not be that useful. I was just wondering why you don't implement your side by using an own SiteUtil? It offers you an json parser which would be much easier.
    I work right now with onlineVideos for MP2Ext, that's why I am a bit familiar with that.

    But I am really bad when it comes to RegEx :ROFLMAO:
     

    howudodat

    Portal Pro
    February 20, 2007
    75
    8
    I'd be glad to give SiteUtil a try...is there any documentation on using it to parse JSON? I cant find any...I searched the forums earlier and couldn't see anything there either :(
     

    howudodat

    Portal Pro
    February 20, 2007
    75
    8
    OK, but how is this used by onlinevideos. I don't see a way to do programming. I only see a way to do regex. I must be missing Something near step 1 :(
     

    howudodat

    Portal Pro
    February 20, 2007
    75
    8
    ok, so do I have to build all off onlinevideos and my site becomes integrated to the core dll, or is this a plugin to the plugin? I'll have to dl vs c#. I dont have a devel environment set up on windows. I actually an a programmer for 30+ years, but all my current projects are on linux.
     

    FreakyJ

    Development Group
  • Team MediaPortal
  • July 25, 2010
    4,023
    113
    Country flag
    , so do I have to build all off onlinevideos and my site becomes integrated to the core dll, or is this a plugin to the plugin?
    It will become a plugin. The Plugins in OnlineVideo are called SiteUtils. Basically plugins for a plugin.
    They are located in: C:\Users\All Users\Team MediaPortal\MP2-Client\OnlineVideos\SiteUtils
    Or if you are using MP1: C:\Users\All Users\Team MediaPortal\Mediaportal\OnlineVideos\SiteUtils
     

    FreakyJ

    Development Group
  • Team MediaPortal
  • July 25, 2010
    4,023
    113
    Country flag
    And I think the naming is important, but I could be wrong: OnlineVideos.Sites.offbyone.dll
    OnlineVideos.Sites.AUTHOR.dll
     

    howudodat

    Portal Pro
    February 20, 2007
    75
    8
    ok, I have the project downloaded, and setup and I see that the sites just basically become plugins to the plugin. Is there any kind of documentation on how to proceed? What interfaces need implemented? etc. Or is it just study code and hack?
     
    Top Bottom