Fix metadata fetch logic issues and typos
This commit is contained in:
parent
9abbebedb0
commit
1440c5bdb6
@ -29,10 +29,10 @@ def filter_query_params(url, allowed=[]):
|
||||
def get_youtube_dl_metadata(url, ydl = youtube_dl.YoutubeDL()):
|
||||
if urlsplit(url).scheme == "":
|
||||
return None
|
||||
if urlsplit(url).netloc.lower() in ("www.youtube.com", "youtube.com", "youtub.be"):
|
||||
if urlsplit(url).netloc.lower() in ("www.youtube.com", "youtube.com", "youtu.be"):
|
||||
#Stop it from doing the whole playlist
|
||||
url = filter_query_params(url, allowed=["v"])
|
||||
if urlsplit(url).scheme == "ytdl":
|
||||
elif urlsplit(url).scheme == "ytdl":
|
||||
url = f"https://youtube.com/watch?v={urlsplit(url).netloc}"
|
||||
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user