Throw ContentNotSupportedException when opening radio uploader channel
This commit is contained in:
parent
932d094d6a
commit
cfe88a74c1
|
@ -8,6 +8,7 @@ import org.schabi.newpipe.extractor.MediaFormat;
|
|||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
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.ReCaptchaException;
|
||||
|
@ -56,9 +57,8 @@ public class BandcampRadioStreamExtractor extends BandcampStreamExtractor {
|
|||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUploaderUrl() {
|
||||
return Jsoup.parse(showInfo.getString("image_caption"))
|
||||
.getElementsByTag("a").first().attr("href").trim();
|
||||
public String getUploaderUrl() throws ContentNotSupportedException {
|
||||
throw new ContentNotSupportedException("Fan pages are not supported");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
|
|
@ -3,12 +3,11 @@ package org.schabi.newpipe.extractor.services.bandcamp;
|
|||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.DownloaderTestImpl;
|
||||
import org.schabi.newpipe.extractor.Extractor;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
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.services.bandcamp.extractors.BandcampRadioStreamExtractor;
|
||||
import org.schabi.newpipe.extractor.services.bandcamp.extractors.BandcampStreamExtractor;
|
||||
import org.schabi.newpipe.extractor.stream.StreamExtractor;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -42,9 +41,9 @@ public class BandcampRadioStreamExtractorTest {
|
|||
assertEquals("Sound Movements", e.getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test(expected = ContentNotSupportedException.class)
|
||||
public void testGetUploaderUrl() throws ParsingException {
|
||||
assertEquals("http://bandcamp.com/andrewjervis", e.getUploaderUrl());
|
||||
e.getUploaderUrl();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue