target might be in current folder
This commit is contained in:
parent
02458e86ec
commit
bab08369b9
1 changed files with 2 additions and 1 deletions
|
@ -113,7 +113,8 @@ get_url = read_url
|
||||||
def save_url(url, filename, overwrite=False):
|
def save_url(url, filename, overwrite=False):
|
||||||
if not os.path.exists(filename) or overwrite:
|
if not os.path.exists(filename) or overwrite:
|
||||||
dirname = os.path.dirname(filename)
|
dirname = os.path.dirname(filename)
|
||||||
os.makedirs(dirname, exist_ok=True)
|
if dirname:
|
||||||
|
os.makedirs(dirname, exist_ok=True)
|
||||||
headers = DEFAULT_HEADERS.copy()
|
headers = DEFAULT_HEADERS.copy()
|
||||||
r = requests.get(url, headers=headers, stream=True)
|
r = requests.get(url, headers=headers, stream=True)
|
||||||
filename_tmp = filename + '~'
|
filename_tmp = filename + '~'
|
||||||
|
|
Loading…
Reference in a new issue