mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-12-22 22:35:21 +00:00
Rumble plugin improvements
This commit is contained in:
parent
b71c256452
commit
c848132084
@ -14,7 +14,7 @@ from ..utils import (
|
|||||||
|
|
||||||
|
|
||||||
class RumbleEmbedIE(InfoExtractor):
|
class RumbleEmbedIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?rumble\.com/(?:embed/(?:[0-9a-z]+\.)?(?P<id>[0-9a-z]+)|(.*?)\.html)'
|
_VALID_URL = r'https?://(?:www\.)?rumble\.com/(?:embed/(?:[0-9a-z]+\.)?(?P<id>[0-9a-z]+)|([0-9a-z]+)-(.*?)\.html)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'https://rumble.com/embed/v5pv5f',
|
'url': 'https://rumble.com/embed/v5pv5f',
|
||||||
'md5': '36a18a049856720189f30977ccbb2c34',
|
'md5': '36a18a049856720189f30977ccbb2c34',
|
||||||
@ -34,10 +34,10 @@ class RumbleEmbedIE(InfoExtractor):
|
|||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
if re.match(r'https?://(?:www\.)?rumble\.com/(.*?)\.html', url):
|
if re.match(r'https?://(?:www\.)?rumble\.com/([0-9a-z]+)-(.*?)\.html', url):
|
||||||
video_id = ""
|
direct_video_id = re.findall(r'https?://(?:www\.)?rumble\.com/([0-9a-z]+)-(?:.*?)\.html', url)[0]
|
||||||
content, urlh = self._download_webpage_handle(url, video_id)
|
content = self._download_webpage(url, direct_video_id)
|
||||||
video_id = re.findall(r'"embedUrl":"https://rumble\.com/embed/(.*?)/"', content)[0]
|
video_id = re.findall(r'"embedUrl"\s*:\s*"https://rumble\.com/embed/(.*?)/"', content)[0]
|
||||||
else:
|
else:
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
video = self._download_json(
|
video = self._download_json(
|
||||||
|
Loading…
Reference in New Issue
Block a user