mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-02 05:38:06 -06:00
- Search engine now supports category-based requests (only Mininova engine for now but the rest is coming soon)
- Updated "buy it" icon
This commit is contained in:
@@ -64,15 +64,15 @@ def retrieve_url(url):
|
||||
return dat.encode('utf-8', 'replace')
|
||||
|
||||
def download_file(url):
|
||||
""" Download file at url and write it to a file, return the path to the file and the url """
|
||||
file, path = tempfile.mkstemp()
|
||||
file = os.fdopen(file, "wb")
|
||||
# Download url
|
||||
req = urllib2.Request(url)
|
||||
response = urllib2.urlopen(req)
|
||||
dat = response.read()
|
||||
# Write it to a file
|
||||
file.write(dat)
|
||||
file.close()
|
||||
# return file path
|
||||
return path+" "+url
|
||||
""" Download file at url and write it to a file, return the path to the file and the url """
|
||||
file, path = tempfile.mkstemp()
|
||||
file = os.fdopen(file, "wb")
|
||||
# Download url
|
||||
req = urllib2.Request(url)
|
||||
response = urllib2.urlopen(req)
|
||||
dat = response.read()
|
||||
# Write it to a file
|
||||
file.write(dat)
|
||||
file.close()
|
||||
# return file path
|
||||
return path+" "+url
|
||||
|
||||
Reference in New Issue
Block a user