R
R
rizzli2015-01-26 21:06:02
JavaScript
rizzli, 2015-01-26 21:06:02

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

4 answer(s)
A
Alexander Taratin, 2015-01-26
@rizzli

Do you need to download from your own or someone else's? Yadisk has api
https://tech.yandex.ru/disk/

D
DjOnline, 2015-06-06
@DjOnline

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.

R
rizzli, 2015-06-07
@rizzli

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);
        }
      });

    }

A
alexsaff, 2017-05-11
@alekssaff

Dear rizzli , can you tell me how you pull the list of files from the folder?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question