Skip to content

plugins.youtube: fix live playback #3268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
plugins.youtube: fix live playback
Closes #3263
  • Loading branch information
Billy2011 committed Oct 19, 2020
commit 065c580092c51a543431f73794c15a9682f2fd7b
4 changes: 4 additions & 0 deletions src/streamlink/plugins/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ def _find_video_id(self, url):
log.debug("Video ID from currentVideoEndpoint")
return video_id
for x in search_dict(data, 'videoRenderer'):
if x.get("viewCountText", {}).get("runs"):
if x.get("videoId"):
log.debug("Video ID from videoRenderer (live)")
return x["videoId"]
for bstyle in search_dict(x.get("badges", {}), "style"):
if bstyle == "BADGE_STYLE_TYPE_LIVE_NOW":
if x.get("videoId"):
Expand Down