mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-28 06:04:17 +01:00
get_http_data: remove try-except-clause
This commit is contained in:
parent
65143fb9f7
commit
e1e56773cb
@ -63,19 +63,7 @@ def get_http_data(url, header=None, data=None, useragent=FIREFOX_UA,
|
|||||||
|
|
||||||
opener = build_opener(HTTPCookieProcessor(cookiejar))
|
opener = build_opener(HTTPCookieProcessor(cookiejar))
|
||||||
|
|
||||||
try:
|
response = opener.open(request)
|
||||||
response = opener.open(request)
|
|
||||||
except HTTPError as e:
|
|
||||||
log.error("Something wrong with that url")
|
|
||||||
log.error("Error code: %s", e.code)
|
|
||||||
sys.exit(5)
|
|
||||||
except URLError as e:
|
|
||||||
log.error("Something wrong with that url")
|
|
||||||
log.error("Error code: %s", e.reason)
|
|
||||||
sys.exit(5)
|
|
||||||
except ValueError as e:
|
|
||||||
log.error("Try adding http:// before the url")
|
|
||||||
sys.exit(5)
|
|
||||||
if is_py3:
|
if is_py3:
|
||||||
data = response.read()
|
data = response.read()
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user