From cc26427b38e365f037217c915bb01821afbea5f8 Mon Sep 17 00:00:00 2001 From: Matthew Brooks Date: Sun, 24 Nov 2019 13:07:34 -0600 Subject: [PATCH 1/4] [bitchute] add upload_date --- youtube_dl/extractor/bitchute.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/youtube_dl/extractor/bitchute.py b/youtube_dl/extractor/bitchute.py index 430663fbf93..6d533464791 100644 --- a/youtube_dl/extractor/bitchute.py +++ b/youtube_dl/extractor/bitchute.py @@ -8,6 +8,7 @@ from ..utils import ( orderedSet, urlencode_postdata, + unified_strdate, ) @@ -23,6 +24,7 @@ class BitChuteIE(InfoExtractor): 'description': 'md5:3f21f6fb5b1d17c3dee9cf6b5fe60b3a', 'thumbnail': r're:^https?://.*\.jpg$', 'uploader': 'Victoria X Rave', + 'upload_date': '20170813', }, }, { 'url': 'https://www.bitchute.com/embed/lbb5G1hjPhw/', @@ -74,6 +76,11 @@ def _real_extract(self, url): r'(?s)]+\bclass=["\']video-author[^>]+>(.+?)

'), webpage, 'uploader', fatal=False) + upload_date = self._html_search_regex( + r'(?s)class="video-publish-date.*?>.*?First published at [0-9]+:[0-9]+ UTC on (.*?)\..*?', + webpage, 'upload_date', fatal=False) + upload_date = unified_strdate(upload_date) + return { 'id': video_id, 'title': title, @@ -81,6 +88,7 @@ def _real_extract(self, url): 'thumbnail': thumbnail, 'uploader': uploader, 'formats': formats, + 'upload_date': upload_date, } From 8267f2fa90554c578de156548ca47f8521ef4f5d Mon Sep 17 00:00:00 2001 From: Matthew Brooks Date: Sun, 24 Nov 2019 14:48:20 -0600 Subject: [PATCH 2/4] Allow differing quotation styles, specify whitespace instead of any char. --- youtube_dl/extractor/bitchute.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/bitchute.py b/youtube_dl/extractor/bitchute.py index 6d533464791..e30b942611b 100644 --- a/youtube_dl/extractor/bitchute.py +++ b/youtube_dl/extractor/bitchute.py @@ -77,7 +77,7 @@ def _real_extract(self, url): webpage, 'uploader', fatal=False) upload_date = self._html_search_regex( - r'(?s)class="video-publish-date.*?>.*?First published at [0-9]+:[0-9]+ UTC on (.*?)\..*?', + r'(?s)class=["\']video-publish-date.*?>\W*First published at [0-9]+:[0-9]+ UTC on (.*?)\.\W*', webpage, 'upload_date', fatal=False) upload_date = unified_strdate(upload_date) From a48d79f2fe620108d3274d0e5ef6ee13826fb2e3 Mon Sep 17 00:00:00 2001 From: Sergey M Date: Wed, 27 Nov 2019 00:19:08 +0700 Subject: [PATCH 3/4] Update bitchute.py --- youtube_dl/extractor/bitchute.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/bitchute.py b/youtube_dl/extractor/bitchute.py index e30b942611b..e7bd56389d8 100644 --- a/youtube_dl/extractor/bitchute.py +++ b/youtube_dl/extractor/bitchute.py @@ -76,10 +76,9 @@ def _real_extract(self, url): r'(?s)]+\bclass=["\']video-author[^>]+>(.+?)

'), webpage, 'uploader', fatal=False) - upload_date = self._html_search_regex( - r'(?s)class=["\']video-publish-date.*?>\W*First published at [0-9]+:[0-9]+ UTC on (.*?)\.\W*', - webpage, 'upload_date', fatal=False) - upload_date = unified_strdate(upload_date) + upload_date = unified_strdate(self._search_regex( + r'class=["\']video-publish-date[^>]+>[^<]+ at \d+:\d+ UTC on (.+?)\.', + webpage, 'upload date', fatal=False)) return { 'id': video_id, From 4f0f5f0c20957e14d3325734687f0531bb57e42b Mon Sep 17 00:00:00 2001 From: Sergey M Date: Wed, 27 Nov 2019 00:19:48 +0700 Subject: [PATCH 4/4] Update bitchute.py --- youtube_dl/extractor/bitchute.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/bitchute.py b/youtube_dl/extractor/bitchute.py index e7bd56389d8..0c773e66e1c 100644 --- a/youtube_dl/extractor/bitchute.py +++ b/youtube_dl/extractor/bitchute.py @@ -7,8 +7,8 @@ from .common import InfoExtractor from ..utils import ( orderedSet, - urlencode_postdata, unified_strdate, + urlencode_postdata, ) @@ -86,8 +86,8 @@ def _real_extract(self, url): 'description': description, 'thumbnail': thumbnail, 'uploader': uploader, - 'formats': formats, 'upload_date': upload_date, + 'formats': formats, }