Roku Direct Publisher

Roku Direct Publisher - the easiest way to create a great TV experience. Learn more about how to create a Roku channel and share your experiences with others.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
belltown
Roku Guru

Re: json format help

All those error messages look legitimate based on the JSON you've posted. Look at each error message and make sure the properties it is referring to appear in the correct object, and have the correct type. If an object has another object as a property you can't put the including object's properties in the included object. The included object has its own properties, which also must be defined if required, and of the correct type. And the episode's releaseDate should be defined exactly as the spec says to define it; just because another date or date/time field includes a time component, doesn't mean they all do. You just have to go through each property of each object IN THE SPEC, comparing with your JSON, and make sure it matches what the spec says it should be.
0 Kudos
mitchstein
Roku Guru

Re: json format help

I went through the docs and comiled this as an example, I did this first and posted it in the beginning of this threa, I have regone through it several times to check it. It looks proper to the best of my ability, maybe I am missing something??

{
    "providerName": "Acme Productions",
    "lastUpdated": "2015-11-11T22:21:37+00:00",
    "language": "en",
    "Series": [{
        "id": "1509428502952",
        "title": "The Amazing Series with Seasons!",
        "seasons": [{
            

        "seasonNumber": "1",
            "episodes": [{
                "id": "1509428502952",
                "title": "The Amazing First Episode Title",
                "content": {
                    "dateAdded": "2015-11-11T22:21:37+00:00",
                    "videos": [{
                        "url": "https://example.org/cdn/videos/1509428502952",
                        "quality": "UHD",
                        "videoType": "HLS"
                    }],
                    "duration": 1290
                },

                "thumbnail": "https://example.org/cdn/thumbnails/1509428502952/1",
                "episodeNumber": 1,
                "shortDescription": "Marvelous episode description"
            }]
        }],
        "genres": [
            "educational",
            "science fiction",
            "thriller"
        ],
        "thumbnail": "https://example.org/cdn/thumbnails/1509428502952/1",
        "shortDescription": "Wondrous series seasons."
    }]
}


The missing quotes treating duration and episodenumber as integer as shown in the examples in the docs and enclosed in quotes as shown in the instructions. This can be experimented with.
I saw no where in the docs (and maybe I am just missing it) for a key phrase of episode duration, there is a duration variable under episode though. This example also is in the exact order as posted in the docs. Basically if someone wants to doublecheck this example code to the docs or a working version I'd appreciate it.
http://www.TVByDemand.com
0 Kudos
belltown
Roku Guru

Re: json format help

Watch those cases:

Series


In your episode object, and in your series object:

"releaseDate": "2015-11-11",


And I'm pretty sure that seasonNumber should be an integer, not a string, but you can experiment with that.

duration is a property of the content object; you already have that.
0 Kudos
belltown
Roku Guru

Re: json format help

There are other errors too. For example, series is an object, not an array. It's important to distinguish where the spec requires an array of objects [ {}, {}, {} ], versus just an object by itself: {}.

Try this. I haven't tested it, but I'm sure it'll get you a lot closer:


{
 "providerName": "Acme Productions",
 "lastUpdated": "2015-11-11T22:21:37+00:00",
 "language": "en",
 "series": {
   "id": "1509428502952",
   "title": "The Amazing Series with Seasons!",
   "seasons": [
     {
       "seasonNumber": 1,
       "episodes": [
         {
           "id": "1509428502952",
           "title": "The Amazing First Episode Title",
           "content": {
             "dateAdded": "2015-11-11T22:21:37+00:00",
             "videos": [
               {
                 "url": "https://example.org/cdn/videos/1509428502952",
                 "quality": "UHD",
                 "videoType": "HLS"
               }
             ],
             "duration": 1290
           },
           "thumbnail": "https://example.org/cdn/thumbnails/1509428502952/1",
           "episodeNumber": 1,
           "releaseDate": "2015-11-11",
           "shortDescription": "Marvelous episode description"
         }
       ]
     }
   ],
   "genres": [
     "educational",
     "science fiction",
     "thriller"
   ],
   "thumbnail": "https://example.org/cdn/thumbnails/1509428502952/1",
   "releaseDate": "2015-11-11",
   "shortDescription": "Wondrous series seasons."
 }
}
0 Kudos
mitchstein
Roku Guru

Re: json format help

That works well on lint.. Now I'm trying to figureo ut which brackets to put the next episode in between... Bug eyed right now, gonna take a break and then go learn me what these brackets all mean in json format. (This is why I never did java, too many unnecessary brackets!! I still love line numbers in my programs, lol)
http://www.TVByDemand.com
0 Kudos
belltown
Roku Guru

Re: json format help

"episodes" is an array [....] of episode objects {....}

To get more episodes, put as many sets of episode objects as you need, separated by commas:

"episodes": [
    {
        .... first episode stuff ....
    },
    {
        .... second episode stuff ....
    },
    {
        .... third episode stuff ....
    }
]

For example:


