mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-22 01:06:03 +03:00
parent
1903ddada1
commit
dd34c85884
1 changed files with 3 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
#VERSION: 1.45
|
||||
#VERSION: 1.46
|
||||
|
||||
# Author:
|
||||
# Christophe DUMEZ (chris@qbittorrent.org)
|
||||
|
@ -87,9 +87,9 @@ def htmlentitydecode(s):
|
|||
return re.sub(r'&#x(\w+);', lambda x: chr(int(x.group(1), 16)), t)
|
||||
|
||||
|
||||
def retrieve_url(url):
|
||||
def retrieve_url(url, custom_headers={}):
|
||||
""" Return the content of the url page as a string """
|
||||
req = urllib.request.Request(url, headers=headers)
|
||||
req = urllib.request.Request(url, headers={**headers, **custom_headers})
|
||||
try:
|
||||
response = urllib.request.urlopen(req)
|
||||
except urllib.error.URLError as errno:
|
||||
|
|
Loading…
Reference in a new issue