2019-01-29 16:04:19 +01:00
|
|
|
package org.schabi.newpipe.extractor.services.media_ccc;
|
|
|
|
|
2021-12-27 21:08:08 +01:00
|
|
|
import org.junit.jupiter.api.BeforeAll;
|
|
|
|
import org.junit.jupiter.api.Test;
|
2020-12-15 15:09:49 +01:00
|
|
|
import org.schabi.newpipe.downloader.DownloaderTestImpl;
|
2019-01-29 16:04:19 +01:00
|
|
|
import org.schabi.newpipe.extractor.NewPipe;
|
|
|
|
import org.schabi.newpipe.extractor.services.media_ccc.extractors.MediaCCCStreamExtractor;
|
|
|
|
import org.schabi.newpipe.extractor.stream.AudioStream;
|
|
|
|
import org.schabi.newpipe.extractor.stream.StreamExtractor;
|
|
|
|
|
2021-12-27 21:08:08 +01:00
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
2019-01-29 16:04:19 +01:00
|
|
|
import static org.schabi.newpipe.extractor.ServiceList.MediaCCC;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test {@link MediaCCCStreamExtractor}
|
|
|
|
*/
|
|
|
|
public class MediaCCCOggTest {
|
2020-04-01 11:40:03 +02:00
|
|
|
// test against https://media.ccc.de/public/events/1317
|
2019-01-29 16:04:19 +01:00
|
|
|
private static StreamExtractor extractor;
|
|
|
|
|
2021-12-27 21:08:08 +01:00
|
|
|
@BeforeAll
|
2019-01-29 16:04:19 +01:00
|
|
|
public static void setUpClass() throws Exception {
|
2019-04-28 22:03:16 +02:00
|
|
|
NewPipe.init(DownloaderTestImpl.getInstance());
|
2019-01-29 16:04:19 +01:00
|
|
|
|
2020-04-01 11:40:03 +02:00
|
|
|
extractor = MediaCCC.getStreamExtractor("https://media.ccc.de/public/events/1317");
|
2019-01-29 16:04:19 +01:00
|
|
|
extractor.fetchPage();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getAudioStreamsCount() throws Exception {
|
|
|
|
assertEquals(1, extractor.getAudioStreams().size());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getAudioStreamsContainOgg() throws Exception {
|
2020-02-08 23:58:46 +01:00
|
|
|
for (AudioStream stream : extractor.getAudioStreams()) {
|
2019-07-30 20:53:23 +02:00
|
|
|
assertEquals("OGG", stream.getFormat().toString());
|
2019-01-29 16:04:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|