-
-
Notifications
You must be signed in to change notification settings - Fork 537
[YouTube] Add custom error for "Sign in to confirm ..." #1352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...r/src/main/java/org/schabi/newpipe/extractor/exceptions/SignInConfirmNotBotException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package org.schabi.newpipe.extractor.exceptions; | ||
|
|
||
| /** | ||
| * Content can't be extracted because the service requires logging in to confirm the user is not a | ||
| * bot. Can usually only be solvable by changing IP (e.g. in the case of YouTube). | ||
| */ | ||
| public class SignInConfirmNotBotException extends ParsingException { | ||
| public SignInConfirmNotBotException(final String message) { | ||
| super(message); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking, should this really be a
ContentNotAvailableException? I thinkContentNotAvailableExceptionshould 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 justParsingException, add a clarifying comment toContentNotAvailableException, and check all other places whereContentNotAvailableExceptionis 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I was going after. But for this classification to really work well, we need the two exception types to be distinct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds like a good idea.