URL help(solved)

http://192.168.100.16:5000//webapi/entry.cgi?api=SYNO.FileStation.Download&version=2&method=download&path=/video/2010.jpg&mode=open&sid=e3kYlfOEenT8A14B0MNN453413

This is a request to a Synology NAS. They have just updated their firmware. Yuck.

This URL produces the proper thing - a thumbnail .jpg -if pasted into a browser. The Roku doesn’t like it: *** ERROR: Invalid path:
I have tried escaping it but same results.

Thanks

Is that single quote supposed to be at the end?

–Mark

“RokuMarkn” wrote:
Is that single quote supposed to be at the end?

–Mark

Nope, sorry about that. (fixed)

Should that second double slash be a single slash?

And I think you need to escape your last two slashes to %2F


http://192.168.100.16:5000/webapi/entry.cgi?api=SYNO.FileStation.Download&version=2&method=download&path=%2Fvideo%2F2010.jpg&mode=open&sid=e3kYlfOEenT8A14B0MNN453413

“belltown” wrote:
Should that second double slash be a single slash?

And I think you need to escape your last two slashes to %2F


http://192.168.100.16:5000/webapi/entry.cgi?api=SYNO.FileStation.Download&version=2&method=download&path=%2Fvideo%2F2010.jpg&mode=open&sid=e3kYlfOEenT8A14B0MNN453413

Well that didn’t change anything on the Roku.

In the browser it works with a double slash or a single slash (!), and the path part works without escaping the slashes. Not understanding this.

“belltown” wrote:
And I think you need to escape your last two slashes to %2FNot necessarily because as а “reserved character”, only in certain contexts / must be encoded to avoid confusion from “reserved purpose” use - and it has no “reserved purpose” in a query string.> "https wrote:
In the “query” component of a URI (the part after a ? character), for example, “/” is still considered a reserved character but it normally has no reserved purpose, unless a particular URI scheme says otherwise. The character does not need to be percent-encoded when it has no reserved purpose.But you are right it was worth trying the other way, because “URI consumers shouldn’t treat [them] differently … but some do.”

“squirreltown” wrote:
Well that didn’t change anything on the Roku.
In the browser it works with a double slash or a single slash (!), and the path part works without escaping the slashes. Not understanding this.
How about if you open it in “incognito”/“private” browser window - does it work outright or does it force you to login first? If the latter, means it worked for you in the browser because you had previous session opened and it sends some cookies with each request.

Which method produces the “invalid path” error? Can you post some code? I’ve not been able to reproduce this using roUrlTransfer with your URL.

–Mark

@squirreltown - see https://global.download.synology.com/do … _Guide.pdf

Making Requests” wrote:

  • _sid: Authorized session ID. Each API request should pass it, which is retrieved from the response of /webapi/auth.cgi, via either HTTP/HTTPS GET/POST method with “_sid” argument. Otherwise, if you pass it within “id” value of cookie of HTTP/HTTPS header, this parameter can be ignored.
    I bet you are missing “Step 2: Log in” from the “API Workflow”. URL works in browser because of cookies but for Roku you’ll have to “explicitate” the SID.

“EnTerr” wrote:
@squirreltown - see https://global.download.synology.com/do … _Guide.pdf

Making Requests” wrote:

  • _sid: Authorized session ID. Each API request should pass it, which is retrieved from the response of /webapi/auth.cgi, via either HTTP/HTTPS GET/POST method with “_sid” argument. Otherwise, if you pass it within “id” value of cookie of HTTP/HTTPS header, this parameter can be ignored.
    I bet you are missing “Step 2: Log in” from the “API Workflow”. URL works in browser because of cookies but for Roku you’ll have to “explicitate” the SID.

Actually i am doing the log-in and using it. First you do the Auth, and you get a session id. then you attach that to every request. So next i get the list of files and that is fine. If you look at my first post, you’ll see it.
Synology changed their firmware so that the Sharing API (which i was using because i can’t figure out how to find the box on the LAN with a socket or however actual media players do it) doesn’t actually send the files anymore, that seems to be done with a new Download API which was going fine until this problem. Unable to get past this, i tried setting up the web server and getting the files that way (no auth needed) and now the Roku won’t play certain audio files that are known to be good (file plays fine every way except Roku, and Roku has played the file previously) so it skips the file and blows up the audio indexing. Just a snowball that keeps rolling.

“RokuMarkn” wrote:
Which method produces the “invalid path” error? Can you post some code? I’ve not been able to reproduce this using roUrlTransfer with your URL.

Mark, with the authorization requirement, I don’t see how you can duplicate my setup without a Synology NAS on 6.0. I was sort of hoping for some obvious url error I wasn’t seeing.

