2525import org .junit .jupiter .api .BeforeAll ;
2626import org .junit .jupiter .api .Test ;
2727import org .junit .jupiter .api .function .Executable ;
28- import org .schabi .newpipe .downloader .DownloaderFactory ;
28+ import org .schabi .newpipe .downloader .DownloaderTestImpl ;
2929import org .schabi .newpipe .extractor .NewPipe ;
3030import org .schabi .newpipe .extractor .exceptions .ExtractionException ;
3131import org .schabi .newpipe .extractor .services .youtube .dashmanifestcreator .YoutubeOtfDashManifestCreator ;
3838import org .schabi .newpipe .extractor .streamdata .stream .Stream ;
3939import org .schabi .newpipe .extractor .streamdata .stream .VideoAudioStream ;
4040import org .schabi .newpipe .extractor .streamdata .stream .VideoStream ;
41- import org .schabi .newpipe .extractor .streamdata .stream .quality .VideoQualityData ;
4241import org .w3c .dom .Document ;
4342import org .w3c .dom .Element ;
4443import org .w3c .dom .NodeList ;
4847import java .util .ArrayList ;
4948import java .util .Arrays ;
5049import java .util .Collection ;
51- import java .util .LinkedHashMap ;
5250import java .util .List ;
53- import java .util .Map ;
5451import java .util .stream .Collectors ;
5552import java .util .stream .IntStream ;
5653
@@ -93,15 +90,14 @@ class YoutubeDashManifestCreatorsTest {
9390 private static final int MAX_STREAMS_TO_TEST_PER_METHOD = 5 ;
9491 private static final String URL = "https://www.youtube.com/watch?v=DJ8GQUNUXGM" ;
9592
96- private static final String RESOURCE_PATH =
97- DownloaderFactory .RESOURCE_PATH + "services/youtube/extractor/dashmanifest/" ;
98-
9993 private static YoutubeStreamExtractor extractor ;
10094
10195 @ BeforeAll
10296 public static void setUp () throws Exception {
10397 YoutubeTestsUtils .ensureStateless ();
104- NewPipe .init (DownloaderFactory .getDownloader (RESOURCE_PATH ));
98+ // Has to be done with a real downloader otherwise because there are secondary requests when
99+ // building a DASHManifest which require valid requests with a real IP
100+ NewPipe .init (DownloaderTestImpl .getInstance ());
105101
106102 extractor = (YoutubeStreamExtractor ) YouTube .getStreamExtractor (URL );
107103 extractor .fetchPage ();
@@ -116,7 +112,7 @@ void testVideoOnlyStreams() throws ExtractionException {
116112
117113 @ Test
118114 void testVideoStreams () throws ExtractionException {
119- List <VideoAudioStream > videoAudioStreams = getDashStreams (extractor .getVideoStreams ());
115+ final List <VideoAudioStream > videoAudioStreams = getDashStreams (extractor .getVideoStreams ());
120116 assertEquals (0 , videoAudioStreams .size (), "There should be no dash streams for video-audio streams" );
121117 }
122118
0 commit comments