Skip to content

Commit 2b944fe

Browse files
committed
Added fallback for videoId
1 parent 33c0bea commit 2b944fe

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ public boolean isAd() throws ParsingException {
6161
@Override
6262
public String getUrl() throws ParsingException {
6363
try {
64-
final String videoId = lockupViewModel.getString("contentId");
64+
String videoId = lockupViewModel.getString("contentId");
65+
if (isNullOrEmpty(videoId)) {
66+
videoId = JsonUtils.getString(lockupViewModel,
67+
"rendererContext.commandContext.onTap.innertubeCommand.watchEndpoint.videoId");
68+
}
6569
return YoutubeStreamLinkHandlerFactory.getInstance().getUrl(videoId);
6670
} catch (final Exception e) {
6771
throw new ParsingException("Could not get url", e);

0 commit comments

Comments
 (0)