Skip to content

Commit a78ad16

Browse files
committed
rebase correctly
1 parent b40a1f3 commit a78ad16

3 files changed

Lines changed: 8 additions & 44 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamExtractor.java

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.schabi.newpipe.extractor.stream;
22

33
/*
4-
* Created by Christian Schabesberger on 10.08.15.
4+
* Created by Christian Schabesberger on 10.08.18.
55
*
66
* Copyright (C) Christian Schabesberger 2016 <chris.schabesberger@mailbox.org>
77
* StreamExtractor.java is part of NewPipe.
@@ -211,19 +211,20 @@ public StreamExtractor(StreamingService service, LinkHandler linkHandler, Locali
211211
* @throws ExtractionException
212212
*/
213213
@Nonnull
214-
public abstract List<Subtitles> getSubtitlesDefault() throws IOException, ExtractionException;
214+
public abstract List<SubtitlesStream> getSubtitlesDefault() throws IOException, ExtractionException;
215215

216216
/**
217217
* This will return a list of available
218218
* <a href="https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/stream/Subtitles.html">Subtitles</a>s.
219219
* given by a specific type.
220220
* If no subtitles in that specific format are available an empty list can returned.
221+
* @param format the media format by which the subtitles should be filtered
221222
* @return a list of available subtitles or an empty list
222223
* @throws IOException
223224
* @throws ExtractionException
224225
*/
225226
@Nonnull
226-
public abstract List<Subtitles> getSubtitles(SubtitlesFormat format) throws IOException, ExtractionException;
227+
public abstract List<SubtitlesStream> getSubtitles(MediaFormat format) throws IOException, ExtractionException;
227228

228229
/**
229230
* Get the <a href="https://teamnewpipe.github.io/NewPipeExtractor/javadoc/">StreamType</a>.
@@ -317,42 +318,4 @@ protected long getTimestampSeconds(String regexPattern) throws ParsingException
317318
return 0;
318319
}
319320
}
320-
321-
public abstract long getViewCount() throws ParsingException;
322-
public abstract long getLikeCount() throws ParsingException;
323-
public abstract long getDislikeCount() throws ParsingException;
324-
325-
@Nonnull
326-
public abstract String getUploaderUrl() throws ParsingException;
327-
@Nonnull
328-
public abstract String getUploaderName() throws ParsingException;
329-
@Nonnull
330-
public abstract String getUploaderAvatarUrl() throws ParsingException;
331-
332-
/**
333-
* Get the dash mpd url
334-
* @return the url as a string or an empty string
335-
* @throws ParsingException if an error occurs while reading
336-
*/
337-
@Nonnull public abstract String getDashMpdUrl() throws ParsingException;
338-
@Nonnull public abstract String getHlsUrl() throws ParsingException;
339-
public abstract List<AudioStream> getAudioStreams() throws IOException, ExtractionException;
340-
public abstract List<VideoStream> getVideoStreams() throws IOException, ExtractionException;
341-
public abstract List<VideoStream> getVideoOnlyStreams() throws IOException, ExtractionException;
342-
343-
@Nonnull
344-
public abstract List<SubtitlesStream> getSubtitlesDefault() throws IOException, ExtractionException;
345-
@Nonnull
346-
public abstract List<SubtitlesStream> getSubtitles(MediaFormat format) throws IOException, ExtractionException;
347-
348-
public abstract StreamType getStreamType() throws ParsingException;
349-
public abstract StreamInfoItem getNextVideo() throws IOException, ExtractionException;
350-
public abstract StreamInfoItemsCollector getRelatedVideos() throws IOException, ExtractionException;
351-
352-
/**
353-
* Analyses the webpage's document and extracts any error message there might be.
354-
*
355-
* @return Error message; null if there is no error message.
356-
*/
357-
public abstract String getErrorMessage();
358321
}

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractorDefaultTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import org.junit.BeforeClass;
44
import org.junit.Test;
55
import org.schabi.newpipe.Downloader;
6+
import org.schabi.newpipe.extractor.MediaFormat;
67
import org.schabi.newpipe.extractor.NewPipe;
78
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
89
import org.schabi.newpipe.extractor.exceptions.ParsingException;
@@ -164,7 +165,7 @@ public void testGetSubtitlesListDefault() throws IOException, ExtractionExceptio
164165
@Test
165166
public void testGetSubtitlesList() throws IOException, ExtractionException {
166167
// Video (/view?v=YQHsXMglC9A) set in the setUp() method has no captions => null
167-
assertTrue(extractor.getSubtitles(SubtitlesFormat.TTML).isEmpty());
168+
assertTrue(extractor.getSubtitles(MediaFormat.TTML).isEmpty());
168169
}
169170
}
170171

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/search/YoutubeSearchExtractorDefaultTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ public void testGetSecondPageUrl() throws Exception {
6262

6363
@Test
6464
public void testResultList_FirstElement() {
65-
InfoItem firstInfoItem = itemsPage.getItems().get(0);
65+
InfoItem firstInfoItem = itemsPage.getItems().get(1);
6666

67-
// THe channel should be the first item
67+
// The channel should be the first item
6868
assertTrue(firstInfoItem instanceof ChannelInfoItem);
6969
assertEquals("name", "PewDiePie", firstInfoItem.getName());
7070
assertEquals("url","https://www.youtube.com/user/PewDiePie", firstInfoItem.getUrl());

0 commit comments

Comments
 (0)