{
 "providerName": "Acme Productions",
 "lastUpdated": "2015-11-11T22:21:37+00:00",
 "language": "en",
 "series": {
   "id": "1509428502952",
   "title": "The Amazing Series with Seasons!",
   "seasons": [
     {
       "seasonNumber": 1,
       "episodes": [

         {
           "id": "1509428502952",
           "title": "The Amazing First Episode Title",
           "content": {
             "dateAdded": "2015-11-11T22:21:37+00:00",
             "videos": [
               {
                 "url": "https://example.org/cdn/videos/1509428502952",
                 "quality": "UHD",
                 "videoType": "HLS"
               }
             ],
             "duration": 1290
           },
           "thumbnail": "https://example.org/cdn/thumbnails/1509428502952/1",
           "episodeNumber": 1,
           "releaseDate": "2015-11-11",
           "shortDescription": "Episode 1"
         },

         {
           "id": "1509428502953",
           "title": "The Amazing Second Episode Title",
           "content": {
             "dateAdded": "2015-11-11T22:21:37+00:00",
             "videos": [
               {
                 "url": "https://example.org/cdn/videos/1509428502952",
                 "quality": "UHD",
                 "videoType": "HLS"
               }
             ],
             "duration": 1290
           },
           "thumbnail": "https://example.org/cdn/thumbnails/1509428502952/1",
           "episodeNumber": 2,
           "releaseDate": "2015-11-11",
           "shortDescription": "Episode 2"
         },

         {
           "id": "1509428502954",
           "title": "The Amazing Third Episode Title",
           "content": {
             "dateAdded": "2015-11-11T22:21:37+00:00",
             "videos": [
               {
                 "url": "https://example.org/cdn/videos/1509428502952",
                 "quality": "UHD",
                 "videoType": "HLS"
               }
             ],
             "duration": 1290
           },
           "thumbnail": "https://example.org/cdn/thumbnails/1509428502952/1",
           "episodeNumber": 3,
           "releaseDate": "2015-11-11",
           "shortDescription": "Episode 3"
         }

       ]
     }
   ],
   "genres": [
     "educational",
     "science fiction",
     "thriller"
   ],
   "thumbnail": "https://example.org/cdn/thumbnails/1509428502952/1",
   "releaseDate": "2015-11-11",
   "shortDescription": "Wondrous series seasons."
 }
}
0 Kudos
mitchstein
Roku Guru

Re: json format help

So, it passes jsonlint...
But when I add it to the channel I get

"The feed URL(s) could not be validated.
  • There was a transport-level error - (Unknown ERROR)."

  • If I point it (purposesly) to a missing json file it gives server error 400
  • If I point it to the old file it gives the original error.

  • So now I'm lost on what to do next.
  • If I browse to it from the browser it works properly...
  • http://www.TVByDemand.com
    0 Kudos
    mitchstein
    Roku Guru

    Re: json format help

    I've been reading up on json.. and wow..
    Found out json is a javascript based syntax for sending text from a browser to a server, but is used to tasport text from server to server as well, even though that was not it's original intent.
    So, I was correct when in my head I was like "all these brackets is just like javascript". It is and the ridiculous use of brackets in java is the main reason I stayed away from it over the last 15 years. There simply is no reason for it. they could have all been replaced by the use of clearly defined unique "keywords". Such as runtime, could be videoruntime, episoderuntime, instead of defining a parent variable Video[runtime] and so forth...

    After reading an explaination of how json works on stackoverflow, I more understand or can visualize how json works.

    for instance, {videos [ duration : 360]} creates an ARRAY named video which ccontains a dimension named duration which contains the value of 360... My explaination maynot make sense to modern programers, as they were brought up thinking this way, as an old timer I am used to video(1,1) = 360 which would have translated into the first video (video(1)) first value (,1) = 360 and then the other end would have been programed to know that the first variable is the duration.. now it makes some sense to me and I do not feel like I am just copying/modyfing code to make it work.

    So while this is all great stuff, and now I have a better understanding of the structure of javascript (which will open new doors and made this whole project worthwhile to me alone) I still have to say, that it is false to say that DP does require the publisher to know how to code. In the very least, json is a set of codes to transfer plain text from thier server to roku's servers. You need to know how to code in json.

    Now I am NOT saying it is not worthwhile, it most definitely is, and I will not stop till I get this thing to work, simply put this is still easier then developing with the SDK. And it still presents the "set it and forget it" promise that is most important to any developer. Hell I still have some windows 3.1 servers running at the DOT in PA. lol.. (government is so far behind).

    Anyway, Belltown, your help has been invaluable, and I appreciate it. When this is all done, We should co-author a tutorial for others to follow and maybe help get some of these great video producers from the private sector get exposure on-line in the streaming format. I hate the fact that the medium is quickly being taking away from the hobbists and being stolen by the big guys like comcast and the like.
    http://www.TVByDemand.com
    0 Kudos
    belltown
    Roku Guru

    Re: json format help

    If you PM me the url link, I'll take a look at it.
    0 Kudos
    mitchstein
    Roku Guru

    Re: json format help

    Regarding the transport error:
    I put the url directly in firefox and it "transports" properly showing up as plain text from start to finish.
    I am wondering if the actual error is not being caused by a limitation of memory allocation on the server running DP?
    This is my largest series of video with 422 episodes.
    I will post this error to Roku support directly and see what they say. although so far all they do is quote paths to the docs, which I have gone through already and did not see this limitation defined in it (if that is the problem). They have stated to me that "this format theoretically can support an unlimited number of videos". But I never bank on theories or hypotenuses, I like tried and true facts, lol.
     
    http://www.TVByDemand.com
    0 Kudos
    Need Assistance?
    Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

    Become a Roku Streaming Expert!

    Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.