[rumble] Add support for video page (Closes #80)

This commit is contained in:
pukkandan 2021-02-15 20:07:03 +05:30
parent e5813e53f0
commit 6285297795
2 changed files with 18 additions and 0 deletions

View File

@ -130,6 +130,7 @@
from .gedi import GediEmbedsIE from .gedi import GediEmbedsIE
from .rcs import RCSEmbedsIE from .rcs import RCSEmbedsIE
from .bitchute import BitChuteIE from .bitchute import BitChuteIE
from .rumble import RumbleEmbedIE
from .arcpublishing import ArcPublishingIE from .arcpublishing import ArcPublishingIE
from .medialaan import MedialaanIE from .medialaan import MedialaanIE
@ -3338,6 +3339,13 @@ def _real_extract(self, url):
return self.playlist_from_matches( return self.playlist_from_matches(
bitchute_urls, video_id, video_title, ie=BitChuteIE.ie_key()) bitchute_urls, video_id, video_title, ie=BitChuteIE.ie_key())
rumble_urls = RumbleEmbedIE._extract_urls(webpage)
if len(rumble_urls) == 1:
return self.url_result(rumble_urls[0], RumbleEmbedIE.ie_key())
if rumble_urls:
return self.playlist_from_matches(
rumble_urls, video_id, video_title, ie=RumbleEmbedIE.ie_key())
# Look for HTML5 media # Look for HTML5 media
entries = self._parse_html5_media_entries(url, webpage, video_id, m3u8_id='hls') entries = self._parse_html5_media_entries(url, webpage, video_id, m3u8_id='hls')
if entries: if entries:

View File

@ -1,6 +1,8 @@
# coding: utf-8 # coding: utf-8
from __future__ import unicode_literals from __future__ import unicode_literals
import re
from .common import InfoExtractor from .common import InfoExtractor
from ..compat import compat_str from ..compat import compat_str
from ..utils import ( from ..utils import (
@ -28,6 +30,14 @@ class RumbleEmbedIE(InfoExtractor):
'only_matching': True, 'only_matching': True,
}] }]
@staticmethod
def _extract_urls(webpage):
return [
mobj.group('url')
for mobj in re.finditer(
r'(?:<(?:script|iframe)[^>]+\bsrc=|["\']embedUrl["\']\s*:\s*)["\'](?P<url>%s)' % RumbleEmbedIE._VALID_URL,
webpage)]
def _real_extract(self, url): def _real_extract(self, url):
video_id = self._match_id(url) video_id = self._match_id(url)
video = self._download_json( video = self._download_json(