mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
Merge pull request #952 from Sworddragon/master
Fixed getting the correct filename
This commit is contained in:
commit
d9fe52eea6
|
@ -82,11 +82,8 @@ work_dir = root_dir + "scripts/work"
|
|||
def fetch_file(url):
|
||||
try:
|
||||
print("trying %s" % url)
|
||||
real_url = url_lib.urlopen(url).geturl()
|
||||
local = real_url.split("/")
|
||||
local = local[len(local)-1].split("?")
|
||||
local = local[0]
|
||||
url_lib.urlretrieve(real_url, local)
|
||||
local = dict(url_lib.urlopen(url).info())['content-disposition'].split('=')[1]
|
||||
url_lib.urlretrieve(url, local)
|
||||
return local
|
||||
except:
|
||||
return False
|
||||
|
|
|
@ -50,11 +50,8 @@ if platform == 'osx':
|
|||
def fetch_file(url):
|
||||
try:
|
||||
print("trying %s" % url)
|
||||
real_url = url_lib.urlopen(url).geturl()
|
||||
local = real_url.split("/")
|
||||
local = local[len(local)-1].split("?")
|
||||
local = local[0]
|
||||
url_lib.urlretrieve(real_url, local)
|
||||
local = dict(url_lib.urlopen(url).info())['content-disposition'].split('=')[1]
|
||||
url_lib.urlretrieve(url, local)
|
||||
return local
|
||||
except:
|
||||
return False
|
||||
|
|
Loading…
Reference in a new issue