File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import org .schabi .newpipe .extractor .StreamingService ;
66import org .schabi .newpipe .extractor .channel .ChannelExtractor ;
77import org .schabi .newpipe .extractor .downloader .Downloader ;
8+ import org .schabi .newpipe .extractor .exceptions .ContentNotSupportedException ;
89import org .schabi .newpipe .extractor .exceptions .ExtractionException ;
910import org .schabi .newpipe .extractor .exceptions .ParsingException ;
1011import org .schabi .newpipe .extractor .linkhandler .ListLinkHandler ;
@@ -310,7 +311,7 @@ private JsonObject getVideoTab() throws ParsingException {
310311 }
311312
312313 if (videoTab == null ) {
313- throw new ParsingException ( "Could not find Videos tab" );
314+ throw new ContentNotSupportedException ( "This channel has no Videos tab" );
314315 }
315316
316317 try {
Original file line number Diff line number Diff line change 55import org .schabi .newpipe .DownloaderTestImpl ;
66import org .schabi .newpipe .extractor .NewPipe ;
77import org .schabi .newpipe .extractor .channel .ChannelExtractor ;
8- import org .schabi .newpipe .extractor .channel .ChannelInfo ;
98import org .schabi .newpipe .extractor .exceptions .ContentNotAvailableException ;
9+ import org .schabi .newpipe .extractor .exceptions .ContentNotSupportedException ;
10+ import org .schabi .newpipe .extractor .exceptions .ExtractionException ;
1011import org .schabi .newpipe .extractor .exceptions .ParsingException ;
1112import org .schabi .newpipe .extractor .services .BaseChannelExtractorTest ;
1213import org .schabi .newpipe .extractor .services .youtube .extractors .YoutubeChannelExtractor ;
1314
14- import java .util . List ;
15+ import java .io . IOException ;
1516
1617import static org .junit .Assert .*;
1718import static org .schabi .newpipe .extractor .ExtractorAsserts .assertEmpty ;
@@ -45,6 +46,20 @@ public void nonExistentFetch() throws Exception {
4546 }
4647 }
4748
49+ public static class NotSupported {
50+ @ BeforeClass
51+ public static void setUp () {
52+ NewPipe .init (DownloaderTestImpl .getInstance ());
53+ }
54+
55+ @ Test (expected = ContentNotSupportedException .class )
56+ public void noVideoTab () throws Exception {
57+ final ChannelExtractor extractor = YouTube .getChannelExtractor ("https://invidio.us/channel/UC-9-kyTW8ZkZNDHQJ6FgpwQ" );
58+ extractor .fetchPage ();
59+ extractor .getInitialPage ();
60+ }
61+ }
62+
4863 public static class Gronkh implements BaseChannelExtractorTest {
4964 private static YoutubeChannelExtractor extractor ;
5065
You can’t perform that action at this time.
0 commit comments