File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 */
2222
2323public class ReCaptchaException extends ExtractionException {
24- public ReCaptchaException (String message ) {
24+ private String url ;
25+
26+ public ReCaptchaException (String message , String url ) {
2527 super (message );
28+ this .url = url ;
29+ }
30+
31+ public String getUrl () {
32+ return url ;
2633 }
2734}
Original file line number Diff line number Diff line change @@ -714,8 +714,6 @@ private EmbeddedInfo getEmbeddedInfo() throws ParsingException, ReCaptchaExcepti
714714 } catch (IOException e ) {
715715 throw new ParsingException (
716716 "Could load decryption code form restricted video for the Youtube service." , e );
717- } catch (ReCaptchaException e ) {
718- throw new ReCaptchaException ("reCaptcha Challenge requested" );
719717 }
720718 }
721719
Original file line number Diff line number Diff line change @@ -123,8 +123,6 @@ public static ParserResult getStreams(final StreamInfo streamInfo)
123123 dashDoc = downloader .download (streamInfo .getDashMpdUrl ());
124124 } catch (IOException ioe ) {
125125 throw new DashMpdParsingException ("Could not get dash mpd: " + streamInfo .getDashMpdUrl (), ioe );
126- } catch (ReCaptchaException e ) {
127- throw new ReCaptchaException ("reCaptcha Challenge needed" );
128126 }
129127
130128 try {
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ private static String dl(HttpsURLConnection con) throws IOException, ReCaptchaEx
129129 * request See : https://github.com/rg3/youtube-dl/issues/5138
130130 */
131131 if (con .getResponseCode () == 429 ) {
132- throw new ReCaptchaException ("reCaptcha Challenge requested" );
132+ throw new ReCaptchaException ("reCaptcha Challenge requested" , con . getURL (). toString () );
133133 }
134134
135135 throw new IOException (con .getResponseCode () + " " + con .getResponseMessage (), e );
You can’t perform that action at this time.
0 commit comments