Fixed all audio methods due to latest VK changes
This commit is contained in:
@@ -72,4 +72,16 @@ def clean_text(text):
|
||||
""" Clean text, removing all unneeded HTMl and converting HTML represented characters in their unicode counterparts."""
|
||||
text = detect_users(text)
|
||||
text = html.unescape(text)
|
||||
return text
|
||||
return text
|
||||
|
||||
def transform_audio_url(url):
|
||||
""" Transforms the URL offered by VK to the unencrypted stream so we can still play it. """
|
||||
if "vkuseraudio.net" not in url and "index.m3u8" not in url:
|
||||
return url
|
||||
url = url.replace("/index.m3u8", ".mp3")
|
||||
parts = url.split("/")
|
||||
if "/audio" not in url:
|
||||
url = url.replace("/"+parts[-2], "")
|
||||
else:
|
||||
url = url.replace("/"+parts[-3], "")
|
||||
return url
|
Reference in New Issue
Block a user