Are you using roUrlTransfer or HD/SDPosterUrl, etc?

“belltown” wrote:
Are you using roUrlTransfer or HD/SDPosterUrl, etc?

All the graphics are using TextureManager. I’ve also been just pulling files with URLtransfer to check if they work in the same situations, and they don’t. The app has been working fine with USB for more than a year. I added the NAS access about 4 months ago, and it all worked fine.

One odd thing - I do as i said above and attempt to download a file to tmp and show it on screen once all the auth/indexing is done. the response on the get is 200, which is successful right? Although i’m not sure which part of the process is indicated to be a success by that.

“squirreltown” wrote:
I’ve also been just pulling files with URLtransfer to check if they work in the same situations, and they don’t.
What error code/message have you been getting with roUrlTransfer?

Heh. See above post.

“EnTerr” wrote:

How about if you open it in “incognito”/“private” browser window - does it work outright or does it force you to login first? If the latter, means it worked for you in the browser because you had previous session opened and it sends some cookies with each request.

I did do this. You have to paste in the Auth url, that comes back successful, then paste the graphic url. This worked in Chrome in regular and extra-incognito mode.

The next thing I would try is to use an image that is known to work.

Try using this url instead of the one you posted, and see if the image appears:


http://avatarbox.net/avatars/img13//army_squirrel_avatar_picture_45955.jpg?api=SYNO.FileStation.Download&version=2&method=download&path=/video/2010.jpg&mode=open&sid=e3kYlfOEenT8A14B0MNN453413

It works on my Roku, both when using roUrlTransfer, and when using the image url directly in an roPosterScreen. I retrieving it using the Texture Manager as well with no errors.

Whether or not it works should give you more information about what’s going on. It’s probably not the url format though because the one I gave you which works looks like it’s in the same format as the one you’ve been using.

Also, just because your roUrlTransfer returned a 200 code, it doesn’t mean that it retrieved an image; you’d have to dump out the data (use the debugger) to see if it looks like it’s in jpeg format, or something else (like a text string telling you what’s going on).

“belltown” wrote:
The next thing I would try is to use an image that is known to work.

Try using this url instead of the one you posted, and see if the image appears:

Also, just because your roUrlTransfer returned a 200 code, it doesn’t mean that it retrieved an image; you’d have to dump out the data (use the debugger) to see if it looks like it’s in jpeg format, or something else (like a text string telling you what’s going on).

Hey I didn’t know they made helmets that small! Good to know for the occasional hailstorm. Yea i’m testing the URLs with URL transfer pretty regular, it’s all coming in fine except this one way, which should work.

The problem with this problem is that it seems like I’m doing the right things, the app works gangbusters when it can get the files, the Roku does what it should except for this instance. The Syno API is new, but it works fine with the browser. I’m going to get it, but just not sure how at this point.

The fun of problem solving: When you’ve eliminated a bunch of possibilities, all that’s left is a bunch of other possibilities.

“squirreltown” wrote:

Mark, with the authorization requirement, I don’t see how you can duplicate my setup without a Synology NAS on 6.0. I was sort of hoping for some obvious url error I wasn’t seeing.

Normally the “invalid URL” error comes from parsing the URL, before it sends anything out on the network. I’d expect it to happen independently of whether there’s actually a Synology or anything else at that address. However something more complicated could be happening, like the Synology returning a redirect to another URL which the Roku thinks is invalid. If you change the URL to just replace the IP address with an address that doesn’t exist on your LAN, do you get the same error?

–Mark

“squirreltown” wrote:
Actually i am doing the log-in and using it. First you do the Auth, and you get a session id. then you attach that to every request. So next i get the list of files and that is fine. If you look at my first post, you’ll see it.
In the URL i see you are passing “sid” when RTFM says you should pass “_sid”. Underscore in front of sid, yes?

Also i am suspicious about the use of “mode=download” instead of “mode=open”, since that changes Content-Type and sends Content-Disposition header in response - and i don’t know if that will affect Roku’s behavior (no reason to but open seems safer).

“EnTerr” wrote:
Underscore in front of sid, yes?

Also i am suspicious about the use of “mode=download” instead of “mode=open”, since that changes Content-Type and sends Content-Disposition header in response - and i don’t know if that will affect Roku’s behavior (no reason to but open seems safer).

Winner!!! You of the eagle eye has saved me again. Never underestimate the under-score, that was it. A silly typo. Luckily I only have to show my avatars face.

As for the open/download thing, now that i have it running i can test, but i expect it to only work with “open”. Synology seems to have taken the old Sharing API and split it into Sharing and Download API’s. I’m not clear on the usefulness of Sharing now, because it just puts up a “download” button.

Thanks EnTerr, and RokuMarkn and belltown too, appreciate it.