Merge branch 'url_info' of https://github.com/rosynirvana/you-get into rosynirvana-url_info (close #1942)

This commit is contained in:
Mort Yao 2017-05-06 20:47:19 +02:00
commit 7d6f68a159
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251

View File

@ -479,6 +479,9 @@ def url_locations(urls, faker = False, headers = {}):
return locations return locations
def url_save(url, filepath, bar, refer = None, is_part = False, faker = False, headers = {}, timeout = None, **kwargs): def url_save(url, filepath, bar, refer = None, is_part = False, faker = False, headers = {}, timeout = None, **kwargs):
#When a referer specified with param refer, the key must be 'Referer' for the hack here
if refer is not None:
headers['Referer'] = refer
file_size = url_size(url, faker = faker, headers = headers) file_size = url_size(url, faker = faker, headers = headers)
if os.path.exists(filepath): if os.path.exists(filepath):