Answer the question
In order to leave comments, you need to log in
How to download a file via curl using the Yandex Disk REST API?
I received a link to download the file using GET /v1/disk/resources/download, I indicated the token - everything is according to the documentation. When I insert this link into the address bar of the browser, the file is downloaded. When I try to download via curl:
curl -s -H "Authorization: OAuth <token>" https://downloader.disk.yandex.ru/disk/...
$ curl -s -H "Authorization: OAuth <token>" https://downloader.disk.yandex.ru/disk/...
HTTP 422
No parameter: filename
Answer the question
In order to leave comments, you need to log in
My mistake is the following: the url in the request had to be enclosed in quotes (because of the "&" symbols)
But downloading the file via curl did not help, but it downloads fine via wget
wget "https://downloader.disk.yandex.ru/disk/..." -O archive.tar
https://downloader.dst.yandex.ru/disk/53139aa0et584d3bac7eeab405d3574b/535320b4/YyjTJtEHob8R5WbpojJbiiUuU2HC_2JSTU0gW9qE0NHGW2uncmBjM_-IXun3Msyij96FTHQGSX-fDL-XwokDvA%3D%3D?uid=202727674&filename=photo.png&disposition=attachment&hash=&limit=0&content_type=application%2Fx-www-form-urlencoded&fsize=34524&hid=93528043563b8r55723a253f4730290a&media_type=document
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question