Skip to content

Commit

Permalink
Merge pull request #333 from wb9688/playerresponse-dashmanifesturl
Browse files Browse the repository at this point in the history
Extract dashManifestUrl in playerResponse
  • Loading branch information
TobiGr authored May 28, 2020
2 parents 0f8057a + 7ef3e80 commit 0b4977b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,9 @@ public String getDashMpdUrl() throws ParsingException {
assertPageFetched();
try {
String dashManifestUrl;
if (videoInfoPage.containsKey("dashmpd")) {
if (playerResponse.getObject("streamingData").isString("dashManifestUrl")) {
return playerResponse.getObject("streamingData").getString("dashManifestUrl");
} else if (videoInfoPage.containsKey("dashmpd")) {
dashManifestUrl = videoInfoPage.get("dashmpd");
} else if (playerArgs != null && playerArgs.isString("dashmpd")) {
dashManifestUrl = playerArgs.getString("dashmpd", EMPTY_STRING);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ public void testStreamType() throws ParsingException {

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

@Test
Expand Down

0 comments on commit 0b4977b

Please sign in to comment.