R
R
RomkaChev2016-02-29 23:25:16
Yandex
RomkaChev, 2016-02-29 23:25:16

How to quickly get the hierarchy of albums on Yandex.Photos?

If you follow the official documentation , then you should build a hierarchy as follows:

  1. Read the entire collection of albums page by page (100 pieces per page maximum)
  2. View each Entry element
  3. Build a hierarchy by links to parent albums

However, on large volumes it works extremely slowly.
With ~8000 albums, ~80 network requests are required.
It is not possible to parallelize these queries, since all album IDs are not known in advance. Therefore, you have to literally load "page by page" - each page has a link to the next page.
At the same time, there are such links on Yandex.Fotkah (you need to log in)
  • fotki.yandex.ru/actions/ajax-albums-list.xml?autho...
  • fotki.yandex.ru/internal/get-my-albums.xml

which return the generated list very quickly (yes, it is incomplete, but this is not important here).
Question: where to dig to speed up the loading of the tree?
  • Maybe there is some undocumented way to get a tree using the API?
  • If not, how to programmatically log in to Yandex.Fotki (OAuth token does not work) to send requests to this URL - fotki.yandex.ru/internal/get-my-albums.xml ?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question