mirror of
https://github.com/nichkara/InfinitumBotty.git
synced 2026-06-11 06:36:24 +02:00
fix titleObserver
This commit is contained in:
@@ -44,9 +44,13 @@ class TitleObserver(PrivMsgObserverPrototype):
|
|||||||
raise (Exception("Refusing to parse bare IPv4 Addresses"))
|
raise (Exception("Refusing to parse bare IPv4 Addresses"))
|
||||||
if re.search("https?://music.youtube.com/", url):
|
if re.search("https?://music.youtube.com/", url):
|
||||||
url = url.replace("music.youtube.com/", "www.youtube.com/", 1)
|
url = url.replace("music.youtube.com/", "www.youtube.com/", 1)
|
||||||
|
if re.search("https?://youtu.be/", url):
|
||||||
|
url = url.replace("youtu.be/", "www.youtube.com/watch?v=", 1)
|
||||||
|
|
||||||
if re.search("https?://[^/]*youtube.com/shorts/", url):
|
if re.search("https?://[^/]*youtube.com/shorts/", url):
|
||||||
title_re = re.compile('''"reelPlayerHeaderRenderer":{"reelTitleText":{"runs":\[{"text":"([^"]*)"''')
|
title_re = re.compile(
|
||||||
|
'''"reelPlayerHeaderRenderer":{"reelTitleText":{"runs":\[{"text":"([^"]*)"'''
|
||||||
|
)
|
||||||
headers["User-Agent"] = "curl/7.81.0"
|
headers["User-Agent"] = "curl/7.81.0"
|
||||||
elif re.search("https?://[^/]*youtube.com/", url):
|
elif re.search("https?://[^/]*youtube.com/", url):
|
||||||
title_re = re.compile(
|
title_re = re.compile(
|
||||||
|
|||||||
Reference in New Issue
Block a user