I get a 403 when I try to access that URL in a browser as well, so the problem appears to be with however you're retrieving the URL. A 403 response is "Forbidden" which means your token is most likely expired or otherwise invalid. It could be a querystring encoding problem. Your URL has tildes (~) in it where it looks like there maybe should be ampersands (&). I'd review the API documentation to see if there's any mention of needing to do special unescaping of the returned URL/auth token.
Also, I see you're specifying JSON as the output. I'm not sure how you're parsing the JSON on the Roku, but it could also be a problem with that. Since they offer XML output, you're probably safer using it, since there's a built in XML parser that is infinitely faster and more accurate than the available JSON samples/parsers for BrightScript.
All the url above are expired. The cookie is short. I posted them as an example. Also, the url only works from Canada
The api only returns json responses. I can parse the response no problem and get a valid video url. This url already contains the cookie. As you can see above, i can reach the master m3u8 file successfully.
The problem is with the inner m3u8. When the Roku parse the master m3u8 file and try to get the inner m3u8 file I get an error 403. It's as if the cookie was lost between the 2 calls.
"vlaine" wrote: The api only returns json responses. I can parse the response no problem and get a valid video url.
You are explicitly specifying "output=json" in the URL. If you change that to "output=xml" then it will return the results in XML. I have no doubt you can parse the JSON, but the available "SimpleJSON" libraries for BrightScript don't always decode the contents of the JSON, because they are not proper JSON parsers. My suggestion of using XML was to eliminate the possibility of there being invalid/unescaped characters in the URL value as a result of the JSON library you're using.
That aside, the 403 response is an indication that you're failing authentication, which would suggest that the authentication token is either mangled or otherwise not where it's expected to be. I see in your previous posts you have a "ReadCookies" function. Are you actually adding those cookies to the request via the roVideoScreen's ifHttpAgent? The Roku doesn't support cookies natively, so if the M3U8s require the cookie to be present and you're not adding them to the headers, that could be your problem.
But you are right about this one, I will try with xml [url]http://api.radio-canada.ca/validationMedia/v1/Validation.html?appCode=thePlatform&deviceType=iphone4&connectionType=wifi&idMedia=Z5Dnri8bTt4u_FNkYcoWECqD7vYeddci&output=json[/url]
When you return the cookies to the server you have to extract the name-value pairs only (not the attribute-value pairs) for each cookie and return the list of cookies in a "Cookie:" header where the cookies themselves (not the attributes for each cookie) are separated by semicolons, e.g.: