aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2020-12-04 23:56:50 +0700
committerSergey M․ <dstftw@gmail.com>2020-12-04 23:56:50 +0700
commite91df0c5501bd5df9987e310a37df51129ee1cf2 (patch)
treef0b388449b4358767af3ef8e335a94964c54a915 /youtube_dl
parentc5636e9bcaf37f2190b1e7d73785fde399001c29 (diff)
[pornhub] Handle HTTP errors gracefully (closes #26414)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/pornhub.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/youtube_dl/extractor/pornhub.py b/youtube_dl/extractor/pornhub.py
index 69a9797aa..9ad92a8ec 100644
--- a/youtube_dl/extractor/pornhub.py
+++ b/youtube_dl/extractor/pornhub.py
@@ -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\(\)',