Added method to download subtitles as VTT
This commit is contained in:
@@ -105,6 +105,6 @@ public class SoundcloudStreamExtractorDefaultTest {
|
||||
|
||||
@Test
|
||||
public void testGetSubtitles() throws IOException, ExtractionException, JsonParserException {
|
||||
assertTrue(extractor.getSubtitles() != null);
|
||||
assertTrue(extractor.getSubtitlesList() != null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +152,18 @@ public class YoutubeStreamExtractorDefaultTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetSubtitles() throws IOException, ExtractionException, JsonParserException {
|
||||
assertTrue(extractor.getSubtitles() != null);
|
||||
public void testGetSubtitlesList() throws IOException, ExtractionException, JsonParserException {
|
||||
assertTrue(extractor.getSubtitlesList() != null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDownloadSubtitles() throws Exception {
|
||||
try {
|
||||
extractor.downloadSubtitles(extractor.getSubtitlesList().get("en")[0]);
|
||||
// Video has no subtitles!
|
||||
assert false;
|
||||
} catch (Exception e) {
|
||||
assert true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,12 @@ public class YoutubeStreamExtractorRestrictedTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetSubtitles() throws IOException, ExtractionException, JsonParserException {
|
||||
assertTrue(extractor.getSubtitles() != null);
|
||||
public void testGetSubtitlesList() throws IOException, ExtractionException, JsonParserException {
|
||||
assertTrue(extractor.getSubtitlesList() != null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDownloadSubtitles() throws Exception {
|
||||
assertTrue(extractor.downloadSubtitles("https://youtu.be/FmG385_uUys?t=174") != null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user