Support youtu.be urls in _from_url

This commit is contained in:
jesopo 2019-07-31 11:58:08 +01:00
parent dd8b276b35
commit 10b7875544

View file

@ -85,7 +85,9 @@ class Module(ModuleManager.BaseModule):
parsed = urllib.parse.urlparse(url) parsed = urllib.parse.urlparse(url)
query = urllib.parse.parse_qs(parsed.query) query = urllib.parse.parse_qs(parsed.query)
if parsed.path == "/watch" and "v" in query: if parsed.hostname == "youtu.be" amd parsed.path:
return self.video_details(parsed.path[1:])
elif parsed.path == "/watch" and "v" in query:
return self.video_details(query["v"][0]) return self.video_details(query["v"][0])
elif parsed.path == "/playlist" and "list" in query: elif parsed.path == "/playlist" and "list" in query:
return self.playlist_details(query["list"][0]) return self.playlist_details(query["list"][0])