From 23de5639773f4e4c96e8059e1a9ce410cb28724d Mon Sep 17 00:00:00 2001 From: CeruleanSky Date: Sat, 27 Jul 2019 02:25:50 -0400 Subject: [PATCH 1/4] [dlive] extend regex to support VID with hyphens Some VIDs contain hyphens, so modified _VALID_URL accordingly. --- youtube_dl/extractor/dlive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/dlive.py b/youtube_dl/extractor/dlive.py index 8787f15a6..f9f2e17c9 100644 --- a/youtube_dl/extractor/dlive.py +++ b/youtube_dl/extractor/dlive.py @@ -9,7 +9,7 @@ from ..utils import int_or_none class DLiveVODIE(InfoExtractor): IE_NAME = 'dlive:vod' - _VALID_URL = r'https?://(?:www\.)?dlive\.tv/p/(?P.+?)\+(?P[a-zA-Z0-9]+)' + _VALID_URL = r'https?://(?:www\.)?dlive\.tv/p/(?P.+?)\+(?P[a-zA-Z0-9-]+)' _TEST = { 'url': 'https://dlive.tv/p/pdp+3mTzOl4WR', 'info_dict': { From 4809a761612069dcafdd83fb5e3dc8e3132921e9 Mon Sep 17 00:00:00 2001 From: CeruleanSky Date: Sat, 27 Jul 2019 03:30:06 -0400 Subject: [PATCH 2/4] [dlive] add test for VOD vid with hyphens --- youtube_dl/extractor/dlive.py | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/youtube_dl/extractor/dlive.py b/youtube_dl/extractor/dlive.py index f9f2e17c9..5e7d7ba0f 100644 --- a/youtube_dl/extractor/dlive.py +++ b/youtube_dl/extractor/dlive.py @@ -10,17 +10,31 @@ from ..utils import int_or_none class DLiveVODIE(InfoExtractor): IE_NAME = 'dlive:vod' _VALID_URL = r'https?://(?:www\.)?dlive\.tv/p/(?P.+?)\+(?P[a-zA-Z0-9-]+)' - _TEST = { - 'url': 'https://dlive.tv/p/pdp+3mTzOl4WR', - 'info_dict': { - 'id': '3mTzOl4WR', - 'ext': 'mp4', - 'title': 'Minecraft with james charles epic', - 'upload_date': '20190701', - 'timestamp': 1562011015, - 'uploader_id': 'pdp', + _TESTS = [ + { + 'url': 'https://dlive.tv/p/pdp+3mTzOl4WR', + 'info_dict': { + 'id': '3mTzOl4WR', + 'ext': 'mp4', + 'title': 'Minecraft with james charles epic', + 'upload_date': '20190701', + 'timestamp': 1562011015, + 'uploader_id': 'pdp', + } + }, + { + 'url': 'https://dlive.tv/p/pdpreplay+D-RD-xSZg', + 'info_dict': { + 'id': 'D-RD-xSZg', + 'title': 'Past Broadcast on July 1st, 2019 - Minecraft with james charles epic', + 'uploader_id': 'pdpreplay', + 'upload_date': '20190711', + 'thumbnail': 'https://images.prd.dlivecdn.com/thumbnail/eceb2161-8984-11e9-9b13-f6d36f09ac29', + 'timestamp': 1562826006, + 'ext': 'mp4', + } } - } + ] def _real_extract(self, url): uploader_id, vod_id = re.match(self._VALID_URL, url).groups() From 7591fa8651fe184ae9c568a2afddb994a6c63234 Mon Sep 17 00:00:00 2001 From: Sergey M Date: Wed, 31 Jul 2019 01:42:44 +0700 Subject: [PATCH 3/4] Update dlive.py --- youtube_dl/extractor/dlive.py | 37 ++++++++++++----------------------- 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/youtube_dl/extractor/dlive.py b/youtube_dl/extractor/dlive.py index 5e7d7ba0f..fb78a9716 100644 --- a/youtube_dl/extractor/dlive.py +++ b/youtube_dl/extractor/dlive.py @@ -10,31 +10,20 @@ from ..utils import int_or_none class DLiveVODIE(InfoExtractor): IE_NAME = 'dlive:vod' _VALID_URL = r'https?://(?:www\.)?dlive\.tv/p/(?P.+?)\+(?P[a-zA-Z0-9-]+)' - _TESTS = [ - { - 'url': 'https://dlive.tv/p/pdp+3mTzOl4WR', - 'info_dict': { - 'id': '3mTzOl4WR', - 'ext': 'mp4', - 'title': 'Minecraft with james charles epic', - 'upload_date': '20190701', - 'timestamp': 1562011015, - 'uploader_id': 'pdp', - } - }, - { - 'url': 'https://dlive.tv/p/pdpreplay+D-RD-xSZg', - 'info_dict': { - 'id': 'D-RD-xSZg', - 'title': 'Past Broadcast on July 1st, 2019 - Minecraft with james charles epic', - 'uploader_id': 'pdpreplay', - 'upload_date': '20190711', - 'thumbnail': 'https://images.prd.dlivecdn.com/thumbnail/eceb2161-8984-11e9-9b13-f6d36f09ac29', - 'timestamp': 1562826006, - 'ext': 'mp4', - } + _TESTS = [{ + 'url': 'https://dlive.tv/p/pdp+3mTzOl4WR', + 'info_dict': { + 'id': '3mTzOl4WR', + 'ext': 'mp4', + 'title': 'Minecraft with james charles epic', + 'upload_date': '20190701', + 'timestamp': 1562011015, + 'uploader_id': 'pdp', } - ] + }, { + 'url': 'https://dlive.tv/p/pdpreplay+D-RD-xSZg', + 'only_matching': True, + }] def _real_extract(self, url): uploader_id, vod_id = re.match(self._VALID_URL, url).groups() From 537cba90f357d87a5aba74c25acb51788238477e Mon Sep 17 00:00:00 2001 From: Sergey M Date: Wed, 31 Jul 2019 01:43:19 +0700 Subject: [PATCH 4/4] Update dlive.py --- youtube_dl/extractor/dlive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/dlive.py b/youtube_dl/extractor/dlive.py index fb78a9716..d95c67a5b 100644 --- a/youtube_dl/extractor/dlive.py +++ b/youtube_dl/extractor/dlive.py @@ -9,7 +9,7 @@ from ..utils import int_or_none class DLiveVODIE(InfoExtractor): IE_NAME = 'dlive:vod' - _VALID_URL = r'https?://(?:www\.)?dlive\.tv/p/(?P.+?)\+(?P[a-zA-Z0-9-]+)' + _VALID_URL = r'https?://(?:www\.)?dlive\.tv/p/(?P.+?)\+(?P[^/?#&]+)' _TESTS = [{ 'url': 'https://dlive.tv/p/pdp+3mTzOl4WR', 'info_dict': {