From 22bd16fca30fad09240be55158049716314b6c75 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Sun, 14 Mar 2021 00:58:42 +0100 Subject: [PATCH] Make vars private, final and static --- .../newpipe/extractor/exceptions/ReCaptchaException.java | 2 +- .../media_ccc/extractors/MediaCCCLiveStreamKiosk.java | 2 +- .../services/soundcloud/SoundcloudParsingHelper.java | 2 +- .../linkHandler/SoundcloudChannelLinkHandlerFactory.java | 2 +- .../linkHandler/SoundcloudChartsLinkHandlerFactory.java | 4 ++-- .../linkHandler/SoundcloudPlaylistLinkHandlerFactory.java | 2 +- .../linkHandler/SoundcloudStreamLinkHandlerFactory.java | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/exceptions/ReCaptchaException.java b/extractor/src/main/java/org/schabi/newpipe/extractor/exceptions/ReCaptchaException.java index 504ea8fe..b077ae59 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/exceptions/ReCaptchaException.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/exceptions/ReCaptchaException.java @@ -21,7 +21,7 @@ package org.schabi.newpipe.extractor.exceptions; */ public class ReCaptchaException extends ExtractionException { - private String url; + private final String url; public ReCaptchaException(final String message, final String url) { super(message); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCLiveStreamKiosk.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCLiveStreamKiosk.java index 14049bb3..260b04f3 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCLiveStreamKiosk.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/media_ccc/extractors/MediaCCCLiveStreamKiosk.java @@ -16,7 +16,7 @@ import javax.annotation.Nonnull; import java.io.IOException; public class MediaCCCLiveStreamKiosk extends KioskExtractor { - public JsonArray doc; + private JsonArray doc; public MediaCCCLiveStreamKiosk(StreamingService streamingService, ListLinkHandler linkHandler, String kioskId) { super(streamingService, linkHandler, kioskId); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudParsingHelper.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudParsingHelper.java index 1aac227a..2c377846 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudParsingHelper.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudParsingHelper.java @@ -46,7 +46,7 @@ public class SoundcloudParsingHelper { private SoundcloudParsingHelper() { } - public synchronized static String clientId() throws ExtractionException, IOException { + public static synchronized String clientId() throws ExtractionException, IOException { if (!isNullOrEmpty(clientId)) return clientId; Downloader dl = NewPipe.getDownloader(); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudChannelLinkHandlerFactory.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudChannelLinkHandlerFactory.java index 4ef513b8..e49834eb 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudChannelLinkHandlerFactory.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudChannelLinkHandlerFactory.java @@ -10,7 +10,7 @@ import java.util.List; public class SoundcloudChannelLinkHandlerFactory extends ListLinkHandlerFactory { private static final SoundcloudChannelLinkHandlerFactory instance = new SoundcloudChannelLinkHandlerFactory(); - private final String URL_PATTERN = "^https?://(www\\.|m\\.)?soundcloud.com/[0-9a-z_-]+" + + private static final String URL_PATTERN = "^https?://(www\\.|m\\.)?soundcloud.com/[0-9a-z_-]+" + "(/((tracks|albums|sets|reposts|followers|following)/?)?)?([#?].*)?$"; public static SoundcloudChannelLinkHandlerFactory getInstance() { diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudChartsLinkHandlerFactory.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudChartsLinkHandlerFactory.java index 546564e4..dfe1c80a 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudChartsLinkHandlerFactory.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudChartsLinkHandlerFactory.java @@ -6,8 +6,8 @@ import org.schabi.newpipe.extractor.utils.Parser; import java.util.List; public class SoundcloudChartsLinkHandlerFactory extends ListLinkHandlerFactory { - private final String TOP_URL_PATTERN = "^https?://(www\\.|m\\.)?soundcloud.com/charts(/top)?/?([#?].*)?$"; - private final String URL_PATTERN = "^https?://(www\\.|m\\.)?soundcloud.com/charts(/top|/new)?/?([#?].*)?$"; + private static final String TOP_URL_PATTERN = "^https?://(www\\.|m\\.)?soundcloud.com/charts(/top)?/?([#?].*)?$"; + private static final String URL_PATTERN = "^https?://(www\\.|m\\.)?soundcloud.com/charts(/top|/new)?/?([#?].*)?$"; @Override diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudPlaylistLinkHandlerFactory.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudPlaylistLinkHandlerFactory.java index 53a70d3a..3adade10 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudPlaylistLinkHandlerFactory.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudPlaylistLinkHandlerFactory.java @@ -10,7 +10,7 @@ import java.util.List; public class SoundcloudPlaylistLinkHandlerFactory extends ListLinkHandlerFactory { private static final SoundcloudPlaylistLinkHandlerFactory instance = new SoundcloudPlaylistLinkHandlerFactory(); - private final String URL_PATTERN = "^https?://(www\\.|m\\.)?soundcloud.com/[0-9a-z_-]+" + + private static final String URL_PATTERN = "^https?://(www\\.|m\\.)?soundcloud.com/[0-9a-z_-]+" + "/sets/[0-9a-z_-]+/?([#?].*)?$"; public static SoundcloudPlaylistLinkHandlerFactory getInstance() { diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudStreamLinkHandlerFactory.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudStreamLinkHandlerFactory.java index e271345d..48aa836e 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudStreamLinkHandlerFactory.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/linkHandler/SoundcloudStreamLinkHandlerFactory.java @@ -8,7 +8,7 @@ import org.schabi.newpipe.extractor.utils.Utils; public class SoundcloudStreamLinkHandlerFactory extends LinkHandlerFactory { private static final SoundcloudStreamLinkHandlerFactory instance = new SoundcloudStreamLinkHandlerFactory(); - private final String URL_PATTERN = "^https?://(www\\.|m\\.)?soundcloud.com/[0-9a-z_-]+" + + private static final String URL_PATTERN = "^https?://(www\\.|m\\.)?soundcloud.com/[0-9a-z_-]+" + "/(?!(tracks|albums|sets|reposts|followers|following)/?$)[0-9a-z_-]+/?([#?].*)?$"; private SoundcloudStreamLinkHandlerFactory() {