programmatic downloading and the v1 API
I'm interested in an auto-download/delete script, but I'm not able to figure out from the documentation if this is really supported.
If I get a "download_url" for an item, can I then pass that URL to curl like:
curl -u YOUR_PUT.IO_USERNAME:YOUR_PUT.IO_PASSWORD --location-trusted URL -o FILENAME.EXT -C -
I'd rather get a token from the API to perform a download rather than use a real user/pass, but the examples are only to assemble a separate streaming URL, which I don't care about in this case...
If this worked, I could create scripts for my media player that did clever things like: download all items in the X folder, and delete them after the download successfully completes.
Comments are currently closed for this discussion. You can start a new one.
2 Posted by TimClark on 05 Jan, 2011 06:29 AM
I didn't search enough. It looks like it definitely should work with curl, but requires the real credentials.
Rephrased: are there plans to issue download tokens like streaming tokens are issued?
3 Posted by aft on 05 Jan, 2011 07:41 AM
Hey Tim,
You can use streaming links for this. Streaming links doesn't require basic http auth credentials. It just requires a token as you mentioned.
Check the "Building Audio/Video Stream URLs" section on this page: https://put.io/service/api/insight
And the method you need to get the token is "acctoken"
Here is a curl sample to get the token:
Please let us know if you have further questions.
Best regards,
Cem
aft closed this discussion on 05 Jan, 2011 07:41 AM.
TimClark re-opened this discussion on 05 Jan, 2011 09:37 AM
4 Posted by TimClark on 05 Jan, 2011 09:37 AM
So is there any difference between the streaming URL and the download URL, other than the ability to use tokens? - Will I end up with the same file if I use curl to fetch?
thanks!
5 Posted by aft on 05 Jan, 2011 10:47 AM
Hello,
Yes. Only the authentication method differs. Since most of the video players don't support http auth, we use tokens for streaming urls.
You may need to specify a file name when using stream urls. I'm not sure if curl will be able to detect the file name correctly.
For wget, I use -O filename.ext parameter.
Best regards,
Cem
aft closed this discussion on 05 Jan, 2011 10:47 AM.