Use preexisting `ContentNotAvailableException`

This commit is contained in:
litetex 2022-08-07 13:38:49 +02:00
parent 17bad6cedf
commit fc27b8a5b8
2 changed files with 2 additions and 14 deletions

View File

@ -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);
}
}

View File

@ -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);
}