aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan@gmail.com>2021-02-15 20:07:03 +0530
committerpukkandan <pukkandan@gmail.com>2021-02-15 20:08:27 +0530
commit62852977953ff6d2492f87260ba60a44c3a9924a (patch)
treee186d5d4ac690f75207b6c8503e2130ee1c237d2
parente5813e53f089e018606435926ae0e109c4838394 (diff)
downloadhypervideo-pre-62852977953ff6d2492f87260ba60a44c3a9924a.tar.lz
hypervideo-pre-62852977953ff6d2492f87260ba60a44c3a9924a.tar.xz
hypervideo-pre-62852977953ff6d2492f87260ba60a44c3a9924a.zip
[rumble] Add support for video page (Closes #80)
-rw-r--r--youtube_dlc/extractor/generic.py8
-rw-r--r--youtube_dlc/extractor/rumble.py10
2 files changed, 18 insertions, 0 deletions
diff --git a/youtube_dlc/extractor/generic.py b/youtube_dlc/extractor/generic.py
index d5d8ed94b..819ba46a8 100644
--- a/youtube_dlc/extractor/generic.py
+++ b/youtube_dlc/extractor/generic.py
@@ -130,6 +130,7 @@ from .kinja import KinjaEmbedIE
from .gedi import GediEmbedsIE
from .rcs import RCSEmbedsIE
from .bitchute import BitChuteIE
+from .rumble import RumbleEmbedIE
from .arcpublishing import ArcPublishingIE
from .medialaan import MedialaanIE
@@ -3338,6 +3339,13 @@ class GenericIE(InfoExtractor):
return self.playlist_from_matches(
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
entries = self._parse_html5_media_entries(url, webpage, video_id, m3u8_id='hls')
if entries:
diff --git a/youtube_dlc/extractor/rumble.py b/youtube_dlc/extractor/rumble.py
index 4a0225109..b526de76b 100644
--- a/youtube_dlc/extractor/rumble.py
+++ b/youtube_dlc/extractor/rumble.py
@@ -1,6 +1,8 @@
# coding: utf-8
from __future__ import unicode_literals
+import re
+
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
@@ -28,6 +30,14 @@ class RumbleEmbedIE(InfoExtractor):
'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):
video_id = self._match_id(url)
video = self._download_json(