mirror of
https://github.com/Syncplay/syncplay
synced 2025-01-24 15:53:23 +00:00
Fixes server list retrieval
This commit is contained in:
parent
111976faf9
commit
ff08eecf02
@ -371,14 +371,15 @@ def open_system_file_browser(path):
|
|||||||
|
|
||||||
def getListOfPublicServers():
|
def getListOfPublicServers():
|
||||||
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"]})
|
'language': syncplay.messages.messages["CURRENT"]})
|
||||||
f = urllib.request.urlopen(constants.SYNCPLAY_PUBLIC_SERVER_LIST_URL.format(params))
|
f = urllib.request.urlopen(constants.SYNCPLAY_PUBLIC_SERVER_LIST_URL.format(params))
|
||||||
response = f.read()
|
response = f.read()
|
||||||
|
response = response.decode('utf-8')
|
||||||
response = response.replace("<p>","").replace("</p>","").replace("<br />","").replace("“","'").replace("”","'").replace(":’","'").replace("’","'").replace("′","'").replace("\n","").replace("\r","") # Fix Wordpress
|
response = response.replace("<p>","").replace("</p>","").replace("<br />","").replace("“","'").replace("”","'").replace(":’","'").replace("’","'").replace("′","'").replace("\n","").replace("\r","") # Fix Wordpress
|
||||||
response = ast.literal_eval(response)
|
response = ast.literal_eval(response)
|
||||||
|
|
||||||
if response:
|
if response:
|
||||||
return response
|
return response
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user