Skip to content

Commit

Permalink
[PATCH] plugins.youtube: quickfix for "/live" URL
Browse files Browse the repository at this point in the history
before

```
$ streamlink https://www.youtube.com/user/deutschewelleenglish/live -l info
[cli][info] Found matching plugin youtube for URL https://www.youtube.com/user/deutschewelleenglish/live
error: Could not find a video on this page
```

after

```
$ streamlink https://www.youtube.com/user/deutschewelleenglish/live worst -l info
[cli][info] Found matching plugin youtube for URL https://www.youtube.com/user/deutschewelleenglish/live
[cli][info] Available streams: 144p (worst), 240p, 360p, 480p, 720p (best)
[cli][info] Opening stream: 144p (hls)
```
  • Loading branch information
back-to authored and Billy2011 committed Nov 29, 2020
1 parent 75723b1 commit 10c48e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/streamlink/plugins/youtube.py
Expand Up @@ -256,7 +256,7 @@ def _find_video_id(self, url):
log.debug("Video ID from videoRenderer (live)")
return x["videoId"]

if "/embed/live_stream" in url:
if urlparse(url).path.endswith(("/embed/live_stream", "/live")):
for link in itertags(res.text, "link"):
if link.attributes.get("rel") == "canonical":
canon_link = link.attributes.get("href")
Expand Down

0 comments on commit 10c48e5

Please sign in to comment.