Fixes client updates checker

This commit is contained in:
Alberto Sottile 2018-04-25 18:19:01 +02:00
parent ff08eecf02
commit bac3cf9a7f
1 changed files with 3 additions and 2 deletions

View File

@ -910,12 +910,13 @@ class SyncplayClient(object):
def checkForUpdate(self, userInitiated): def checkForUpdate(self, userInitiated):
try: try:
import urllib.request, urllib.parse, urllib.error, syncplay, sys, messages, json import urllib.request, urllib.parse, urllib.error, syncplay, sys, json
params = urllib.parse.urlencode({'version': syncplay.version, 'milestone': syncplay.milestone, 'release_number': syncplay.release_number, params = urllib.parse.urlencode({'version': syncplay.version, 'milestone': syncplay.milestone, 'release_number': syncplay.release_number,
'language': messages.messages["CURRENT"], 'platform': sys.platform, 'userInitiated': userInitiated}) 'language': syncplay.messages.messages["CURRENT"], 'platform': sys.platform, 'userInitiated': userInitiated})
f = urllib.request.urlopen(constants.SYNCPLAY_UPDATE_URL.format(params)) f = urllib.request.urlopen(constants.SYNCPLAY_UPDATE_URL.format(params))
response = f.read() response = f.read()
response = response.decode('utf-8')
response = response.replace("<p>","").replace("</p>","").replace("<br />","").replace("&#8220;","\"").replace("&#8221;","\"") # Fix Wordpress response = response.replace("<p>","").replace("</p>","").replace("<br />","").replace("&#8220;","\"").replace("&#8221;","\"") # Fix Wordpress
response = json.loads(response) response = json.loads(response)
publicServers = None publicServers = None