[YouTube] Add custom error for "Sign in to confirm ..."#1352
[YouTube] Add custom error for "Sign in to confirm ..."#1352TobiGr merged 1 commit intoTeamNewPipe:devfrom
Conversation
b71f343 to
3d673ee
Compare
|
Many users reported that the detection works fine, e.g. see TeamNewPipe/NewPipe#12533 |
3d673ee to
3e57052
Compare
|
I removed detection for "Watch on the latest version" because that's an extractor bug (i.e. the request is invalid, just like other parsing exceptions) and the user can't do anything about it |
3e57052 to
b8bd4cd
Compare
| + status + ": \"" + reason + "\""); | ||
| } | ||
|
|
||
| throw new ContentNotAvailableException("Got error " + status + ": \"" + reason + "\""); |
There was a problem hiding this comment.
I was thinking, should this really be a ContentNotAvailableException? I think ContentNotAvailableException should be reserved for when the extractor notices that the service explicitly reports a resource as not being available (e.g. age restricted, channel deleted, and so on). It should not be used for unknown errors in fetching resources, which is the case here. I would turn this into just ParsingException, add a clarifying comment to ContentNotAvailableException, and check all other places where ContentNotAvailableException is thrown. What's your opinion @AudricV?
Note: currently in some parts of NewPipe we assume that ContentNotAvailableExceptions are not supposed to be reported.
There was a problem hiding this comment.
Unless we start detecting all real unavailability errors (deleted video, unavailable/removed due to closed/removed YouTube account, ...), I don't think so.
There was a problem hiding this comment.
Right now we are unsure what the issue is here: it might be that the video is actually unavailable, but it might also be that YouTube refused to provide data for other reasons. So reporting that the content is unavailable is incorrect, we should instead report that the extractor failed to extract the data. Even if the video was actually unavailable and the extractor was unable to notice that, then it's the extractor's fault so ParsingException fits.

This PR adds a custom exception when "Sign in to confirm that you're not a bot" is detected from YouTube, so we can show a custom message in NewPipe. I could not test whether the detection works because I am not experiencing temporary bans from YouTube at the moment, but I based my checks on TeamNewPipe/NewPipe#11139 .