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):
|
def fetch_file(url):
|
||||||
try:
|
try:
|
||||||
print("trying %s" % url)
|
print("trying %s" % url)
|
||||||
real_url = url_lib.urlopen(url).geturl()
|
local = dict(url_lib.urlopen(url).info())['content-disposition'].split('=')[1]
|
||||||
local = real_url.split("/")
|
url_lib.urlretrieve(url, local)
|
||||||
local = local[len(local)-1].split("?")
|
|
||||||
local = local[0]
|
|
||||||
url_lib.urlretrieve(real_url, local)
|
|
||||||
return local
|
return local
|
||||||
except:
|
except:
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -50,11 +50,8 @@ if platform == 'osx':
|
||||||
def fetch_file(url):
|
def fetch_file(url):
|
||||||
try:
|
try:
|
||||||
print("trying %s" % url)
|
print("trying %s" % url)
|
||||||
real_url = url_lib.urlopen(url).geturl()
|
local = dict(url_lib.urlopen(url).info())['content-disposition'].split('=')[1]
|
||||||
local = real_url.split("/")
|
url_lib.urlretrieve(url, local)
|
||||||
local = local[len(local)-1].split("?")
|
|
||||||
local = local[0]
|
|
||||||
url_lib.urlretrieve(real_url, local)
|
|
||||||
return local
|
return local
|
||||||
except:
|
except:
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in a new issue