def open_stream_in_browser(self, event):
stream_url = urlparse(self.stream.url)
netloc = stream_url.netloc
path = stream_url.path
if "twitch" in netloc:
path = stream_url.path + "/chat"
if "youtube" in netloc:
path = path.replace("watch", "live_chat")
correct_url = (stream_url.scheme, netloc, path, stream_url.params, stream_url.query, stream_url.fragment)
url = urlunparse(correct_url)
os = platform.system()
if os == OS.WINDOWS:
os2.startfile(url)
else:
webbrowser.open(url)
评论列表
文章目录