From 5fb6b05b3299b705ae8177c53309af0ee8cd4491 Mon Sep 17 00:00:00 2001 From: Kasper Dilday Date: Wed, 20 Mar 2019 23:17:19 +0100 Subject: [PATCH] [youporn] fixed upload_date and commment_count (as noted by tests) --- youtube_dl/extractor/youporn.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/youtube_dl/extractor/youporn.py b/youtube_dl/extractor/youporn.py index d4eccb4b2..743fa2cda 100644 --- a/youtube_dl/extractor/youporn.py +++ b/youtube_dl/extractor/youporn.py @@ -145,9 +145,8 @@ class YouPornIE(InfoExtractor): r'(?s)]+class=["\']submitByLink["\'][^>]*>(.+?)', webpage, 'uploader', fatal=False) upload_date = unified_strdate(self._html_search_regex( - [r'Date\s+[Aa]dded:\s*([^<]+)', - r'(?s)]+class=["\']videoInfo(?:Date|Time)["\'][^>]*>(.+?)'], - webpage, 'upload date', fatal=False)) + r']+class=["\']video-uploaded["\'][^>]*>[^<]+([^<]+)', + webpage, 'upload date', fatal=False)) age_limit = self._rta_search(webpage) @@ -158,9 +157,7 @@ class YouPornIE(InfoExtractor): view_count = str_to_int(self._search_regex( r'(?s)]+class=(["\']).*?\bvideoInfoViews\b.*?\1[^>]*>.*?(?P[\d,.]+)<', webpage, 'view count', fatal=False, group='count')) - comment_count = str_to_int(self._search_regex( - r'>All [Cc]omments? \(([\d,.]+)\)', - webpage, 'comment count', fatal=False)) + comment_count = len(re.findall(r']+class=([\"\']).*?videoComment\b.*?\1', webpage)) def extract_tag_box(regex, title): tag_box = self._search_regex(regex, webpage, title, default=None)