From c848132084f49bcd2887ac601b53c4ae3eebee1d Mon Sep 17 00:00:00 2001 From: Grabien Date: Fri, 13 Aug 2021 19:44:01 +0300 Subject: [PATCH] Rumble plugin improvements --- youtube_dl/extractor/rumble.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/youtube_dl/extractor/rumble.py b/youtube_dl/extractor/rumble.py index ac3b3dfc7..405c5a12d 100644 --- a/youtube_dl/extractor/rumble.py +++ b/youtube_dl/extractor/rumble.py @@ -14,7 +14,7 @@ from ..utils import ( class RumbleEmbedIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?rumble\.com/(?:embed/(?:[0-9a-z]+\.)?(?P[0-9a-z]+)|(.*?)\.html)' + _VALID_URL = r'https?://(?:www\.)?rumble\.com/(?:embed/(?:[0-9a-z]+\.)?(?P[0-9a-z]+)|([0-9a-z]+)-(.*?)\.html)' _TESTS = [{ 'url': 'https://rumble.com/embed/v5pv5f', 'md5': '36a18a049856720189f30977ccbb2c34', @@ -34,10 +34,10 @@ class RumbleEmbedIE(InfoExtractor): }] def _real_extract(self, url): - if re.match(r'https?://(?:www\.)?rumble\.com/(.*?)\.html', url): - video_id = "" - content, urlh = self._download_webpage_handle(url, video_id) - video_id = re.findall(r'"embedUrl":"https://rumble\.com/embed/(.*?)/"', content)[0] + if re.match(r'https?://(?:www\.)?rumble\.com/([0-9a-z]+)-(.*?)\.html', url): + direct_video_id = re.findall(r'https?://(?:www\.)?rumble\.com/([0-9a-z]+)-(?:.*?)\.html', url)[0] + content = self._download_webpage(url, direct_video_id) + video_id = re.findall(r'"embedUrl"\s*:\s*"https://rumble\.com/embed/(.*?)/"', content)[0] else: video_id = self._match_id(url) video = self._download_json(