still can't get audio to play properly

This commit is contained in:
0x01fe committed 2025-01-16 22:44:04 -06:00
1 parent 6897b684ee
commit 270ab6799b
3 files changed
+84 -16

No files matched your search

+17 -1
View File
@@ -232,7 +232,23 @@ class SubpyConn:
payload['id'] = song_id
return requests.get(url + self._encodePayload(payload))
return requests.get(url + self._encodePayload(payload), stream=True)
def getSong(self, song_id: str) -> Song:
url = self.base_url + '/rest/getSong?'
payload = self._getBasePayload()
payload['id'] = song_id
r = requests.get(url + self._encodePayload(payload))
xml_data = r.content.decode('utf-8')
root = xml.etree.ElementTree.fromstring(xml_data)
for item in root.iter():
if item.tag == '{http://subsonic.org/restapi}song':
return Song(dict(item.items()))
conn = SubpyConn(u, p, "https://music.0x01fe.net")