update audio dept. to use TotemPlParser for internet radio streams

workspace
Brendan Howell 3 years ago
parent e97f66320f
commit 4ff85d5f41

@ -1,3 +1,5 @@
import urllib.request
import kode256 import kode256
import requests import requests
import gi import gi
@ -36,6 +38,8 @@ class Audio(Bureau):
self.log.debug("looking up shortcode " + shortcode) self.log.debug("looking up shortcode " + shortcode)
pl_url = self.urldb.get(shortcode) pl_url = self.urldb.get(shortcode)
self.log.debug(" playing url " + pl_url) self.log.debug(" playing url " + pl_url)
pl_file, _ = urllib.request.urlretrieve(pl_url)
pl_file= "file://" + pl_file
parser = TotemPlParser.Parser() parser = TotemPlParser.Parser()
urls = [] urls = []
@ -44,7 +48,7 @@ class Audio(Bureau):
# and for now-playing # and for now-playing
urls.append(uri) urls.append(uri)
parser.connect("entry-parsed", parsercb, urls) parser.connect("entry-parsed", parsercb, urls)
parser.parse(pl_url, True) parser.parse(pl_file, false)
for url in urls: for url in urls:
print("stream uri", url) print("stream uri", url)

Loading…
Cancel
Save