Tyrrrz / YoutubeExplode

Abstraction layer over YouTube's internal API
MIT License
2.9k stars 483 forks source link

Some videos are missing from search results #221

Closed Giggitybyte closed 3 years ago

Giggitybyte commented 5 years ago

It would seem that videos that are from topic channels are excluded from the search results.

YouTube search results. YoutubeExplode search results.

Aside from mixes, playlists, and "related" videos, content from topic channels are just straight up missing from YoutubeExplode search results.

SlowLogicBoy commented 5 years ago

Can you give us a link to a video that's missing?

  1. This might be because it's an explicit video and requires you to log in to see it.
  2. youtube search is adjusted for your account and that's why results are different.

This is how my youtube search looks like: image

Giggitybyte commented 5 years ago

A few missing videos: Video Video Video Video

As I said, it's every topic video. It doesn't matter if I'm signed in or not, I'll get pretty much the same search results from YouTube.

Example with another search: YouTube results. YoutubeExplode results. The second result from the YouTube results, which is from a topic channel, is missing from the YoutubeExplode results.

Tyrrrz commented 5 years ago

The SearchVideosAsync method is actually using YouTube's IFrame API, which is equivalent to opening this embed player in a browser: https://www.youtube.com/embed/?listType=search&list=115 (it used to show the list of videos before but for some reason it doesn't anymore, but you will still get the next video after this one finishes).

This search was known to work differently than the one on the actual website and some of the discrepancies were eventually removed by YouTube itself. I guess the recent introduction of topics in the search results hasn't made it into IFrame player yet.

Tyrrrz commented 5 years ago

Also, note that search results are personalized, even in incognito mode.

For example here are my results from (1) YoutubeExplode (2) Incognito search (3) Logged in search. Note the difference between them, but also between my results and your (@Giggitybyte) results -- I don't have any topics.

image image image

Giggitybyte commented 5 years ago

I've tried on a few different devices and I get almost the same search results from YouTube, even on my phone browser using 4G. Results from topics must only show in some regions; I'm in the United States.

Giggitybyte commented 5 years ago

Is there a way to get search data other than the IFrame API short of scraping the search page itself?

Tyrrrz commented 5 years ago

I want to know if there is, too. Last time I looked into it, I couldn't find anything better than scrapping the page.

Giggitybyte commented 5 years ago

Well, if you figure out another way or you end up scraping the page, let me know. I'd love to have those topics results for my users.