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: 
Baradanikto
Roku Guru

Re: Feed URL Validation Error

I think I may have found the cause of my error.  But, I think I'm going to need someone from Roku to explain this.  My Powershell script converts my MRSS xml feed to a JSON feed.  In the process, it converts the "Content" object of the shortFormVideo object as a regular key/value pair which results in a "[" in the resulting JSON.  Looking at the feed specification, I noticed that the content object does not seem to conform to the specs like the other "objects".  It actually uses a "{".  So, while my code looks like:


"content": [
                {



The feed specification shows it as:


"content": { 



with key/value pairs.  I don't quite understand the discrepancy and why the "content" object does not behave syntactically like the other objects.  And, the reason this is a problem for me, and, possibly others, is that I can use a Powershell command called ConvertTo-Json that allows me to automate the creation of the Json file from key/value pairs.  This discrepancy breaks that command. I'm currently in the process of validating my suspicions, but, I'm stuck in "The service is still processing your feed". 

I'd love it if someone from Roku could comment on this.  I'd like not to have to create the Json by hand.
FREE Windows desktop software for converting Direct Publisher channels to SceneGraph (SDK), for creating BIF (Trick Play) files, Roku (MRSS, JSON) feed files, and FireTV feed files @ GitHub/rrirower.
0 Kudos
belltown
Roku Guru

Re: Feed URL Validation Error

You might want to study up on JSON some more. Start with http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf.

In JSON, an object is ALWAYS enclosed in braces { }. An array is ALWAYS enclosed in square brackets [ ].

If your conversion is putting square brackets around an item, it probably thinks it's made up of a list (array) of items.
0 Kudos
belltown
Roku Guru

Re: Feed URL Validation Error

... and don't forget to increase the -Depth parameter in Powershell's ConvertTo-Json cmdlet.
0 Kudos
Baradanikto
Roku Guru

Re: Feed URL Validation Error

With some prodding from belltown, I was able to determine that my Powershell script had a bug that converted the Content object incorrectly.  I've fixed it and my json now validates correctly and the channel displays properly.

I'm still having problems determining where to host the json.  In the interim, for testing, I'm using myjason.com.  I'm just not sure about how secure that site is.
FREE Windows desktop software for converting Direct Publisher channels to SceneGraph (SDK), for creating BIF (Trick Play) files, Roku (MRSS, JSON) feed files, and FireTV feed files @ GitHub/rrirower.
0 Kudos
belltown
Roku Guru

Re: Feed URL Validation Error

"Baradanikto" wrote:
I'm still having problems determining where to host the json.  In the interim, for testing, I'm using myjason.com.  I'm just not sure about how secure that site is.


I don't understand why so many people are having so much trouble finding a place to put their JSON files. Is it that you don't want to pay anything?

There are thousands of low-cost, shared web-hosting sites out there where you can put your JSON files, web sites, and anything else you want. Just Google it. There are companies like HostGator that will charge around $6/mo (for a 12-month plan), and offer a free money-back 45-day guarantee.

If you don't want to pay anything, there are other sites that will let you host stuff for free, just with limitations. For example, Gigarank.net does a fairly good job. Their only requirement is that you make 10 forum posts. After that you can host your site without any more posts.

Then there are the big-time Cloud service providers. Both Amazon Web Services and Google Cloud Platform provide a free tier for the first 12 months. After that, the costs are minimal for something as low-use as hosting a DP JSON feed.

If you don't want to pay anything at all, like with many things these days, your options become more limited and more kludgy.
0 Kudos
Baradanikto
Roku Guru

Re: Feed URL Validation Error

belltown....Please don't make assumptions.  Take a moment to re-read the first part of this thread where I indicate that I am trying to serve the json file from my Amazon S3 bucket, which, by the way, is a paid service.  You provided some initial help, but, I'm still not able to serve the json file from the S3 bucket.  I have a post on Amazon asking for help, but, it looks like they may only serve xml from their buckets.  I've also tried to serve the file from my channel's associated web site, but, I can't get the content type correct when I try to ftp it.  So, far, the only place that seems to serve the json correctly is sites like myjson.

I'd love to hear your solution to where and how to serve the json file.
FREE Windows desktop software for converting Direct Publisher channels to SceneGraph (SDK), for creating BIF (Trick Play) files, Roku (MRSS, JSON) feed files, and FireTV feed files @ GitHub/rrirower.
0 Kudos
belltown
Roku Guru

Re: Feed URL Validation Error

Sorry, I wasn't meaning to be assumptuous. I'm just trying to help.

I'm just used to using hosting providers that let you host whatever kind of files you want on their servers (within reason). I've used a couple of dozen such services over the years. They all work very much the same way and will almost certainly allow you to store your json files. I gave you a couple of examples, one that's known to be fairly reliable, but you have to pay for (although there's the 45-day money-back guarantee), and the other that's free, which I've been using for several years since they started, with only one major issue that whole time.

Amazon S3 sounds like it should be a good solution for what you want to do, especially if you're already using it and paying for it.

I thought you were on track with getting your feed working on S3. Initially, the file was not being served with the correct Content-Type header, but you said you figured that part out. Then you said you were having further problems with strange characters at the start of the file. You never responded to the questions I asked you to try and diagnose the problem regarding how you were creating the file and whether there's anywhere you can specify the character encoding.

Then you said you couldn't get your feed working even if you hosted it on myjson.com, which would indicate the problem wasn't with S3 at all, but with the feed. Then you said you found errors related to "the content object does not seem to conform to the specs", but which were actually a bug in the script you wrote to generate the Json file. Again, problems with your feed, not with your host. Now you say you have another web site associated with your channel. That would seem to be a logical place to host your feed. Yet you say, "I can't get the content type correct when I try to ftp it". Well, you don't normally set the Content-Type when you ftp to server. You configure the server to set the Content-Type when it serves particular file types to the client. S3 is a little different because of the way it sets up its "buckets".

Basically, you're going round in circles here. I would go back to square one if I were you and start working with a known, valid, JSON feed file, so you can rule out any problems with the feed itself or its encoding. My recommendation would be to set up a test private DP channel by following the Roku tutorial step-by-step - exactly. Use the feed file they supply and put it somewhere (start with myjson.com, then try your own web site, then try S3). That feed is known to work so if you get the same errors as you're getting now, then we've eliminated the feed as the problem, and can narrow it down to what's going on with your hosting.
0 Kudos
Baradanikto
Roku Guru

Re: Feed URL Validation Error

belltown...I apologize if I wasn't clear.  But, if you take a look back at my Friday post, you'll see that with your help, I was able to determine that my json feed syntax problem was due to a bug in my Powershell script.  I've fixed it and the feed validates correctly if I host it on myjson.com.  However, it will not validate from Amazon S3, my web site, or, other services I've tried.  All of these services seem to serve the json file as either an xml file, or, text/generic.  Amazon allows me to change the content-type when uploading, but, it doesn't seem to make a difference when validating from the Roku developer portal. I've tried several FTP products in an effort to upload the correct content-type, but, to no avail.  If Roku is expecting application/json when it retrieves the feed, I haven't found a way or a site that will allow me to serve the file correctly.  The only one that seems to work for me right now is myjson.com.  There may be other similar sites, but, I'd love to host the file correctly from my own site.

Thanks again for the help you've provided to this point.
FREE Windows desktop software for converting Direct Publisher channels to SceneGraph (SDK), for creating BIF (Trick Play) files, Roku (MRSS, JSON) feed files, and FireTV feed files @ GitHub/rrirower.
0 Kudos
belltown
Roku Guru

Re: Feed URL Validation Error

I took Roku's DP tutorial JSON feed and uploaded it to my web site on Gigarank, to a web site on GitHub, to myjson.com, and to an S3 bucket I just created.

In all cases, the feed is served correctly with the correct Content-Type header, and passes the DP url validation checks, and is successfully uploaded to DP (although it took an hour or two for "processing").

As far as S3 goes, even though I've never used it until a few minutes ago, I ran into no issues at all creating the S3 bucket, and getting the JSON file uploaded and then downloaded with the correct Content-Type.

I'm convinced your problem is with your feed "file", not with the hosting providers (although you have a lot of misunderstandings of how that stuff all works). When you create a feed on myjson.com, you're not uploading a "file", you're pasting copied text into a web form, which creates its own file with whatever character encoding, byte-order marks, and line-endings it needs. If you upload an actual file (to your web site or S3), you could be uploading something completely different from what DP expects (e.g. a UTF-16, or UTF-8 with BOM, file created using some kind of Windows text editor), which may not work no matter what host you serve it from, and what Content-Type you use -- which is why I've asked you (twice now) about how you are creating the file, and how it's encoded.

I'll repeat the advice I gave at the end of my last post: get a known JSON file (the one Roku provides), and get that working first! Once you've figured out how to upload a known, good file to your server (and like I said before, the Content-Type there has nothing to do with FTP), and/or to an S3 bucket (setting the Content-Type meta-data and permissions), then you can figure out how that file differs from the one of your own you've been using.

Good luck!
0 Kudos
mitchstein
Roku Guru

Re: Feed URL Validation Error

The web server you put the json file on HAS to be configured to properly create the headers when serving a json file.. I don't know how to do this with any server other then IIS, as that is what I run, I'm sure it's about the same for a linux box and if you rely on someone else to do the dirty work for you like a hosting service, then simply tell them to create the json mime type..

For IIS:


  1. Open IIS Manager

  2. Display properties for the IIS Server

  3. Click MIME Types and then add the JSON extension:

    • File name extension: .json

    • MIME type: application/json

  4. Go back to the properties for IIS Server

  5. Click on Handler Mappings

    • Add a script map

    • Request path: *.json

    • Executable: C:\WINDOWS\system32\inetsrv\asp.dll

    • Name: JSON
    And this works on all IIS 7+ servers including windows xp - 10 pro/enterprise and all flavors of server since server 2000... might work on win 95 and win 98 but really if your running that to serve videos ........................
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.