You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide a description that is worded well enough to be understood
I want to use yt-dlp to extract web dash fragment urls for YouTube livestreams. Right now yt-dlp only extracts fragment URLs from the dash manifest. The web player, on the other hand, extracts them from adaptiveFormats in the html (and fixes nsig). I can get the fragment URLs from the dash manifest with yt-dlp --extractor-args 'youtube:player_client=web;formats=incomplete,duplicate' --print fragment_base_url -f 248-dash jfKfPfyJRdk resulting in:
To be clear, these always point to the same data (as far as I know), but the web URLs are preferable in some circumstances. For example, with this URL one can simply replace itag with anything from aitags to change the format. I mainly just want these extracted to pass to other applications. I don't care if yt-dlp makes them downloadable natively (which is certainly possible but likely not worth the effort).
yt-dlp could do this already but there is a check on lines 3826-3827 of youtube.py which explicitly prevents it.
if fmt.get('targetDurationSec'):
continue
itag = str_or_none(fmt.get('itag'))
...
If I remove the check then yt-dlp jfKfPfyJRdk -f 248 --extractor-args 'youtube:player_client=web;formats=incomplete,duplicate' --print url gives the desired URL. Of course, if one tries to download this format it will fail since yt-dlp treats it as https.
Would it be possible to add an argument to bypass this check? Perhaps something like formats=broken so people don't accidentally use it. If this is undesirable, saving the web URLs to a separate metadata field (something like fragment_base_web_url) in the regular dash formats would be just as good but would not be quite as straightforward to implement.
Provide verbose output that clearly demonstrates the problem
Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
If using API, add 'verbose': True to YoutubeDL params instead
Copy the WHOLE output (starting with [debug] Command-line config) and insert it below
Complete Verbose Output
> yt-dlp -vU --extractor-args 'youtube:player_client=web;formats=incomplete,duplicate' --print url -f 248 jfKfPfyJRdk
[debug] Command-line config: ['-vU', '--extractor-args', 'youtube:player_client=web;formats=incomplete,duplicate', '--print', 'url', '-f', '248', 'jfKfPfyJRdk']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version [email protected] from yt-dlp/yt-dlp-nightly-builds [db50f19d7] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 1.1.1k 25 Mar 2021)
[debug] exe versions: ffmpeg git-2020-07-29-cbb6ba2, ffprobe git-2020-07-29-cbb6ba2, phantomjs 2.1.1
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.32.3, sqlite3-3.35.5, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Loaded 1820 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Latest version: [email protected] from yt-dlp/yt-dlp-nightly-builds
yt-dlp is up to date ([email protected] from yt-dlp/yt-dlp-nightly-builds)
[youtube] Extracting URL: jfKfPfyJRdk
[youtube] jfKfPfyJRdk: Downloading webpage
[youtube] jfKfPfyJRdk: Downloading m3u8 information
[youtube] jfKfPfyJRdk: Downloading MPD manifest
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
ERROR: [youtube] jfKfPfyJRdk: Requested format is not available. Use --list-formats for a list of available formats
Traceback (most recent call last):
File "yt_dlp\YoutubeDL.py", line 1606, in wrapper
File "yt_dlp\YoutubeDL.py", line 1762, in __extract_info
File "yt_dlp\YoutubeDL.py", line 1821, in process_ie_result
File "yt_dlp\YoutubeDL.py", line 2955, in process_video_result
yt_dlp.utils.ExtractorError: [youtube] jfKfPfyJRdk: Requested format is not available. Use --list-formats for a list of available formats
The text was updated successfully, but these errors were encountered:
No. From what I can tell the DASH URLs that are extracted with --live-from-start are generated from the manifest, not from adaptiveFormats. The extracted URLs do not have the aitags parameter and use slashes rather than & and = to separate parameters.
DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
Checklist
Region
No response
Example URLs
https://youtu.be/jfKfPfyJRdk
Provide a description that is worded well enough to be understood
I want to use yt-dlp to extract web dash fragment urls for YouTube livestreams. Right now yt-dlp only extracts fragment URLs from the dash manifest. The web player, on the other hand, extracts them from
adaptiveFormats
in the html (and fixes nsig). I can get the fragment URLs from the dash manifest withyt-dlp --extractor-args 'youtube:player_client=web;formats=incomplete,duplicate' --print fragment_base_url -f 248-dash jfKfPfyJRdk
resulting in:However the fragment URLs used by the web player are different and cannot be converted:
To be clear, these always point to the same data (as far as I know), but the web URLs are preferable in some circumstances. For example, with this URL one can simply replace
itag
with anything fromaitags
to change the format. I mainly just want these extracted to pass to other applications. I don't care if yt-dlp makes them downloadable natively (which is certainly possible but likely not worth the effort).yt-dlp could do this already but there is a check on lines 3826-3827 of
youtube.py
which explicitly prevents it.If I remove the check then
yt-dlp jfKfPfyJRdk -f 248 --extractor-args 'youtube:player_client=web;formats=incomplete,duplicate' --print url
gives the desired URL. Of course, if one tries to download this format it will fail since yt-dlp treats it as https.Would it be possible to add an argument to bypass this check? Perhaps something like
formats=broken
so people don't accidentally use it. If this is undesirable, saving the web URLs to a separate metadata field (something likefragment_base_web_url
) in the regular dash formats would be just as good but would not be quite as straightforward to implement.Provide verbose output that clearly demonstrates the problem
yt-dlp -vU <your command line>
)'verbose': True
toYoutubeDL
params instead[debug] Command-line config
) and insert it belowComplete Verbose Output
The text was updated successfully, but these errors were encountered: