mirror of
https://github.com/nichkara/InfinitumBotty.git
synced 2026-06-11 14:41:58 +02:00
fix titles with react attributes
This commit is contained in:
@@ -53,7 +53,7 @@ class TitleObserver(PrivMsgObserverPrototype):
|
|||||||
'''"results":{"contents":\[{"videoPrimaryInfoRenderer":{"title":{"runs":\[{"text":"([^"]*)"'''
|
'''"results":{"contents":\[{"videoPrimaryInfoRenderer":{"title":{"runs":\[{"text":"([^"]*)"'''
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
title_re = re.compile("<title>(.+?)</title>")
|
title_re = re.compile("<title[^>]*>(.+?)</title>")
|
||||||
|
|
||||||
req = urllib.request.Request(url, None, headers)
|
req = urllib.request.Request(url, None, headers)
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ class TitleObserver(PrivMsgObserverPrototype):
|
|||||||
if title_matches:
|
if title_matches:
|
||||||
title = title_matches.group(1)
|
title = title_matches.group(1)
|
||||||
else:
|
else:
|
||||||
#with open("content.html", "w") as file:
|
# with open("content.html", "w") as file:
|
||||||
# file.write(content)
|
# file.write(content)
|
||||||
raise Exception("Could not Parse Title for {}".format(url))
|
raise Exception("Could not Parse Title for {}".format(url))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user