Can this stream locally hosted video?
Stream channel:https://youtube.com/watch?v=
>>> Found the issue to be brave browser and related to twitch block the browser as it blocks adverts
YouTube.php for my personal use to add game-specific stream matching for YouTube. Since YouTube deprecated their Freebase topic IDs, there's no way to match streams to specific games like Twitch and Kick can. The spelling field only accepts broad categories like "Gaming" which doesn't help when you want separate categories for different games.t:SearchQuery|keyword1,keyword2,keyword3. The search query before the pipe is what gets sent to the YouTube API, and the keywords after it are used to verify and distribute results to the correct game. For example:t:Final Fantasy|Final Fantasy VII,FF7,FFVIIt:Final Fantasy|Final Fantasy VIII,FF8,FFVIIIt:Final Fantasy|Final Fantasy VIII Remastered,FF8 Remastered,FFVIII Remasteredt:Final Fantasy|Final Fantasy IX,FF9,FFIXt:Final Fantasy|FFX,FF10,Final Fantasy X ,Final Fantasy X/X-2,Final Fantasy 10,Final Fantasy X HD

Starcraft would produce hundreds of erroneous results, because it searches all fields: titles, descriptions, etc. Changing the query to t:Starcraft limits the search specifically to searching only the tags field. This greatly reduces the results, but still has many errors. Many people will simply flood their videos will hundreds of extra tags specifically to abuse this very search system, and many people don't even bother tagging their videos in the first place.channel/UCkeZMocgb7uHpndXTYWWqAw. I am currently testing this new solution on my dev site and hope to release by the end of the week.That's a way better approach honestly. The auto-generated game channels solve the core problem cleanly without burning through API credits on search queries. I knew the search cost was high which is why I added the caching and query grouping, but 100 credits per search vs scraping a channel page at zero cost isn't even a comparison.After looking through @AxlRose's code, I realized it's not viable for various reasons. Though I did discover a better solution in the process.
As for the reasons why it doesn't work, firstly just doing a query for something likeStarcraftwould produce hundreds of erroneous results, because it searches all fields: titles, descriptions, etc. Changing the query tot:Starcraftlimits the search specifically to searching only the tags field. This greatly reduces the results, but still has many errors. Many people will simply flood their videos will hundreds of extra tags specifically to abuse this very search system, and many people don't even bother tagging their videos in the first place.
The second issue with this method is it uses the YouTube API's search query system. When YouTube deprecated their Freebase topic system, they also changed the way API limits work. They added weight values to various types of searches. Searching directly for videos cost 3 points, and each additional piece of information adds another point. So pinging the API for video information usually costs about 4 points on average (it's not exact, because you can group queries together to reduce API calls). The more channels you have, and the more results you get, and the more points your query will cost.
However, with broad search queries, as the one that @AxlRose is using, YouTube's base cost is not 3 points, but 100. If you are scraping for streams every 10 minutes, then you are spending a minimum of 600 points per hour. If your daily limit on the YouTube API is 3,000 credits, then you'll only be able to scrape for a maximum of 5 hours in a day before you get rate limited out. I myself have a credit limit of 15,000, but that's because I'm grandfathered in.
This is why we don't ping the YouTube API with base search queries and instead use a simple http fetch and pull the actual HTML from a page and parse through that using preg_matches. It doesn't ping the API at all and doesn't have a credit cost. Only after parsing through the matches, do we start pinging the YouTube API for exact video matches at 4 points on average. This is also why fetching from YouTube is a constantly moving target, as they change the construction of their website.
As for the better solution... I have discovered that YouTube started creating auto-generated "channels" for games, such as:
We can scrape these channels, using similar methods. So the "spelling" for Starcraft would be:channel/UCkeZMocgb7uHpndXTYWWqAw. I am currently testing this new solution on my dev site and hope to release by the end of the week.
- YouTube game scrapping is now back! Since YouTube deprecated their Freebase topic system, game spellings were lost. YouTube has since started creating "auto-generated" channels which automatically list streams and videos on certain topics. Putting in the URL of one of these auto-generated channels as a spelling for a game, will allow the scraping of these channels. Below are several examples:
- Starcraft: https://www.youtube.com/channel/UCkeZMocgb7uHpndXTYWWqAw...
We use essential cookies to make this site work, and optional cookies to enhance your experience.