yt-dlp / yt-dlp

A feature-rich command-line audio/video downloader
https://discord.gg/H5MNcFW63r
The Unlicense
88.31k stars 6.84k forks source link

Latest git fails to retrieve a video that cda1bc519 succeeds with #5426

Closed goldirocks closed 1 year ago

goldirocks commented 2 years ago

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

Checklist

Region

US

Provide a description that is worded well enough to be understood

Attempting to retrieve videos like this fails on latest git (62b8dac49) and succeeds on cda1bc519.

Provide verbose output that clearly demonstrates the problem

Complete Verbose Output

[debug] Command-line config: ['-vU', 'https://www.cbs.com/shows/video/6yhZR67ZyC8Nsdyk9wWOXf6g7FRDVr68/']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.10.04 [4e0511f27] (source)
[debug] Lazy loading extractors is disabled
[debug] Plugins: ['SamplePluginIE', 'SamplePluginPP']
[debug] Git HEAD: 62b8dac49
[debug] Python 3.8.10 (CPython 64bit) - Linux-5.15.0-41-generic-x86_64-with-glibc2.29 (glibc 2.31)
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 4.2.7, ffprobe 4.2.7
[debug] Optional libraries: Crypto-2.6.1, certifi-2019.11.28, secretstorage-2.3.1, sqlite3-2.6.0, xattr-0.9.6
[debug] Proxy map: {}
[debug] Loaded 1707 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2022.10.04, Current version: 2022.10.04
yt-dlp is up to date (2022.10.04)
[debug] [CBS] Extracting URL: https://www.cbs.com/shows/video/6yhZR67ZyC8Nsdyk9wWOXf6g7FRDVr68/
[CBS] 6yhZR67ZyC8Nsdyk9wWOXf6g7FRDVr68: Downloading XML
[CBS] 6yhZR67ZyC8Nsdyk9wWOXf6g7FRDVr68: Downloading JSON metadata
[CBS] 6yhZR67ZyC8Nsdyk9wWOXf6g7FRDVr68: Downloading StreamPack SMIL data
[CBS] 6yhZR67ZyC8Nsdyk9wWOXf6g7FRDVr68: Downloading m3u8 information
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 6yhZR67ZyC8Nsdyk9wWOXf6g7FRDVr68: Downloading 1 format(s): hls-4590
[debug] Invoking hlsnative downloader on "https://cbsios-vh.akamaihd.net/i/temp_hd_gallery_video/CBS_Production_Outlet_VMS/video_robot/CBS_Production_Entertainment/2022/10/27/2091792963939/COLBERT_1329_2997DF_1920X1080_178_2CH_PRORESHQ.mov_1738998_,2228,4628,3128,1628,848,503,000.mp4.csmil/index_1_av.m3u8?null=0&id=AgBHvh5kF94BJuc2YWM9z1cqmDQ650wV4wIpkhkPJ1%2fkT2ChZdfz82hK4SVwg4i3B+xuSZ2fZgz9dA%3d%3d&hdntl=exp=1667401831~acl=%2fi%2ftemp_hd_gallery_video%2fCBS_Production_Outlet_VMS%2fvideo_robot%2fCBS_Production_Entertainment%2f2022%2f10%2f27%2f2091792963939%2fCOLBERT_1329_2997DF_1920X1080_178_2CH_PRORESHQ.mov_1738998_*~data=hdntl~hmac=72d428123f6fac6e8d53a3ae2ee6b716276bfff1b489ca9a1a478e0ff154a3f7"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 244
[download] Destination: The Late Show - 10⧸31⧸22 (Jennifer Hudson, Zosia Mamet) [6yhZR67ZyC8Nsdyk9wWOXf6g7FRDVr68].mp4
[download]   0.4% of ~   1.35GiB at   11.42MiB/s ETA 02:00 (frag 1/244)ERROR: function missing required argument 'counter' (pos 4)
Traceback (most recent call last):
  File "/home/rich/yt-dlp/yt_dlp/YoutubeDL.py", line 1478, in wrapper
    return func(self, *args, **kwargs)
  File "/home/rich/yt-dlp/yt_dlp/YoutubeDL.py", line 1575, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/home/rich/yt-dlp/yt_dlp/YoutubeDL.py", line 1634, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
  File "/home/rich/yt-dlp/yt_dlp/YoutubeDL.py", line 2731, in process_video_result
    self.process_info(new_info)
  File "/home/rich/yt-dlp/yt_dlp/YoutubeDL.py", line 3194, in process_info
    success, real_download = self.dl(temp_filename, info_dict)
  File "/home/rich/yt-dlp/yt_dlp/YoutubeDL.py", line 2918, in dl
    return fd.download(name, new_info, subtitle)
  File "/home/rich/yt-dlp/yt_dlp/downloader/common.py", line 446, in download
    ret = self.real_download(filename, info_dict)
  File "/home/rich/yt-dlp/yt_dlp/downloader/hls.py", line 354, in real_download
    return self.download_and_append_fragments(ctx, fragments, info_dict)
  File "/home/rich/yt-dlp/yt_dlp/downloader/fragment.py", line 521, in download_and_append_fragments
    decrypt_fragment(fragment, self._read_fragment(ctx)), fragment['frag_index'], ctx)
  File "/home/rich/yt-dlp/yt_dlp/downloader/fragment.py", line 369, in decrypt_fragment
    return unpad_pkcs7(aes_cbc_decrypt_bytes(frag_content, decrypt_info['KEY'], iv))
  File "/home/rich/yt-dlp/yt_dlp/aes.py", line 11, in aes_cbc_decrypt_bytes
    return Cryptodome_AES.new(key, Cryptodome_AES.MODE_CBC, iv).decrypt(data)
  File "/usr/lib/python3/dist-packages/Crypto/Cipher/AES.py", line 94, in new
    return AESCipher(key, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/Crypto/Cipher/AES.py", line 59, in __init__
    blockalgo.BlockAlgo.__init__(self, _AES, key, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/Crypto/Cipher/blockalgo.py", line 141, in __init__
    self._cipher = factory.new(key, *args, **kwargs)
TypeError: function missing required argument 'counter' (pos 4)

Exception ignored in: <_io.FileIO name=3 mode='wb' closefd=True>
ResourceWarning: unclosed file <_io.BufferedWriter name=3>
gamer191 commented 1 year ago

The example url gives a 404 error in my web browser, and attempting to download it with yt-dlp returns

ERROR: [CBS] 6yhZR67ZyC8Nsdyk9wWOXf6g7FRDVr68: This content expired on 2/9/23 12:15 AM.

goldirocks commented 1 year ago

Belatedly, the problem was worked around by actually installing pycryptodome and not relying on the wrapper fallback for if you don't have it, then turning off -Werror (since the version of it bundled in Ubuntu 20.04 triggers warnings on using the imp module).

Just in case anyone else hits this.