style format
This commit is contained in:
parent
4f8da680d6
commit
de40a7468e
|
@ -34,7 +34,9 @@ class YouTube:
|
|||
return str.startswith("https://music.youtube.com/watch?v=")
|
||||
|
||||
def is_ytshorts(str):
|
||||
return str.startswith("https://youtube.com/shorts/") or str.startswith("https://www.youtube.com/shorts/")
|
||||
return str.startswith("https://youtube.com/shorts/") or str.startswith(
|
||||
"https://www.youtube.com/shorts/"
|
||||
)
|
||||
|
||||
class parseprop(HTMLParser):
|
||||
def handle_starttag(self, tag, attrs):
|
||||
|
@ -75,10 +77,11 @@ class YouTube:
|
|||
url = f"https://www.youtube.com/watch?v={videoId}"
|
||||
if self.is_ytmusic(url):
|
||||
for i in url.split("?")[1].split("&"):
|
||||
if i[0:2]=="v=": videoId=i[2:]
|
||||
if i[0:2] == "v=":
|
||||
videoId = i[2:]
|
||||
url = f"https://www.youtube.com/watch?v={videoId}"
|
||||
if self.is_ytshorts(url):
|
||||
videoId=url.split("?")[0].split("/")[-1]
|
||||
videoId = url.split("?")[0].split("/")[-1]
|
||||
url = f"https://www.youtube.com/watch?v={videoId}"
|
||||
global y, z
|
||||
y, z = {}, {}
|
||||
|
|
Loading…
Reference in New Issue