Merge pull request #186 from Stypox/recaptcha-with-url
Add url to ReCaptchaException
This commit is contained in:
commit
f9da8bc0c8
|
@ -21,7 +21,14 @@ package org.schabi.newpipe.extractor.exceptions;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ReCaptchaException extends ExtractionException {
|
public class ReCaptchaException extends ExtractionException {
|
||||||
public ReCaptchaException(String message) {
|
private String url;
|
||||||
|
|
||||||
|
public ReCaptchaException(String message, String url) {
|
||||||
super(message);
|
super(message);
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrl() {
|
||||||
|
return url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -714,8 +714,6 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ParsingException(
|
throw new ParsingException(
|
||||||
"Could load decryption code form restricted video for the Youtube service.", e);
|
"Could load decryption code form restricted video for the Youtube service.", e);
|
||||||
} catch (ReCaptchaException e) {
|
|
||||||
throw new ReCaptchaException("reCaptcha Challenge requested");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -123,8 +123,6 @@ public class DashMpdParser {
|
||||||
dashDoc = downloader.download(streamInfo.getDashMpdUrl());
|
dashDoc = downloader.download(streamInfo.getDashMpdUrl());
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
throw new DashMpdParsingException("Could not get dash mpd: " + streamInfo.getDashMpdUrl(), ioe);
|
throw new DashMpdParsingException("Could not get dash mpd: " + streamInfo.getDashMpdUrl(), ioe);
|
||||||
} catch (ReCaptchaException e) {
|
|
||||||
throw new ReCaptchaException("reCaptcha Challenge needed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -129,7 +129,7 @@ public class Downloader implements org.schabi.newpipe.extractor.Downloader {
|
||||||
* request See : https://github.com/rg3/youtube-dl/issues/5138
|
* request See : https://github.com/rg3/youtube-dl/issues/5138
|
||||||
*/
|
*/
|
||||||
if (con.getResponseCode() == 429) {
|
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);
|
throw new IOException(con.getResponseCode() + " " + con.getResponseMessage(), e);
|
||||||
|
|
Loading…
Reference in New Issue