[pornhub] Handle HTTP errors gracefully (closes #26414)
authorSergey M․ <dstftw@gmail.com>
Fri, 4 Dec 2020 16:56:50 +0000 (23:56 +0700)
committerSergey M․ <dstftw@gmail.com>
Fri, 4 Dec 2020 16:56:50 +0000 (23:56 +0700)
youtube_dl/extractor/pornhub.py

index 69a9797aad4dd8d604137369d324c22f45beb9a0..9ad92a8ecf374b9615ed763907fbbece6907967e 100644 (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\(\)',