mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2024-12-14 06:10:33 +05:30
Use preexisting `ContentNotAvailableException
`
This commit is contained in:
parent
17bad6cedf
commit
fc27b8a5b8
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
@ -9,7 +9,7 @@ import org.schabi.newpipe.extractor.Page;
|
|||||||
import org.schabi.newpipe.extractor.StreamingService;
|
import org.schabi.newpipe.extractor.StreamingService;
|
||||||
import org.schabi.newpipe.extractor.downloader.Downloader;
|
import org.schabi.newpipe.extractor.downloader.Downloader;
|
||||||
import org.schabi.newpipe.extractor.downloader.Response;
|
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.ExtractionException;
|
||||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
|
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
|
||||||
@ -103,7 +103,7 @@ public class YoutubeMixPlaylistExtractor extends PlaylistExtractor {
|
|||||||
if (isNullOrEmpty(playlistData)) {
|
if (isNullOrEmpty(playlistData)) {
|
||||||
final ExtractionException ex = new ExtractionException("Could not get playlistData");
|
final ExtractionException ex = new ExtractionException("Could not get playlistData");
|
||||||
if (!YoutubeParsingHelper.isConsentAccepted()) {
|
if (!YoutubeParsingHelper.isConsentAccepted()) {
|
||||||
throw new ConsentRequiredException(
|
throw new ContentNotAvailableException(
|
||||||
"Consent is required in some countries to view Mix playlists",
|
"Consent is required in some countries to view Mix playlists",
|
||||||
ex);
|
ex);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user