yt-dlp: On dr.dk I get the error: "Data must be padded to 16 byte boundary in CBC mode"
DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
- I understand that I will be blocked if I intentionally remove or skip any mandatory* field
Checklist
- I’m reporting that yt-dlp is broken on a supported site
- I’ve verified that I have updated yt-dlp to nightly or master (update instructions)
- I’ve checked that all provided URLs are playable in a browser with the same IP and same login details
- I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
- I’ve searched known issues and the bugtracker for similar issues including closed ones. DO NOT post duplicates
- I’ve read the guidelines for opening an issue
- I’ve read about sharing account credentials and I’m willing to share it if required
Region
Denmark
Provide a description that is worded well enough to be understood
The site www.dr.dk used to work, now I get the error: ERROR: Data must be padded to 16 byte boundary in CBC mode I’ve updated to latest nightly build, see also complete verbose output below.
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': TruetoYoutubeDLparams instead - Copy the WHOLE output (starting with
[debug] Command-line config) and insert it below
Complete Verbose Output
E:\yt-dlp>yt-dlp.exe https://www.dr.dk/drtv/se/heat_432518 -vU
[debug] Command-line config: ['https://www.dr.dk/drtv/se/heat_432518', '-vU']
[debug] Portable config "E:\yt-dlp\yt-dlp.conf": ['--fixup', 'detect_or_warn', '--embed-subs', '--ffmpeg-location', 'E:/yt-dlp/ffmpeg/bin', '-o', 'E:/yt-dlp/DLs/%(title)s.%(ext)s']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2024.03.08.232718 from yt-dlp/yt-dlp-nightly-builds [f4f9f6d00] (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 6.1.1-essentials_build-www.gyan.dev (setts), ffprobe 6.1.1-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, mutagen-1.47.0, requests-2.31.0, sqlite3-3.35.5, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1836 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Latest version: nightly@2024.03.08.232718 from yt-dlp/yt-dlp-nightly-builds
yt-dlp is up to date (nightly@2024.03.08.232718 from yt-dlp/yt-dlp-nightly-builds)
[drtv] Downloading anonymous token
[drtv] Extracting URL: https://www.dr.dk/drtv/se/heat_432518
[drtv] heat_432518: Downloading webpage
[drtv] 00024944880: Downloading stream data
[drtv] 00024944880: Downloading m3u8 information
[drtv] 00024944880: Downloading m3u8 information
[info] 00024944880: Downloading subtitles: da_foreign-SpokenSubtitles
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 00024944880: Downloading 1 format(s): video_hls-5681+video_hls-audio_medium-English
Deleting existing file E:\yt-dlp\DLs\Heat.da_foreign-SpokenSubtitles.vtt
[info] Writing video subtitles to: E:\yt-dlp\DLs\Heat.da_foreign-SpokenSubtitles.vtt
[debug] Invoking http downloader on "https://drod20i.akamaized.net/all/clear/none/d5/65df444de326d74f50668bd5/00024944880/subtitles/Foreign-Heat-Heat_DRTV2022Jan_HD_16x9_SpokenSubtitles.vtt"
[debug] File locking is not supported. Proceeding without locking
[download] Destination: E:\yt-dlp\DLs\Heat.da_foreign-SpokenSubtitles.vtt
[download] 100% of 78.59KiB in 00:00:00 at 109.31KiB/s
[debug] Invoking hlsnative downloader on "https://drod21m.akamaized.net/dk/encrypted/none/1e/65df444d6eec3325cceba01e/00024944880/stream_fmp4/Heat-Heat_DRTV2022Jan_HD_16x9_VideoMain_video_5500.m3u8?aka_me_session_id=AAAAAAAAAAANoO1lAAAAABufDWtIvAKo3nfgxcY6Q+ky3N9EOPr2QKJlLctUuZ%2fgD%2fQMdqCVwhooeAHhamM9jCfl%2fX%2fMkqzc&aka_media_format_type=hls"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 963
[download] Destination: E:\yt-dlp\DLs\Heat.fvideo_hls-5681.mp4
[download] 0.7% of ~ 848.50KiB at 3.17KiB/s ETA Unknown (frag 8/963)ERROR: Data must be padded to 16 byte boundary in CBC mode
Traceback (most recent call last):
File "yt_dlp\YoutubeDL.py", line 1593, in wrapper
File "yt_dlp\YoutubeDL.py", line 1749, in __extract_info
File "yt_dlp\YoutubeDL.py", line 1808, in process_ie_result
File "yt_dlp\YoutubeDL.py", line 2966, in process_video_result
File "yt_dlp\YoutubeDL.py", line 3414, in process_info
File "yt_dlp\YoutubeDL.py", line 3153, in dl
File "yt_dlp\downloader\common.py", line 455, in download
File "yt_dlp\downloader\hls.py", line 378, in real_download
File "yt_dlp\downloader\fragment.py", line 516, in download_and_append_fragments
File "yt_dlp\downloader\fragment.py", line 364, in decrypt_fragment
File "yt_dlp\aes.py", line 11, in aes_cbc_decrypt_bytes
File "Cryptodome\Cipher\_mode_cbc.py", line 246, in decrypt
ValueError: Data must be padded to 16 byte boundary in CBC mode
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (10 by maintainers)
Commits related to this issue
- [fd/hls] Fix `BYTERANGE` logic (#11972) Closes #3578, Closes #3810, Closes #9400 Authored by: entourage8 — committed to saschazepter/yt-dlp by entourage8 2 years ago
- [fd/hls] Fix `BYTERANGE` logic (#11972) Closes #3578, Closes #3810, Closes #9400 Authored by: entourage8 — committed to subrat-lima/yt-dlp by entourage8 2 years ago
I can confirm
--downloader ffmpegworks.Until this is fixed it would be nice if the error said: “Try ‘–downloader ffmpeg’”. I would never have guessed this.
workaround:
--downloader ffmpegRelated: #3810, #3578, #1297
I will be happy to. You can assume I am on a Ubuntu machine.
Which commands should I run to try the patch? Assume that I have never used git before and never compiled yt-dlp from source.
Workaround works most of the time, but not always. Ffmpeg is slow an fragile, compared to yt-dlp, and somtime fails. If ffmpeg kan handle this problem - why not yt-dlp?
Verbose yt-dlp log
Verbose ffmpeg log. Download failed
I too can confirm that the workaround works. Note that it generates a lot of somewhat confusing text in the cmd window, but that it ends up completing fine.