A
A
AlexeyMoshkin2016-03-14 07:43:11
Yandex.Disk
AlexeyMoshkin, 2016-03-14 07:43:11

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/...

I get the following:
$ curl -s -H "Authorization: OAuth <token>" https://downloader.disk.yandex.ru/disk/...
HTTP 422
No parameter: filename

What am I doing wrong? How to pass this 'filename' parameter?
API documentation
Description of the download procedure

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AlexeyMoshkin, 2016-03-14
@AlexeyMoshkin

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

D
Dimonchik, 2016-03-14
@dimonchik2013

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

how is your string different?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question