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
Prev Previous commit
check for valid canonical URL
The video_id "live_stream" is not a live stream id
  • Loading branch information
Billy2011 committed Oct 19, 2020
commit 7e2d9e76312b59097206ea04d82cc7a96dfa7f86
8 changes: 6 additions & 2 deletions src/streamlink/plugins/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,12 @@ def _find_video_id(self, url):
if link.attributes.get("rel") == "canonical":
canon_link = link.attributes.get("href")
if canon_link != url:
log.debug("Re-directing to canonical URL: {0}".format(canon_link))
return self._find_video_id(canon_link)
if canon_link.endswith("v=live_stream"):
log.debug("The video is not available")
break
else:
log.debug("Re-directing to canonical URL: {0}".format(canon_link))
return self._find_video_id(canon_link)

raise PluginError("Could not find a video on this page")

Expand Down