Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@
*/

public class ReCaptchaException extends ExtractionException {
public ReCaptchaException(String message) {
private String url;

public ReCaptchaException(String message, String url) {
super(message);
this.url = url;
}

public String getUrl() {
return url;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,6 @@ private EmbeddedInfo getEmbeddedInfo() throws ParsingException, ReCaptchaExcepti
} catch (IOException e) {
throw new ParsingException(
"Could load decryption code form restricted video for the Youtube service.", e);
} catch (ReCaptchaException e) {
throw new ReCaptchaException("reCaptcha Challenge requested");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ public static ParserResult getStreams(final StreamInfo streamInfo)
dashDoc = downloader.download(streamInfo.getDashMpdUrl());
} catch (IOException ioe) {
throw new DashMpdParsingException("Could not get dash mpd: " + streamInfo.getDashMpdUrl(), ioe);
} catch (ReCaptchaException e) {
throw new ReCaptchaException("reCaptcha Challenge needed");
}

try {
Expand Down
2 changes: 1 addition & 1 deletion extractor/src/test/java/org/schabi/newpipe/Downloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private static String dl(HttpsURLConnection con) throws IOException, ReCaptchaEx
* request See : https://github.com/rg3/youtube-dl/issues/5138
*/
if (con.getResponseCode() == 429) {
throw new ReCaptchaException("reCaptcha Challenge requested");
throw new ReCaptchaException("reCaptcha Challenge requested", con.getURL().toString());
}

throw new IOException(con.getResponseCode() + " " + con.getResponseMessage(), e);
Expand Down