mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07: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:
parent
b8d8862562
commit
4a1c8a7279
19 changed files with 628 additions and 532 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue