Fixed all audio methods due to latest VK changes

This commit is contained in:
2019-04-16 15:45:25 -05:00
parent 5f224a077c
commit 4f3bb6ac93
4 changed files with 20 additions and 5 deletions

View File

@@ -14,6 +14,7 @@ from sound_lib.main import BassError
from pubsub import pub
from mysc.repeating_timer import RepeatingTimer
from mysc.thread_utils import call_threaded
from sessionmanager import utils
player = None
log = logging.getLogger("player")
@@ -76,10 +77,11 @@ class audioPlayer(object):
if self.is_working == False:
self.is_working = True
# Let's encode the URL as bytes if on Python 3
url_ = bytes(object["url"], "utf-8")
url_ = utils.transform_audio_url(object["url"])
url_ = bytes(url_, "utf-8")
try:
self.stream = URLStream(url=url_)
except IndexError:
except:
log.error("Unable to play URL %s" % (url_))
return
# Translators: {0} will be replaced with a song's title and {1} with the artist.
@@ -186,5 +188,4 @@ class audioPlayer(object):
if self.stream != None and self.stream.is_playing == False:
return False
else:
return True
return True