From eb4301aeb5277d818863af106c6a8198a8f2c89c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Cort=C3=A9z?= Date: Wed, 11 Mar 2015 06:11:42 -0600 Subject: [PATCH] Play URL now works with all URL --- src/sound.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/sound.py b/src/sound.py index 4cee3bda..a9bc6aec 100644 --- a/src/sound.py +++ b/src/sound.py @@ -97,13 +97,21 @@ class URLStream(object): def __init__(self): self.url = None self.prepared = False + log.debug("URL Player initialized") def prepare(self, url): + log.debug("Preparing URL: %s" % (url,)) self.prepared = False self.url = url_shortener.unshorten(url) + log.debug("Expanded URL: %s" % (self.url,)) if self.url != None: transformer = audio_services.find_url_transformer(self.url) self.url = transformer(self.url) + log.debug("Transformed URL: %s. Prepared" % (self.url,)) + self.prepared = True + else: + self.url = url + log.debug("Transformed URL: %s. Prepared" % (self.url,)) self.prepared = True def play(self, url, volume=1.0): @@ -111,13 +119,16 @@ class URLStream(object): output.speak(_(u"Stopped")) self.stream.stop() del self.stream + log.debug("Stream stopped") else: output.speak(_(u"Playing...")) + log.debug("Attempting to play an URL...") self.prepare(url) if self.prepared == True: self.stream = sound_lib.stream.URLStream(url=self.url) self.stream.volume = float(volume) self.stream.play() + log.debug("played") @staticmethod def delete_old_tempfiles():