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
[la7] Improvements to the extractor #1575
Conversation
- no longer using kaltura extactor - added hls, dash formats - fixes yt-dlp#1065
b4b9f61
to
26859bb
Compare
yt_dlp/extractor/la7.py
Outdated
urlh = self._request_webpage( | ||
HEADRequest(http_url), quality, | ||
note='Check filesize', fatal=False | ||
) | ||
if urlh: | ||
http_f = f.copy() | ||
del http_f['manifest_url'] | ||
http_f.update({ | ||
'format_id': http_f['format_id'].replace('hls-', 'https-'), | ||
'url': http_url, | ||
'protocol': 'https', | ||
'filesize_approx': int_or_none(urlh.headers.get('Content-Length', None)), | ||
}) |
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 dont know if it is really usefull to make a request just for getting the filesize. No other extractor does this
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.
yeah, I know, but it's maximum 2 request and since some tv programme are quite long (3 hours+) the file size can be quite big: ~2GB, so to give this info to the user can be useful and, as you can see from the BEFORE output, it was something that the kaltura extractor was providing to the user.
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 am still against it, but I wont force you to remove it either. I don't use the extractor and if u think this is worth it, ig u can keep it. But if more extractors start doing this in future, I'll have to design some strict guidelines on when this is allowed and when it isnt
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.
ok, then let's hope nobody uses it ;-D
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.
what if I make it optional?
I'll create a InfoExtractor method _generate_filesize and add on option --generate-filesize so that the extractors developer can use the method and the user has the control to allow it or not.
in the extractor:
'filesize_approx': self._generate_filesize(url)
in the InfoExtractor method:
if self.params.get('generate-filesize'):
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.
You can see my implementation in the last 2 commits
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 such a feature is to be implemented, it will need to be done in general and not specific to extractors. I am reverting your last 2 commits for this PR
There is also a feature request to fetch more format details using ffprobe. Any implementation of this will also need to atleast leave room for that
Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
* commit '9ebf3c6ab97c29b2d5872122e532bc98b93ad8b3': (23 commits) [version] update Release 2021.11.10.1 [version] update Release 2021.11.10 [tvp] Add TVPStreamIE (yt-dlp#1401) Authored by: selfisekai [tvp] Fix extractor (yt-dlp#1401) Authored by: selfisekai [tvp] Fix embeds (yt-dlp#1401) Authored by: selfisekai [wppilot] Add extractors (yt-dlp#1401) Authored by: selfisekai [radiokapital] Add extractors (yt-dlp#1401) Authored by: selfisekai [polsatgo] Add extractor (yt-dlp#1386) Authored by: selfisekai, sdomi [polskieradio] Add extractors (yt-dlp#1386) Authored by: selfisekai [extractor] Add `_search_nextjs_data` (yt-dlp#1386) Authored by: selfisekai [cleanup] minor fixes [docs] Minor documentation improvements Closes yt-dlp#1583, yt-dlp#1599 [outtmpl] Add alternate forms for `q` and `j` [cleanup] Minor improvements to error and debug messages fix for e1b7c54 [Gab] Add extractor (yt-dlp#1505) [imdb] Fix thumbnail (yt-dlp#1581) [la7] Fix extractor (yt-dlp#1575) ...
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 one of the following options:
What is the purpose of your pull request?
Description of your pull request and other information
BEFORE:
AFTER: