Skip to content

Commit 0b4977b

Browse files
authored
Merge pull request #333 from wb9688/playerresponse-dashmanifesturl
Extract dashManifestUrl in playerResponse
2 parents 0f8057a + 7ef3e80 commit 0b4977b

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,9 @@ public String getDashMpdUrl() throws ParsingException {
377377
assertPageFetched();
378378
try {
379379
String dashManifestUrl;
380-
if (videoInfoPage.containsKey("dashmpd")) {
380+
if (playerResponse.getObject("streamingData").isString("dashManifestUrl")) {
381+
return playerResponse.getObject("streamingData").getString("dashManifestUrl");
382+
} else if (videoInfoPage.containsKey("dashmpd")) {
381383
dashManifestUrl = videoInfoPage.get("dashmpd");
382384
} else if (playerArgs != null && playerArgs.isString("dashmpd")) {
383385
dashManifestUrl = playerArgs.getString("dashmpd", EMPTY_STRING);

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/stream/YoutubeStreamExtractorLivestreamTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ public void testStreamType() throws ParsingException {
116116

117117
@Test
118118
public void testGetDashMpd() throws ParsingException {
119-
// we dont expect this particular video to have a DASH file. For this purpouse we use a different test class.
120-
assertTrue(extractor.getDashMpdUrl(), extractor.getDashMpdUrl().isEmpty());
119+
assertTrue(extractor.getDashMpdUrl().startsWith("https://manifest.googlevideo.com/api/manifest/dash/"));
121120
}
122121

123122
@Test

0 commit comments

Comments
 (0)