1 from .common
import InfoExtractor
12 class RudoVideoIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://rudo\.video/(?P<type>vod|podcast|live)/(?P<id>[^/?&#]+)'
14 _EMBED_REGEX
= [r
'<iframe[^>]+src=[\'"](?P<url>(?:https?:)//rudo\.video/(?:vod|podcast|live)/[^\'"]+)']
16 'url
': 'https
://rudo
.video
/podcast
/cz2wrUy8l0o
',
17 'md5
': '28ed82b477708dc5e12e072da2449221
',
20 'title
': 'Diego Cabot
',
22 'thumbnail
': r're
:^
(?
:https?
:)?
//.*\
.(png|jpg
)$
',
25 'url
': 'https
://rudo
.video
/podcast
/bQkt07
',
26 'md5
': '36b22a9863de0f47f00fc7532a32a898
',
29 'title
': 'Tubular Bells
',
31 'thumbnail
': r're
:^
(?
:https?
:)?
//.*\
.(png|jpg
)$
',
34 'url
': 'https
://rudo
.video
/podcast
/b42ZUznHX0
',
35 'md5
': 'b91c70d832938871367f8ad10c895821
',
38 'title
': 'Columna Ruperto Concha
',
40 'thumbnail
': r're
:^
(?
:https?
:)?
//.*\
.(png|jpg
)$
',
43 'url
': 'https
://rudo
.video
/vod
/bN5AaJ
',
44 'md5
': '01324a329227e2591530ecb4f555c881
',
47 'title
': 'Ucrania
19.03',
48 'creator
': 'La Tercera
',
50 'thumbnail
': r're
:^
(?
:https?
:)?
//.*\
.(png|jpg
)$
',
53 'url
': 'https
://rudo
.video
/live
/bbtv
',
57 'creator
': 'BioBioTV
',
58 'live_status
': 'is_live
',
59 'title
': r're
:^LIVE BBTV\s\d{4}
-\d{2}
-\d{2}\s\d{2}
:\d{2}$
',
60 'thumbnail
': r're
:^
(?
:https?
:)?
//.*\
.(png|jpg
)$
',
63 'url
': 'https
://rudo
.video
/live
/c13
',
69 'skip
': 'Geo
-restricted to Chile
',
71 'url
': 'https
://rudo
.video
/live
/t13
-13cl
',
77 'skip
': 'Geo
-restricted to Chile
',
80 def _real_extract(self, url):
81 video_id, type_ = self._match_valid_url(url).group('id', 'type')
82 is_live = type_ == 'live
'
84 webpage = self._download_webpage(url, video_id)
85 if 'Streaming
is not available
in your area
' in webpage:
86 self.raise_geo_restricted()
90 r'var\s
+streamURL\s
*=\s
*[\'"]([^?\'"]+)', webpage, 'stream url
', default=None)
91 # Source URL must be used only if streamURL is unavailable
92 or self._search_regex(
93 r'<source
[^
>]+src
=[\'"]([^\'"]+)', webpage, 'source url
', default=None))
95 youtube_url = self._search_regex(r'file:\s
*[\'"]((?:https?:)//(?:www\.)?youtube\.com[^\'"]+)',
96 webpage, 'youtube url
', default=None)
98 return self.url_result(youtube_url, 'Youtube
')
99 raise ExtractorError('Unable to extract stream url
')
101 token_array = self._search_json(
102 r'<script
>var\s
+_\$_
[a
-zA
-Z0
-9]+\s
*=', webpage, 'access token array
', video_id,
103 contains_pattern=r'\
[(?s
:.+)\
]', default=None, transform_source=js_to_json)
105 token_url = traverse_obj(token_array, (..., {url_or_none}), get_all=False)
107 raise ExtractorError('Invalid access token array
')
108 access_token = self._download_json(
109 token_url, video_id, note='Downloading access token
')['data
']['authToken
']
110 media_url = update_url_query(media_url, {'auth
-token
': access_token})
112 ext = determine_ext(media_url)
114 formats = self._extract_m3u8_formats(media_url, video_id, live=is_live)
121 formats = [{'url
': media_url}]
125 'title
': (self._search_regex(r'var\s
+titleVideo\s
*=\s
*[\'"]([^\'"]+)',
126 webpage, 'title
', default=None)
127 or self._og_search_title(webpage)),
128 'creator
': self._search_regex(r'var\s
+videoAuthor\s
*=\s
*[\'"]([^?\'"]+)',
129 webpage, 'videoAuthor
', default=None),
130 'thumbnail
': (self._search_regex(r'var\s
+posterIMG\s
*=\s
*[\'"]([^?\'"]+)',
131 webpage, 'thumbnail
', default=None)
132 or self._og_search_thumbnail(webpage)),