[pornhub] Handle HTTP errors gracefully (closes #26414)

This commit is contained in:
Sergey M․ 2020-12-04 23:56:50 +07:00
parent c5636e9bca
commit e91df0c550
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D
1 changed files with 6 additions and 1 deletions

View File

@ -31,7 +31,12 @@ class PornHubBaseIE(InfoExtractor):
def dl(*args, **kwargs):
return super(PornHubBaseIE, self)._download_webpage_handle(*args, **kwargs)
webpage, urlh = dl(*args, **kwargs)
ret = dl(*args, **kwargs)
if not ret:
return ret
webpage, urlh = ret
if any(re.search(p, webpage) for p in (
r'<body\b[^>]+\bonload=["\']go\(\)',