From 4ff85d5f418bfa9f4cca40b5dbff87039ca5d3b6 Mon Sep 17 00:00:00 2001 From: Brendan Howell Date: Sat, 2 Oct 2021 21:40:03 +0200 Subject: [PATCH] update audio dept. to use TotemPlParser for internet radio streams --- screenless/bureau/audio/audio.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/screenless/bureau/audio/audio.py b/screenless/bureau/audio/audio.py index 574f542..1144ac1 100644 --- a/screenless/bureau/audio/audio.py +++ b/screenless/bureau/audio/audio.py @@ -1,3 +1,5 @@ +import urllib.request + import kode256 import requests import gi @@ -36,6 +38,8 @@ class Audio(Bureau): self.log.debug("looking up shortcode " + shortcode) pl_url = self.urldb.get(shortcode) self.log.debug(" playing url " + pl_url) + pl_file, _ = urllib.request.urlretrieve(pl_url) + pl_file= "file://" + pl_file parser = TotemPlParser.Parser() urls = [] @@ -44,7 +48,7 @@ class Audio(Bureau): # and for now-playing urls.append(uri) parser.connect("entry-parsed", parsercb, urls) - parser.parse(pl_url, True) + parser.parse(pl_file, false) for url in urls: print("stream uri", url)