Answer the question
In order to leave comments, you need to log in
How to automatically download files from Yandex Disk if there is only a link to a folder?
I wanted to automate the download of files from someone else's ya.d. on nodejs.
Faced with the fact that when requesting https://yadi.sk/models/?_m=do-get-resource-url which gives a direct link to the file in response to the request, the idClient parameter is passed. And without this parameter, the desired answer does not come.
I did not figure out where to get this parameter, I did not find it in the requests. I came to the conclusion that js can generate it, but you can’t make it out in the obfuscated code.
Maybe someone has already solved similar problems?
Answer the question
In order to leave comments, you need to log in
Do you need to download from your own or someone else's? Yadisk has api
https://tech.yandex.ru/disk/
I also dealt with this issue, how to download a file from a public folder, technical support replied that it’s not possible yet, there should be a link to a public file.
I'm downloading from a public folder. Here is the node code
function (filename, callback) {
request('https://cloud-api.yandex.net/v1/disk/public/resources/download?public_key=ПУБЛИЧНАЯ_ССЫЛКА&path=/' + filename, function (error, response, body) {
if (!error && response.statusCode === 200) {
var link = JSON.parse(body).href;
callback(null, link);
} else {
console.log(error);
}
});
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question