-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[c13cl] Adding support for www.13.cl and rudo.video #8664
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also revert the changes to supportedsites.md
. The file will get updated with the next release.
* implementing PR suggestions * removing c13cl extractor in favor of RudoVideo with _EMBED_REGEX * supporting VODs and Podcasts from rudo.video * supporting embeded youtube * adding tests
Hello @seproDev , I have just implemented your suggestions. |
No problem :) Thanks for your advice @seproDev |
@seproDev I have used @pukkandan 's commit and modified just a little. The line to obtain the m3u8_url must first check for the streamURL variable, and only if it fails, search for the source tag. Everything else should be just like pukkandan's suggestion |
yt_dlp/extractor/rudovideo.py
Outdated
m3u8_url = update_url_query(m3u8_url, { | ||
'auth-token': traverse_obj(access_token, ('data', 'authToken')) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be fatal?
m3u8_url = update_url_query(m3u8_url, { | |
'auth-token': traverse_obj(access_token, ('data', 'authToken')) | |
}) | |
m3u8_url = update_url_query(m3u8_url, { | |
'auth-token': access_token['data']['authToken'], | |
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would do this instead
if token_array:
token_url = traverse_obj(token_array, (..., {url_or_none}), get_all=False)
if not token_url:
raise ExtractorError('Invalid access token array')
access_token = self._download_json(
token_url, video_id, note='Downloading access token')['data']['authToken']
m3u8_url = update_url_query(m3u8_url, {'auth-token': access_token})
Edit:
My first PR instead of using authToken and auth-token, it used the token_array elements.
are you saying the request to download token is unnecessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @bashonly , I have just pushed your suggestion
(somehow I removed my previous comment by mistake)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you saying the request to download token is unnecessary?
No. We need to download the token.
I meant that the array has something like this:
["https://example.com/tokenapi", ..., "authToken", "auth-token", ...]
So previously, I was downloading the token, and then using the access_token and the token_array elements to construct the query string this:
yt-dlp/yt_dlp/extractor/rudovideo.py
Lines 22 to 26 in 00edf40
access_token_webpage = self._download_webpage(token_array[0], video_id) | |
access_token = self._parse_json(access_token_webpage, video_id) | |
if "data" not in access_token or token_array[3] not in access_token.get("data"): | |
raise ExtractorError('Couldnt get access token', video_id=video_id) | |
query_string = token_array[5] + traverse_obj(access_token, ("data", token_array[3])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah alright. LGTM then
…PI response doesn't contain the data.authToken value
access_token = self._download_json( | ||
token_url, video_id, note='Downloading access token')['data']['authToken'] | ||
m3u8_url = update_url_query(m3u8_url, {'auth-token': access_token}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Podcasts such as https://rudo.video/podcast/b42ZUznHX0
are sometimes served as direct mp3 files, which currently break the extractor. A simple solution would be to check by extension:
if determine_ext(media_url) == 'm3u8': | |
formats = self._extract_m3u8_formats(media_url, video_id, live=is_live) | |
else: | |
formats = [{'url': media_url}] | |
I'd also rename the variable to media_url
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the extension is mp3, we may also want to add 'vcodec': 'none'
to the format dict
@seproDev I pushed your suggestions, adding support for the MP3 podcast, including a test |
Authored by: nicodato
IMPORTANT: PRs without the template will be CLOSED
Description of your pull request and other information
Adds extractor for www.13.cl and rudo.video.
13.cl is a TV channel from Chile, and it uses rudo.video.
With this PR, yt-dlp now supports (georestricted to Chile):
https://www.13.cl/en-vivo
https://www.13.cl/en-vivo-2
https://rudo.video/live/c13
https://rudo.video/live/t13-13cl
https://rudo.video/live/bbtv
Template
Before submitting a pull request make sure you have:
In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:
What is the purpose of your pull request?