mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-25 16:51:26 +01:00
Compare commits
No commits in common. "b01da2335c695f9ddcf72cee4ac4711802fee84d" and "d0a642748c92b3c47073c072f5b86aeea3c6281e" have entirely different histories.
b01da2335c
...
d0a642748c
|
@ -1,11 +1,5 @@
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import ExtractorError, js_to_json, traverse_obj, update_url_query
|
||||||
ExtractorError,
|
|
||||||
js_to_json,
|
|
||||||
traverse_obj,
|
|
||||||
update_url_query,
|
|
||||||
url_or_none,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class RudoVideoIE(InfoExtractor):
|
class RudoVideoIE(InfoExtractor):
|
||||||
|
@ -92,12 +86,12 @@ class RudoVideoIE(InfoExtractor):
|
||||||
r'<script>var\s+_\$_[a-zA-Z0-9]+\s*=', webpage, 'access token array', video_id,
|
r'<script>var\s+_\$_[a-zA-Z0-9]+\s*=', webpage, 'access token array', video_id,
|
||||||
contains_pattern=r'\[(?s:.+)\]', default=None, transform_source=js_to_json)
|
contains_pattern=r'\[(?s:.+)\]', default=None, transform_source=js_to_json)
|
||||||
if token_array:
|
if token_array:
|
||||||
token_url = traverse_obj(token_array, (..., {url_or_none}), get_all=False)
|
if len(token_array) != 9:
|
||||||
if not token_url:
|
|
||||||
raise ExtractorError('Invalid access token array')
|
raise ExtractorError('Invalid access token array')
|
||||||
access_token = self._download_json(
|
access_token = self._download_json(token_array[0], video_id, note='Downloading access token')
|
||||||
token_url, video_id, note='Downloading access token')['data']['authToken']
|
m3u8_url = update_url_query(m3u8_url, {
|
||||||
m3u8_url = update_url_query(m3u8_url, {'auth-token': access_token})
|
'auth-token': traverse_obj(access_token, ('data', 'authToken'))
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user