Troikano / plugin.video.vk2

Kodi add-on for watching videos from VK.com social network. A new version with python3 for Kodi v19+
GNU General Public License v3.0
3 stars 0 forks source link

Search only shows around 450 results, is it possible to show more? #3

Open Krando opened 2 years ago

Krando commented 2 years ago

For any keyword on vk.com's video search, only around 450-500 results are capable of being fetched. For example, if there are over 5000+ videos for "real madrid", vk will show only maximum 400-500 results. Using your plugin, if we set offset parameter to 200 and "longer" duration as 15 minutes and search for "bayern", the plugin notifies us that over 2600+ videos are found and there are 14 pages with 200 videos on each. But we can only reach the 4th page and on the 5th page, no videos are shown. In other words, only 498 videos were fetched.

Is it possible to get atleast 1000 videos for any search? Can some trick make this possible? I searched around the web and came across this: https://stackoverflow.com/questions/45349838/get-more-than-200-results-on-vk-vides-search-api

The first answer to this says that it is possible to get 1000 videos using the execute method instead of video.search, I should also mention that if you add &offset=1000&count=1000 at the end of a video search on vk.com, you get the following error:

Only the first 1,000 results are available. Please specify your search parameters in more detail.

https://vk.com/search?c%5Blength%5D=2&c%5Bper_page%5D=40&c%5Bq%5D=bayern&c%5Bsection%5D=video&c%5Bsort%5D=2&offset=1000&count=1000

So this means it is possible to get 1000 videos. Your plugin would become even more great if we could get 1000 videos for a search. Can you see if you can do it?

Troikano commented 2 years ago

I think it is a problem of the API and the search tool of the VK website.

Although it shows a huge number of results, in reality it only shows between 400~500 results. As you can see from the attached images, the first and last search results in the plugin are exactly the same as on the vk website. 01 02 03 04

Even if you indicate a count=1000 in the search link it only shows 493 videos related to bayern. 05

Sorry buddy, being an API issue I can't solve this problem.

Krando commented 2 years ago

Why is then VK telling us that "Only the first 1,000 results are available" if API has limited the results to 450-500? There must be some trick to get atleast 1000 results using the API. You can take a look at these two answers and see if the problem is solvable:

https://stackoverflow.com/a/45843140 https://stackoverflow.com/a/46219457

Troikano commented 2 years ago

I know, this is very strange! The results on the api and the website are exactly the same. Even if you put a count=100 and then offset 100 by 100, you can only go up to a 400 offset. For example: https://vk.com/search?c[length]=2&c[per_page]=40&c[q]=bayern&c[section]=video&c[sort]=3&offset=400&count=100 https://vk.com/search?c[length]=2&c[per_page]=40&c[q]=bayern&c[section]=video&c[sort]=3&offset=500&count=100

However I will try to contact the support team. I hope they respond

Krando commented 2 years ago

https://vk.com/search?c[length]=2&c[per_page]=40&c[q]=bayern&c[section]=video&c[sort]=3&offset=1000&count=1000

The documentation for the variable 'count' in video.search API says it can't be set higher than 500 but if we set it to '1000', we get an error which says "Only the first 1,000 results are available" so the API itself is confused whether the limit is 500 or 1000. Something is definitely strange happening with the API. You should try to contact the support team asking them if there's some way or a trick to get 1000+ results, hopefully they are nice and help you out. Let's wait and see.