Skip to content

Commit a366263

Browse files
authored
Merge pull request #137 from morhook/fix_error_handling
Fixed error handling
2 parents 1e9b314 + 3ad8620 commit a366263

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pirate/torrent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def find_api(mirror, timeout):
146146
f = request.urlopen(req, timeout=timeout)
147147
if f.info().get_content_type() == 'application/json':
148148
return mirror + path
149-
except urllib.error.URLError as e:
149+
except urllib.error.HTTPError as e:
150150
res = e.fp.read().decode()
151151
if e.code == 503 and 'cf-browser-verification' in res:
152152
raise IOError('Cloudflare protected')

0 commit comments

Comments
 (0)