Closed MartenBE closed 2 years ago
Hey YouTube is simply blocking the request sometimes.
To create a rough picture.
You add one feed, news tries to fetch the favicon. If that request fails because it's blocked it will be empty.
If you have X feeds from YouTube the fetcher will loop over all feeds and try to get the favicon. We know for sure that grabbing the favicon can take multiple requests as there is no protocol just conventions for example created by Apple for the iPhone back then.
We also had an issue report that news is making way more requests than expected, it's not yet reproduced though and we also have to understanding why it might happen.
Anyways, YouTube probably has a automatic load balancer and firewall and will block automated scripts that send too many requests whatever "too many" means for youtube.
If while fetching the update the the favicon request is blocked it will be empty.
I think there is no easy fix for this, the library did receive an update recently regarding the user agent which might lead to less blocking by YouTube (?) Enhancing the logic would be another option but would also slow down the fetching process per feed. Currently creating a new release is blocked by new front-end code that was already merged but doesn't work.
Hi, thanks for the answer. Is there a logic in why some are blocked and some aren't?
Probably it relates to the amount of requests, basically from the point of view from YouTube you ask for the same file over and over again.
And also in the same pattern, so I imagine they have some defense system running in front of the Webservers that is checking for spacious patterns. It might also be different depending on the specific server that is serving that instance of YouTube.
The library has some caching and a trimming logic so it would always ask for YouTube.com/favicon.ico I guess and maybe some more for better resolution (apple standard).
But I guess the cache is only used after the first request, Webservers and clients can communicate with each other to indicate that a file has not changed. But this first request already fails and the library throws an error before touching the cache
Haven't checked the code but that is what I reconstruct from memory
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
When subscribing to youtube links, some download a favicon and others don't. It seems to be related to each channel (e.g. deleting and re-adding don't seem to change the behavior for a channel). See the screenshot for some channels (I've blurred out non-relevant feeds):
Nextcloud 22.1.0 PHP 7.4.22 mysql 10.6.4
Log when trying to add the non-favicon youtube channels