From f79a86223630f0ca189604e1f8daa66cc6374d45 Mon Sep 17 00:00:00 2001 From: JChris246 Date: Sun, 3 Feb 2019 19:31:56 -0400 Subject: [PATCH 1/3] added like count to info dict --- youtube_dl/extractor/pornhd.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/youtube_dl/extractor/pornhd.py b/youtube_dl/extractor/pornhd.py index b52879c7a..534f06277 100644 --- a/youtube_dl/extractor/pornhd.py +++ b/youtube_dl/extractor/pornhd.py @@ -85,6 +85,9 @@ class PornHdIE(InfoExtractor): r"poster'?\s*:\s*([\"'])(?P(?:(?!\1).)+)\1", webpage, 'thumbnail', fatal=False, group='url') + like_count = int_or_none(self._search_regex( + r'class="save-count">(\d+)<', webpage, 'like_count', fatal=False)) + return { 'id': video_id, 'display_id': display_id, @@ -94,4 +97,5 @@ class PornHdIE(InfoExtractor): 'view_count': view_count, 'formats': formats, 'age_limit': 18, + 'like_count': like_count, } From e37c58f0b08a49141fe9a5721075a74d288198fd Mon Sep 17 00:00:00 2001 From: JChris246 Date: Mon, 4 Feb 2019 12:37:49 -0400 Subject: [PATCH 2/3] [pornhd] requested changes --- youtube_dl/extractor/pornhd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/pornhd.py b/youtube_dl/extractor/pornhd.py index 534f06277..90cfb8a47 100644 --- a/youtube_dl/extractor/pornhd.py +++ b/youtube_dl/extractor/pornhd.py @@ -86,7 +86,7 @@ class PornHdIE(InfoExtractor): 'thumbnail', fatal=False, group='url') like_count = int_or_none(self._search_regex( - r'class="save-count">(\d+)<', webpage, 'like_count', fatal=False)) + r'save-count[\'"]>(\d+)', webpage, 'like count', fatal=False)) return { 'id': video_id, @@ -95,7 +95,7 @@ class PornHdIE(InfoExtractor): 'description': description, 'thumbnail': thumbnail, 'view_count': view_count, + 'like_count': like_count, 'formats': formats, 'age_limit': 18, - 'like_count': like_count, } From e054f6b5bbe3758fb2caf520a5916ec40810fde0 Mon Sep 17 00:00:00 2001 From: Sergey M Date: Tue, 5 Feb 2019 00:05:19 +0700 Subject: [PATCH 3/3] Update pornhd.py --- youtube_dl/extractor/pornhd.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/pornhd.py b/youtube_dl/extractor/pornhd.py index 90cfb8a47..a079cd32a 100644 --- a/youtube_dl/extractor/pornhd.py +++ b/youtube_dl/extractor/pornhd.py @@ -23,6 +23,7 @@ class PornHdIE(InfoExtractor): 'description': 'md5:3748420395e03e31ac96857a8f125b2b', 'thumbnail': r're:^https?://.*\.jpg', 'view_count': int, + 'like_count': int, 'age_limit': 18, } }, { @@ -37,6 +38,7 @@ class PornHdIE(InfoExtractor): 'description': 'md5:8ff0523848ac2b8f9b065ba781ccf294', 'thumbnail': r're:^https?://.*\.jpg', 'view_count': int, + 'like_count': int, 'age_limit': 18, }, 'skip': 'Not available anymore', @@ -86,7 +88,9 @@ class PornHdIE(InfoExtractor): 'thumbnail', fatal=False, group='url') like_count = int_or_none(self._search_regex( - r'save-count[\'"]>(\d+)', webpage, 'like count', fatal=False)) + (r'(\d+)\s*]+>(?: |\s)*\blikes', + r'class=["\']save-count["\'][^>]*>\s*(\d+)'), + webpage, 'like count', fatal=False)) return { 'id': video_id,