diff --git a/.gitignore b/.gitignore index 50cc9d4..7628e4d 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,6 @@ nohup.out # currently not using /screenshot*.png -/proxyscrobble.py # only for development, normally external /doreah diff --git a/database.py b/database.py index adca465..3daa304 100644 --- a/database.py +++ b/database.py @@ -119,7 +119,6 @@ def createScrobble(artists,title,time,volatile=False): proxy_scrobble(artists,title,time) - return get_track_dict(TRACKS[obj.track]) diff --git a/external.py b/external.py index 6e5e6ad..04915a6 100644 --- a/external.py +++ b/external.py @@ -4,6 +4,7 @@ import base64 from doreah.settings import get_settings from doreah.logging import log import hashlib +import xml.etree.ElementTree as ET ### PICTURES @@ -173,3 +174,9 @@ def proxy_scrobble(artists,title,timestamp): for api in apis_scrobble: response = urllib.request.urlopen(api["scrobbleurl"],data=utf(api["requestbody"](artists,title,timestamp))) xml = response.read() + data = ET.fromstring(xml) + if data.attrib.get("status") == "ok": + if data.find("scrobbles").attrib.get("ignored") == "0": + log(api["name"] + ": Scrobble accepted: " + "/".join(artists) + " - " + title) + else: + log(api["name"] + ": Scrobble not accepted: " + "/".join(artists) + " - " + title)