1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Fixed strange issue with urllib trying to connect on IPv4

This commit is contained in:
Krateng
2019-02-15 15:18:57 +01:00
parent d481746514
commit 3a06123255
7 changed files with 21 additions and 19 deletions

View File

@@ -12,13 +12,13 @@ def replacedict(keys,dbport):
imgurl = info.get("image")
desc = info.get("info")
response = urllib.request.urlopen("http://localhost:" + str(dbport) + "/trackinfo?" + keysToUrl(limitkeys))
response = urllib.request.urlopen("http://[::1]:" + str(dbport) + "/trackinfo?" + keysToUrl(limitkeys))
db_data = json.loads(response.read())
scrobblesnum = str(db_data["scrobbles"])
pos = "#" + str(db_data["position"])
response = urllib.request.urlopen("http://localhost:" + str(dbport) + "/scrobbles?" + keysToUrl(limitkeys))
response = urllib.request.urlopen("http://[::1]:" + str(dbport) + "/scrobbles?" + keysToUrl(limitkeys))
db_data = json.loads(response.read())
scrobbles = db_data["list"]