diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/exceptions/UnsupportedContentInCountryException.java b/extractor/src/main/java/org/schabi/newpipe/extractor/exceptions/UnsupportedContentInCountryException.java new file mode 100644 index 000000000..92d20c02e --- /dev/null +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/exceptions/UnsupportedContentInCountryException.java @@ -0,0 +1,20 @@ +package org.schabi.newpipe.extractor.exceptions; + +/** + * Exception for contents not supported in a country. + * + *
+ * Unsupported content means content is not intentionally geographically restricted such as for + * distribution rights, for which {@link GeographicRestrictionException} should be used instead. + *
+ */ +public class UnsupportedContentInCountryException extends ContentNotAvailableException { + + public UnsupportedContentInCountryException(final String message) { + super(message); + } + + public UnsupportedContentInCountryException(final String message, final Throwable cause) { + super(message, cause); + } +} diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/kiosk/YoutubeTrendingMusicExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/kiosk/YoutubeTrendingMusicExtractor.java index b545ec1e6..53ed963f4 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/kiosk/YoutubeTrendingMusicExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/kiosk/YoutubeTrendingMusicExtractor.java @@ -2,9 +2,9 @@ package org.schabi.newpipe.extractor.services.youtube.extractors.kiosk; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.downloader.Downloader; -import org.schabi.newpipe.extractor.exceptions.ContentNotSupportedException; import org.schabi.newpipe.extractor.exceptions.ExtractionException; import org.schabi.newpipe.extractor.exceptions.ParsingException; +import org.schabi.newpipe.extractor.exceptions.UnsupportedContentInCountryException; import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler; import javax.annotation.Nonnull; @@ -23,7 +23,7 @@ public class YoutubeTrendingMusicExtractor extends YoutubeChartsBaseKioskExtract throws IOException, ExtractionException { if (!YT_CHARTS_SUPPORTED_COUNTRY_CODES.contains( getExtractorContentCountry().getCountryCode())) { - throw new ContentNotSupportedException( + throw new UnsupportedContentInCountryException( "YouTube Charts doesn't support this country for trending music videos charts"); } super.onFetchPage(downloader);