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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ie/twitter:spaces] Fix format protocol #7550
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.
I suggest either linking to the issue so we have an example URL
yt_dlp/extractor/twitter.py
Outdated
if not is_live: | ||
fmt['container'] = 'm4a_dash' |
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.
Add this anyway, since user can force native with --downloader native
. Afair, fixup code will not run when ffmpeg is used
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.
It does still fixup when ffmpeg is used. Should we still add it back though? I have added it for now
Btw here's an example where native+fixup works (I wasn't just imagining it):
$ yt_dlp --cookies-from-browser firefox::twitter --downloader native 'https://twitter.com/i/spaces/1vAxRAVQWONJl'
[Cookies] Extracting cookies from firefox
[Cookies] Extracted 59 cookies from firefox
[twitter:spaces] Extracting URL: https://twitter.com/i/spaces/1vAxRAVQWONJl
[twitter:spaces] 1vAxRAVQWONJl: Downloading GraphQL JSON
[twitter:spaces] 28_1646577130061590528: Downloading legacy API JSON
[twitter:spaces] 28_1646577130061590528: Downloading m3u8 information
[info] 1vAxRAVQWONJl: Downloading 1 format(s): 0
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 829
[download] Destination: 20230413_googlecloud_1vAxRAVQWONJl_Framing_Up_FinOps_-_Billing_Tools.m4a
[download] 100% of 31.58MiB in 00:03:07 at 172.21KiB/s
[FixupM4a] Correcting container of "20230413_googlecloud_1vAxRAVQWONJl_Framing_Up_FinOps_-_Billing_Tools.m4a"
$
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.
It does still fixup when ffmpeg is used.
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py
index d0be3c964..cc1741b75 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -3418,7 +3418,7 @@ def ffmpeg_fixup(cndn, msg, cls):
postprocessed_by_ffmpeg = info_dict.get('requested_formats') or any((
isinstance(pp, FFmpegVideoConvertorPP)
and resolve_recode_mapping(ext, pp.mapping)[0] not in (ext, None)
- ) for pp in self._pps['post_process'])
+ ) for pp in self._pps['post_process']) or fd == FFmpegFD
if not postprocessed_by_ffmpeg:
ffmpeg_fixup(ext == 'm4a' and info_dict.get('container') == 'm4a_dash',
This should fix it. I'll push it later.
Closes yt-dlp#7536 Authored by: bashonly
Reverts the
entry_protocol
for_extract_m3u8_formats
tom3u8
, so as to force ffmpeg as downloader for both live and replay Spaces.Closes #7536
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?
Copilot Summary
馃 Generated by Copilot at 582709d
Summary
馃惁馃帣锔忦煕狅笍
Add support for downloading Twitter Spaces and fix m3u8 extraction. Use
ffmpeg
to download m3u8 formats fromyt_dlp/extractor/twitter.py
to avoid missing segments.Walkthrough