From fc27b8a5b8d3a8871fab3a236da9a888ccc44497 Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Sun, 7 Aug 2022 13:38:49 +0200 Subject: [PATCH] Use preexisting ``ContentNotAvailableException`` --- .../exceptions/ConsentRequiredException.java | 12 ------------ .../extractors/YoutubeMixPlaylistExtractor.java | 4 ++-- 2 files changed, 2 insertions(+), 14 deletions(-) delete mode 100644 extractor/src/main/java/org/schabi/newpipe/extractor/exceptions/ConsentRequiredException.java diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/exceptions/ConsentRequiredException.java b/extractor/src/main/java/org/schabi/newpipe/extractor/exceptions/ConsentRequiredException.java deleted file mode 100644 index 90feacc0b..000000000 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/exceptions/ConsentRequiredException.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.schabi.newpipe.extractor.exceptions; - -public class ConsentRequiredException extends ParsingException { - - public ConsentRequiredException(final String message) { - super(message); - } - - public ConsentRequiredException(final String message, final Throwable cause) { - super(message, cause); - } -} diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMixPlaylistExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMixPlaylistExtractor.java index dc7179e47..cd8e90bbb 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMixPlaylistExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMixPlaylistExtractor.java @@ -9,7 +9,7 @@ import org.schabi.newpipe.extractor.Page; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.downloader.Downloader; import org.schabi.newpipe.extractor.downloader.Response; -import org.schabi.newpipe.extractor.exceptions.ConsentRequiredException; +import org.schabi.newpipe.extractor.exceptions.ContentNotAvailableException; import org.schabi.newpipe.extractor.exceptions.ExtractionException; import org.schabi.newpipe.extractor.exceptions.ParsingException; import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler; @@ -103,7 +103,7 @@ public class YoutubeMixPlaylistExtractor extends PlaylistExtractor { if (isNullOrEmpty(playlistData)) { final ExtractionException ex = new ExtractionException("Could not get playlistData"); if (!YoutubeParsingHelper.isConsentAccepted()) { - throw new ConsentRequiredException( + throw new ContentNotAvailableException( "Consent is required in some countries to view Mix playlists", ex); }