TeamNewPipe / NewPipeExtractor

NewPipe's core library for extracting data from streaming sites
GNU General Public License v3.0
1.39k stars 420 forks source link

[YouTube] Catch RegexException in subscriber count extractor #1238

Open afontenot opened 2 weeks ago

afontenot commented 2 weeks ago

When the subscriber count extraction fails to find the Regex pattern, a RegexException is thrown. This is not a fatal error in most cases, for example when downloading the channel page in order to update the user's subscriptions, and so the correct behavior is to return UNKNOWN_SUBSCRIBER_COUNT.

Related issue: https://github.com/TeamNewPipe/NewPipe/issues/11353.

This bug comprises two issues: subscribers cannot be extracted for channels with pronoun tags, and when the RegexException is thrown, channel subscriptions will fail to update because the exception is uncaught. This commit fixes the latter aspect of the issue.

Please see my comment on the issue for suggestions on how the former issue with scraping the pronoun tags might be fixed.

Note that the last point above is not applicable to this PR, as the API does not change.

afontenot commented 2 weeks ago

My comment where I identify the probable source of the parsing issue is here: https://github.com/TeamNewPipe/NewPipe/issues/11353#issuecomment-2402915706

afontenot commented 2 weeks ago

I had a look at the CI failures and they seem clearly unrelated to my changes. Probably just flaky tests.