From d5a02bd31aa653ad9980e09852e3213e324624de Mon Sep 17 00:00:00 2001 From: kidol Date: Sun, 3 Jul 2016 00:45:37 +0200 Subject: [PATCH 1/2] [Pornhub] Fix private video detection --- youtube_dl/extractor/pornhub.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/pornhub.py b/youtube_dl/extractor/pornhub.py index c76afe1c4..a02004dae 100644 --- a/youtube_dl/extractor/pornhub.py +++ b/youtube_dl/extractor/pornhub.py @@ -107,7 +107,7 @@ class PornHubIE(InfoExtractor): webpage = self._download_webpage(req, video_id) error_msg = self._html_search_regex( - r'(?s)]+class=(["\']).*?\bremoved\b.*?\1[^>]*>(?P.+?)', + r'(?s)]+class=(["\']).*?\b(removed|userMessageSection)\b.*?\1[^>]*>(?P.+?)', webpage, 'error message', default=None, group='error') if error_msg: error_msg = re.sub(r'\s+', ' ', error_msg) From 6598002a869b724f040a3100a1ee097a0fc7e9b4 Mon Sep 17 00:00:00 2001 From: kidol Date: Sun, 3 Jul 2016 02:45:14 +0200 Subject: [PATCH 2/2] no capture --- youtube_dl/extractor/pornhub.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/pornhub.py b/youtube_dl/extractor/pornhub.py index a02004dae..6cedaedb7 100644 --- a/youtube_dl/extractor/pornhub.py +++ b/youtube_dl/extractor/pornhub.py @@ -107,7 +107,7 @@ class PornHubIE(InfoExtractor): webpage = self._download_webpage(req, video_id) error_msg = self._html_search_regex( - r'(?s)]+class=(["\']).*?\b(removed|userMessageSection)\b.*?\1[^>]*>(?P.+?)', + r'(?s)]+class=(["\']).*?\b(?:removed|userMessageSection)\b.*?\1[^>]*>(?P.+?)', webpage, 'error message', default=None, group='error') if error_msg: error_msg = re.sub(r'\s+', ' ', error_msg)