From 937a387f4e97a5ce7df0d69f3d5be6cb0b2ce218 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Sat, 24 Dec 2016 15:19:40 +0100 Subject: [PATCH] rename reCaptchaException to ReCaptchaException --- app/src/main/java/org/schabi/newpipe/Downloader.java | 12 ++++++------ .../org/schabi/newpipe/extractor/DashMpdParser.java | 8 ++++---- .../org/schabi/newpipe/extractor/Downloader.java | 8 ++++---- ...CaptchaException.java => ReCaptchaException.java} | 6 +++--- .../services/youtube/YoutubeStreamExtractor.java | 8 ++++---- .../schabi/newpipe/search_fragment/SearchWorker.java | 4 ++-- 6 files changed, 23 insertions(+), 23 deletions(-) rename app/src/main/java/org/schabi/newpipe/extractor/exceptions/{reCaptchaException.java => ReCaptchaException.java} (84%) diff --git a/app/src/main/java/org/schabi/newpipe/Downloader.java b/app/src/main/java/org/schabi/newpipe/Downloader.java index 748d6bd4d..a441e8978 100644 --- a/app/src/main/java/org/schabi/newpipe/Downloader.java +++ b/app/src/main/java/org/schabi/newpipe/Downloader.java @@ -1,6 +1,6 @@ package org.schabi.newpipe; -import org.schabi.newpipe.extractor.exceptions.reCaptchaException; +import org.schabi.newpipe.extractor.exceptions.ReCaptchaException; import java.io.BufferedReader; import java.io.IOException; @@ -67,7 +67,7 @@ public class Downloader implements org.schabi.newpipe.extractor.Downloader { * @param siteUrl the URL of the text file to return the contents of * @param language the language (usually a 2-character code) to set as the preferred language * @return the contents of the specified text file*/ - public String download(String siteUrl, String language) throws IOException, reCaptchaException { + public String download(String siteUrl, String language) throws IOException, ReCaptchaException { Map requestProperties = new HashMap<>(); requestProperties.put("Accept-Language", language); return download(siteUrl, requestProperties); @@ -80,7 +80,7 @@ public class Downloader implements org.schabi.newpipe.extractor.Downloader { * @param customProperties set request header properties * @return the contents of the specified text file * @throws IOException*/ - public String download(String siteUrl, Map customProperties) throws IOException, reCaptchaException { + public String download(String siteUrl, Map customProperties) throws IOException, ReCaptchaException { URL url = new URL(siteUrl); HttpsURLConnection con = (HttpsURLConnection) url.openConnection(); Iterator it = customProperties.entrySet().iterator(); @@ -92,7 +92,7 @@ public class Downloader implements org.schabi.newpipe.extractor.Downloader { } /**Common functionality between download(String url) and download(String url, String language)*/ - private static String dl(HttpsURLConnection con) throws IOException, reCaptchaException { + private static String dl(HttpsURLConnection con) throws IOException, ReCaptchaException { StringBuilder response = new StringBuilder(); BufferedReader in = null; @@ -121,7 +121,7 @@ public class Downloader implements org.schabi.newpipe.extractor.Downloader { * 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"); } throw new IOException(e); } finally { @@ -137,7 +137,7 @@ public class Downloader implements org.schabi.newpipe.extractor.Downloader { * Primarily intended for downloading web pages. * @param siteUrl the URL of the text file to download * @return the contents of the specified text file*/ - public String download(String siteUrl) throws IOException, reCaptchaException { + public String download(String siteUrl) throws IOException, ReCaptchaException { URL url = new URL(siteUrl); HttpsURLConnection con = (HttpsURLConnection) url.openConnection(); //HttpsURLConnection con = NetCipher.getHttpsURLConnection(url); diff --git a/app/src/main/java/org/schabi/newpipe/extractor/DashMpdParser.java b/app/src/main/java/org/schabi/newpipe/extractor/DashMpdParser.java index 7dcbc16a8..c8ef7f1ac 100644 --- a/app/src/main/java/org/schabi/newpipe/extractor/DashMpdParser.java +++ b/app/src/main/java/org/schabi/newpipe/extractor/DashMpdParser.java @@ -3,7 +3,7 @@ package org.schabi.newpipe.extractor; import android.util.Xml; import org.schabi.newpipe.extractor.exceptions.ParsingException; -import org.schabi.newpipe.extractor.exceptions.reCaptchaException; +import org.schabi.newpipe.extractor.exceptions.ReCaptchaException; import org.schabi.newpipe.extractor.stream_info.AudioStream; import org.xmlpull.v1.XmlPullParser; @@ -44,15 +44,15 @@ public class DashMpdParser { } public static List getAudioStreams(String dashManifestUrl) - throws DashMpdParsingException, reCaptchaException { + throws DashMpdParsingException, ReCaptchaException { String dashDoc; Downloader downloader = NewPipe.getDownloader(); try { dashDoc = downloader.download(dashManifestUrl); } catch(IOException ioe) { throw new DashMpdParsingException("Could not get dash mpd: " + dashManifestUrl, ioe); - } catch (reCaptchaException e) { - throw new reCaptchaException("reCaptcha Challenge needed"); + } catch (ReCaptchaException e) { + throw new ReCaptchaException("reCaptcha Challenge needed"); } Vector audioStreams = new Vector<>(); try { diff --git a/app/src/main/java/org/schabi/newpipe/extractor/Downloader.java b/app/src/main/java/org/schabi/newpipe/extractor/Downloader.java index f25375113..fe85696b5 100644 --- a/app/src/main/java/org/schabi/newpipe/extractor/Downloader.java +++ b/app/src/main/java/org/schabi/newpipe/extractor/Downloader.java @@ -1,6 +1,6 @@ package org.schabi.newpipe.extractor; -import org.schabi.newpipe.extractor.exceptions.reCaptchaException; +import org.schabi.newpipe.extractor.exceptions.ReCaptchaException; import java.io.IOException; import java.util.Map; @@ -33,7 +33,7 @@ public interface Downloader { * @param language the language (usually a 2-character code) to set as the preferred language * @return the contents of the specified text file * @throws IOException*/ - String download(String siteUrl, String language) throws IOException, reCaptchaException; + String download(String siteUrl, String language) throws IOException, ReCaptchaException; /**Download the text file at the supplied URL as in download(String), * but set the HTTP header field "Accept-Language" to the supplied string. @@ -41,12 +41,12 @@ public interface Downloader { * @param customProperties set request header properties * @return the contents of the specified text file * @throws IOException*/ - String download(String siteUrl, Map customProperties) throws IOException, reCaptchaException; + String download(String siteUrl, Map customProperties) throws IOException, ReCaptchaException; /**Download (via HTTP) the text file located at the supplied URL, and return its contents. * Primarily intended for downloading web pages. * @param siteUrl the URL of the text file to download * @return the contents of the specified text file * @throws IOException*/ - String download(String siteUrl) throws IOException, reCaptchaException; + String download(String siteUrl) throws IOException, ReCaptchaException; } diff --git a/app/src/main/java/org/schabi/newpipe/extractor/exceptions/reCaptchaException.java b/app/src/main/java/org/schabi/newpipe/extractor/exceptions/ReCaptchaException.java similarity index 84% rename from app/src/main/java/org/schabi/newpipe/extractor/exceptions/reCaptchaException.java rename to app/src/main/java/org/schabi/newpipe/extractor/exceptions/ReCaptchaException.java index a9107f15e..a28ec99f9 100644 --- a/app/src/main/java/org/schabi/newpipe/extractor/exceptions/reCaptchaException.java +++ b/app/src/main/java/org/schabi/newpipe/extractor/exceptions/ReCaptchaException.java @@ -4,7 +4,7 @@ package org.schabi.newpipe.extractor.exceptions; * Created by beneth on 07.12.16. * * Copyright (C) Christian Schabesberger 2016 - * reCaptchaException.java is part of NewPipe. + * ReCaptchaException.java is part of NewPipe. * * NewPipe is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,8 +20,8 @@ package org.schabi.newpipe.extractor.exceptions; * along with NewPipe. If not, see . */ -public class reCaptchaException extends ExtractionException { - public reCaptchaException(String message) { +public class ReCaptchaException extends ExtractionException { + public ReCaptchaException(String message) { super(message); } } diff --git a/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java b/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java index aa07bf96f..5910a1efb 100644 --- a/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java +++ b/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java @@ -11,7 +11,7 @@ import org.mozilla.javascript.ScriptableObject; import org.schabi.newpipe.extractor.AbstractStreamInfo; import org.schabi.newpipe.extractor.exceptions.ExtractionException; import org.schabi.newpipe.extractor.exceptions.ParsingException; -import org.schabi.newpipe.extractor.exceptions.reCaptchaException; +import org.schabi.newpipe.extractor.exceptions.ReCaptchaException; import org.schabi.newpipe.extractor.stream_info.AudioStream; import org.schabi.newpipe.extractor.Downloader; import org.schabi.newpipe.extractor.NewPipe; @@ -281,7 +281,7 @@ public class YoutubeStreamExtractor extends StreamExtractor { } } - private String getPlayerUrlFromRestrictedVideo(String pageUrl) throws ParsingException, reCaptchaException { + private String getPlayerUrlFromRestrictedVideo(String pageUrl) throws ParsingException, ReCaptchaException { try { Downloader downloader = NewPipe.getDownloader(); String playerUrl = ""; @@ -303,8 +303,8 @@ public class YoutubeStreamExtractor extends StreamExtractor { } 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"); + } catch (ReCaptchaException e) { + throw new ReCaptchaException("reCaptcha Challenge requested"); } } diff --git a/app/src/main/java/org/schabi/newpipe/search_fragment/SearchWorker.java b/app/src/main/java/org/schabi/newpipe/search_fragment/SearchWorker.java index 7ce0d30c5..6156d356d 100644 --- a/app/src/main/java/org/schabi/newpipe/search_fragment/SearchWorker.java +++ b/app/src/main/java/org/schabi/newpipe/search_fragment/SearchWorker.java @@ -8,7 +8,7 @@ import android.util.Log; import android.view.View; import org.schabi.newpipe.extractor.exceptions.ExtractionException; -import org.schabi.newpipe.extractor.exceptions.reCaptchaException; +import org.schabi.newpipe.extractor.exceptions.ReCaptchaException; import org.schabi.newpipe.extractor.search.SearchEngine; import org.schabi.newpipe.extractor.search.SearchResult; import org.schabi.newpipe.report.ErrorActivity; @@ -123,7 +123,7 @@ public class SearchWorker { } // hard errors: - } catch (reCaptchaException e) { + } catch (ReCaptchaException e) { h.post(new Runnable() { @Override public void run() {