Repository: yt-dlp/yt-dlp

Issue:
[Bug] ERROR: Data must be padded to 16 byte boundary in CBC mode
@pukkandan

I'm getting this error when I use aria2 as external downloader what does it mean? What can I do to fix this?

The whole segments are downloaded without error but only at the end when it suppose to merge to a mp4 file this error occurs and then it won't even start merging it directly aborts the processes. (mp4.part file is 0B)

**Verbose Log:**
https://pastebin.com/raw/DBvk1gTb

### playlist item 62

```
yt-dlp 'URL' --fragment-retries infinite --cookies "vrv.co_cookies.txt" --playlist-items '62' -f 'best[format_id*=hls-audio-ja-JP]' --username 'Username' --password 'password' --all-subs --remux mkv --embed-subs --force-ipv4 -o '%(series)s/%(series)s - %(episode_number)s/%(series)s - %(episode_number)s.%(ext)s' --external-downloader aria2c --external-downloader-args aria2c:'-x 16 --max-tries=1000000000 --log-level=error --log=log.txt'
```
[Bug] ERROR: Data must be padded to 16 byte boundary in CBC mode
@pukkandan

I'm getting this error when I use aria2 as external downloader what does it mean? What can I do to fix this?

The whole segments are downloaded without error but only at the end when it suppose to merge to a mp4 file this error occurs and then it won't even start merging it directly aborts the processes. (mp4.part file is 0B)

**Verbose Log:**
https://pastebin.com/raw/DBvk1gTb

### playlist item 62

```
yt-dlp 'URL' --fragment-retries infinite --cookies "vrv.co_cookies.txt" --playlist-items '62' -f 'best[format_id*=hls-audio-ja-JP]' --username 'Username' --password 'password' --all-subs --remux mkv --embed-subs --force-ipv4 -o '%(series)s/%(series)s - %(episode_number)s/%(series)s - %(episode_number)s.%(ext)s' --external-downloader aria2c --external-downloader-args aria2c:'-x 16 --max-tries=1000000000 --log-level=error --log=log.txt'
```


Discussion:
Log is missing
I'll provide one no worries.
So this one does not work with aria2c
```
[debug] Command-line config: ['-o', '%(series)s__S%(season_number)02dE%(episode_number)02d__%(title)s_[WEBDL].%(ext)s', '-u', 'PRIVATE', '-p', 'PRIVATE', '--downloader', 'dash,m3u8:aria2c', '-f', 'best[format_id*=hardsub-en-US]/best[format_id!*=hardsub]/best', '--cookies-from-browser', 'chrome', '--restrict-filenames', '--ffmpeg-location', 'D:\\ffmpeg301', '--sub-langs', 'en.*', '--write-sub', '--convert-subs', 'ass', '--verbose', 'https://vrv.co/watch/G60X100VR\r']
[Cookies] Extracting cookies from chrome
[debug] extracting from: "C:\Users\Sipherdrakon\AppData\Local\Google\Chrome\User Data\Default\Cookies"
[Cookies] Extracted 3089 cookies from chrome
[debug] Encodings: locale cp1252, fs utf-8, out cp1252, pref cp1252
[debug] yt-dlp version 2021.09.02 (exe)
[debug] Python version 3.8.10 (CPython 64bit) - Windows-10-10.0.18363-SP0
[debug] exe versions: ffmpeg 3.0.1, ffprobe 3.0.1
[debug] Optional libraries: mutagen, pycryptodome, sqlite, websockets
[debug] Proxy map: {}
[vrv] None: Downloading webpage
[vrv] Downloading Token Credentials JSON metadata
[debug] [vrv] Extracting URL: https://vrv.co/watch/G60X100VR
[vrv] G60X100VR: Downloading resource path JSON metadata
[vrv] G60X100VR: Downloading CMS Signing JSON metadata
[vrv] G60X100VR: Downloading object JSON metadata
[vrv] G60X100VR: Downloading video JSON metadata
[vrv] G60X100VR: Downloading streams JSON metadata
[vrv] G60X100VR: Downloading dash-audio-ja-JP information
[vrv] G60X100VR: Downloading hls-audio-ja-JP information
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, vcodec:vp9.2(10), acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[debug] Downloading subtitles: en-US
[info] G60X100VR: Downloading 1 format(s): hls-audio-ja-JP-8122-1
[info] Writing video subtitles to: Gatchaman_II__S00E52__The_Downfall_of_Leader_X_[WEBDL].en-US.vtt
[debug] Invoking downloader on "https://v.vrv.co/evs/24ae8067dedd8bfc40e4d17a5a1469d6/assets/920d37e26a5f6f6ee05e39647b08ccfb_timed_text_subtitle_en-US.vtt?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cCo6Ly92LnZydi5jby9ldnMvMjRhZTgwNjdkZWRkOGJmYzQwZTRkMTdhNWExNDY5ZDYvYXNzZXRzLzkyMGQzN2UyNmE1ZjZmNmVlMDVlMzk2NDdiMDhjY2ZiX3RpbWVkX3RleHRfc3VidGl0bGVfZW4tVVMudnR0IiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNjMyMDMyOTUyfX19XX0_&Signature=gMEwbfc5qFdTlD6~BPvIq6pcL5fk0kEevslf78nfZeBqxlgN9yMeHXw1KiVkSkdedNF1a6UOnbiyH3BCCoY6oV3d95zW9Est1HdAD5vhBn7akykNyPTx1vzSk3xmln5tyeCaL9zYZ8IoFgXkZWyRc0tLVwFIgiiJ-dd1pyBZaUwbEct-mCCBDlZG1CT9rLCOj5gim23cdCJFujBKwK1qrNd0aXLNqjLieGd9VaqghcUJA3JBm827N1UcWHtJPN~f1-HF987KB3FxA5bUv~Q74oF0jz86RokIRwVbTUSmU0fFEM7QK3bzYZqv5TSuyRsnt0EeyRCZeC~MG57zZO0E8g__&Key-Pair-Id=APKAJMWSQ5S7ZB3MF5VA"
[download] Destination: Gatchaman_II__S00E52__The_Downfall_of_Leader_X_[WEBDL].en-US.vtt
[download] 100% of 27.20KiB in 00:00
[SubtitlesConvertor] Converting subtitles
[debug] ffmpeg command line: "D:\ffmpeg301\ffmpeg" -y -loglevel "repeat+info" -i "file:Gatchaman_II__S00E52__The_Downfall_of_Leader_X_[WEBDL].en-US.vtt" -f ass "file:Gatchaman_II__S00E52__The_Downfall_of_Leader_X_[WEBDL].en-US.ass"
Deleting original file Gatchaman_II__S00E52__The_Downfall_of_Leader_X_[WEBDL].en-US.vtt (pass -k to keep)
[debug] Invoking downloader on "https://pl.crunchyroll.com/evs1/24ae8067dedd8bfc40e4d17a5a1469d6/assets/920d37e26a5f6f6ee05e39647b08ccfb_38085046_1080.mp4/index-v1-a1.m3u8?Expires=1632039996&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9wbC5jcnVuY2h5cm9sbC5jb20vZXZzMS8yNGFlODA2N2RlZGQ4YmZjNDBlNGQxN2E1YTE0NjlkNi9hc3NldHMvOTIwZDM3ZTI2YTVmNmY2ZWUwNWUzOTY0N2IwOGNjZmJfKi5tM3U4PyoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2MzIwMzk5OTZ9fX1dfQ__&Signature=h9iqBc-eBidnbnF-qG4nB~MiSk4gODvMb5gl0zrZhZYxGJ7nv3HKfGuVzTXnoTr2O7a2eK32MM7IUKDSJ5YdkScQ99z6-0jFcNl~FfIcJJkU07KBZjuiZY1p~cOj5S8~eXDo4TMAMTv4Pp3FcT4y7ZUbfWeqqDFHohLcGMYoKLQqUIlnaW~5FfV0tQq7qQqU5F3P9YJAgCA3w-Zbji1kkgrySwfBBCa2ICSaogLDSd0J0bi9fC6GueIpdKH8eNKKXvn2cWuCF8dbFwi69tcJwTNa18mcmtzbsgSlzUhxucNcuikl9EEXG~XhEweUw5LVsoe6IXczHFadDUwNHZMFDg__&Key-Pair-Id=APKAJMWSQ5S7ZB3MF5VA&cdn=ll-prod"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Fragment downloads will be delegated to aria2c
[hlsnative] Total fragments: 701
[download] Destination: Gatchaman_II__S00E52__The_Downfall_of_Leader_X_[WEBDL].mp4
[debug] aria2c command line: aria2c -c "--console-log-level=warn" "--summary-interval=0" "--download-result=hide" "--file-allocation=none" -x16 -j16 -s16 "--allow-overwrite=true" "--allow-piece-length-change=true" --header "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3759.5 Safari/537.36" --header "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" --header "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" --header "Accept-Encoding: gzip, deflate" --header "Accept-Language: en-us,en;q=0.5" --header "Cookie: VILOS_DRM_ROLLOUT=9d5ed678fe57bcca610140957afab571_1; __cf_bm=IbFOidZfOH4CFZU.aqkoD1WxZQklag_bDplaYPxAPso-1631823461-0-AdP/zC4H4J33FEYugDHTcrmVxiptRnmLHcXQTLkhFNqin4wbH10uqw/w1aV11JaMrDD239TKjnzkoEQRv8C9iYKhe6jA9HgkaFx0/syfGzbL; __utma=91784648.1829331791.1607297886.1607297930.1607297930.1; _ga=GA1.2.1829331791.1607297886; _gcl_au=1.1.1964847412.1624418220; ajs_anonymous_id=%221198a070-dcfe-41ba-be02-464ff0681043%22; c_visitor=f6da0fdd-4c9c-42ec-add0-fbf5ed67995b; cto_bundle=XDDGeF9qR2NTVVVnR2hVbCUyQkh2TldzdmplRDRCeFVjMkJOZFhkJTJCMUJ1Zk1QVUcxUHdSZjRXY0xycnFTcVB3OTRiSjFicWZDbyUyRjlEYWgxeFNtY2RybEYzV1BoMTVSVzYyWXB3RHRodzNvanhERjlsRkhlZWdDOWhnbzB1V3FMUnZ5bjVNWnZHb0g3UW1GZ2VNZWxEVkxFbHJ3aEElM0QlM0Q" "--check-certificate=true" "--remote-time=true" "--auto-file-renaming=false" "--file-allocation=none" "--uri-selector=inorder" -i "Gatchaman_II__S00E52__The_Downfall_of_Leader_X_[WEBDL].mp4.part.frag.urls"
[DL:0B][#da1d12 0B/0B][#e1b1fe 0B/0B][#5bdc6e 0B/0B]ERROR: Data must be padded to 16 byte boundary in CBC mode
Traceback (most recent call last):
  File "yt_dlp\YoutubeDL.py", line 1214, in wrapper
  File "yt_dlp\YoutubeDL.py", line 1252, in __extract_info
  File "yt_dlp\YoutubeDL.py", line 1298, in process_ie_result
  File "yt_dlp\YoutubeDL.py", line 2320, in process_video_result
  File "yt_dlp\YoutubeDL.py", line 2798, in process_info
  File "yt_dlp\YoutubeDL.py", line 2461, in dl
  File "yt_dlp\downloader\common.py", line 386, in download
  File "yt_dlp\downloader\hls.py", line 251, in real_download
  File "yt_dlp\downloader\external.py", line 47, in real_download
  File "yt_dlp\downloader\external.py", line 167, in _call_downloader
  File "Crypto\Cipher\_mode_cbc.py", line 246, in decrypt
ValueError: Data must be padded to 16 byte boundary in CBC mode
```
But this one and many others do

```
[debug] Command-line config: ['-o', '%(series)s__S%(season_number)02dE%(episode_number)02d__%(title)s_[WEBDL].%(ext)s', '-u', 'PRIVATE', '-p', 'PRIVATE', '--downloader', 'dash,m3u8:aria2c', '-f', 'best[format_id*=hardsub-en-US]/best[format_id!*=hardsub]/best', '--cookies-from-browser', 'chrome', '--restrict-filenames', '--ffmpeg-location', 'D:\\ffmpeg301', '--sub-langs', 'en.*', '--write-sub', '--convert-subs', 'ass', '--verbose', 'https://vrv.co/watch/G64PMJ0JR']
[Cookies] Extracting cookies from chrome
[debug] extracting from: "C:\Users\Sipherdrakon\AppData\Local\Google\Chrome\User Data\Default\Cookies"
[Cookies] Extracted 3088 cookies from chrome
[debug] Encodings: locale cp1252, fs utf-8, out cp1252, pref cp1252
[debug] yt-dlp version 2021.09.02 (exe)
[debug] Python version 3.8.10 (CPython 64bit) - Windows-10-10.0.18363-SP0
[debug] exe versions: ffmpeg 3.0.1, ffprobe 3.0.1
[debug] Optional libraries: mutagen, pycryptodome, sqlite, websockets
[debug] Proxy map: {}
[vrv] None: Downloading webpage
[vrv] Downloading Token Credentials JSON metadata
[debug] [vrv] Extracting URL: https://vrv.co/watch/G64PMJ0JR
[vrv] G64PMJ0JR: Downloading resource path JSON metadata
[vrv] G64PMJ0JR: Downloading CMS Signing JSON metadata
[vrv] G64PMJ0JR: Downloading object JSON metadata
[vrv] G64PMJ0JR: Downloading video JSON metadata
[vrv] G64PMJ0JR: Downloading streams JSON metadata
[vrv] G64PMJ0JR: Downloading dash-audio-ja-JP information
[vrv] G64PMJ0JR: Downloading hls-audio-ja-JP information
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, vcodec:vp9.2(10), acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[debug] Downloading subtitles: en-US
[info] G64PMJ0JR: Downloading 1 format(s): hls-audio-ja-JP-8121-1
[info] Writing video subtitles to: Softenni__S00E01__Morning_Practice_[WEBDL].en-US.vtt
[debug] Invoking downloader on "https://v.vrv.co/evs/a0718e4631bf5833f0899bb8f24c1d4b/assets/d187440739a9161091dd16bbca276534_timed_text_subtitle_en-US.vtt?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cCo6Ly92LnZydi5jby9ldnMvYTA3MThlNDYzMWJmNTgzM2YwODk5YmI4ZjI0YzFkNGIvYXNzZXRzL2QxODc0NDA3MzlhOTE2MTA5MWRkMTZiYmNhMjc2NTM0X3RpbWVkX3RleHRfc3VidGl0bGVfZW4tVVMudnR0IiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNjMyMDI1NTczfX19XX0_&Signature=IkTanYo56qAb-hXdf6hn6kbFfC1CKdbRWMyTb-M8Mb4ormht5gNOPhmDT5w~8sD3A4VODDqAy6Yjlbpf3eh-CS1qaoBP3tZweubZ77O-rKV1Rvsbmmx8GMA~JaiB1rNjwsyw0OIfcU5cyeE9vI3ollVPewBpFdnWNtsjVHC-6Q2BReIAxNAzIwJJutZI27YZwlUHtbdlwfZUKZUVNLBNuuMDhL5H-6-mXGqJInCfydzNrjzj4-vOrk2TV0UjVKNHgq2dfxRE6wROPOchL9Mtr2f6ttZSOpft1qSRUuP6MdMKMoA70RYBOb3D40vJpjJS82MTLocozMZUqZJswVHCzw__&Key-Pair-Id=APKAJMWSQ5S7ZB3MF5VA"
[download] Destination: Softenni__S00E01__Morning_Practice_[WEBDL].en-US.vtt
[download] 100% of 59.28KiB in 00:00
[SubtitlesConvertor] Converting subtitles
[debug] ffmpeg command line: "D:\ffmpeg301\ffmpeg" -y -loglevel "repeat+info" -i "file:Softenni__S00E01__Morning_Practice_[WEBDL].en-US.vtt" -f ass "file:Softenni__S00E01__Morning_Practice_[WEBDL].en-US.ass"
Deleting original file Softenni__S00E01__Morning_Practice_[WEBDL].en-US.vtt (pass -k to keep)
[debug] Invoking downloader on "https://pl.crunchyroll.com/evs1/a0718e4631bf5833f0899bb8f24c1d4b/assets/d187440739a9161091dd16bbca276534_38048858_1080.mp4/index-v1-a1.m3u8?Expires=1632040282&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9wbC5jcnVuY2h5cm9sbC5jb20vZXZzMS9hMDcxOGU0NjMxYmY1ODMzZjA4OTliYjhmMjRjMWQ0Yi9hc3NldHMvZDE4NzQ0MDczOWE5MTYxMDkxZGQxNmJiY2EyNzY1MzRfKi5tM3U4PyoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2MzIwNDAyODJ9fX1dfQ__&Signature=H9Yn3SE2T~TPKM6nFzt0FiO3enxJbgmTanXfbq1Ge7deue1hYCvzdAVZNBGK765dDtTyu7AWPO-pNoQVTuAZbQSoPm4Ue3DbXtIBc5ZUJ~lUd2zR70pecwqI5RsDXFYUy-fReKPR1xPT2ue1NsMnortD9adjmkb0QsqD3jA6DKdQbe-Q1KcCk~qD5LXn6jEtblXu1LYYEdvO31AOYiNfGh6pbt3frsT2Bzet8xWGNEKEFeBkmZ~Qun~dfZzZKOudu6Pup19utxN-6cDsGzENTJJ063qmTNGJ3oYmZHD6byTA5yU0qhYLaFScS8aZnmhxX33ZQQTyo8jpGRjVKrrtxA__&Key-Pair-Id=APKAJMWSQ5S7ZB3MF5VA&cdn=fy-prod"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Fragment downloads will be delegated to aria2c
[hlsnative] Total fragments: 733
[download] Destination: Softenni__S00E01__Morning_Practice_[WEBDL].mp4
[debug] aria2c command line: aria2c -c "--console-log-level=warn" "--summary-interval=0" "--download-result=hide" "--file-allocation=none" -x16 -j16 -s16 "--allow-overwrite=true" "--allow-piece-length-change=true" --header "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3667.2 Safari/537.36" --header "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" --header "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" --header "Accept-Encoding: gzip, deflate" --header "Accept-Language: en-us,en;q=0.5" --header "Cookie: VILOS_DRM_ROLLOUT=9d5ed678fe57bcca610140957afab571_1; __cf_bm=IbFOidZfOH4CFZU.aqkoD1WxZQklag_bDplaYPxAPso-1631823461-0-AdP/zC4H4J33FEYugDHTcrmVxiptRnmLHcXQTLkhFNqin4wbH10uqw/w1aV11JaMrDD239TKjnzkoEQRv8C9iYKhe6jA9HgkaFx0/syfGzbL; __utma=91784648.1829331791.1607297886.1607297930.1607297930.1; _ga=GA1.2.1829331791.1607297886; _gcl_au=1.1.1964847412.1624418220; ajs_anonymous_id=%221198a070-dcfe-41ba-be02-464ff0681043%22; c_visitor=f6da0fdd-4c9c-42ec-add0-fbf5ed67995b; cto_bundle=XDDGeF9qR2NTVVVnR2hVbCUyQkh2TldzdmplRDRCeFVjMkJOZFhkJTJCMUJ1Zk1QVUcxUHdSZjRXY0xycnFTcVB3OTRiSjFicWZDbyUyRjlEYWgxeFNtY2RybEYzV1BoMTVSVzYyWXB3RHRodzNvanhERjlsRkhlZWdDOWhnbzB1V3FMUnZ5bjVNWnZHb0g3UW1GZ2VNZWxEVkxFbHJ3aEElM0QlM0Q" "--check-certificate=true" "--remote-time=true" "--auto-file-renaming=false" "--file-allocation=none" "--uri-selector=inorder" -i "Softenni__S00E01__Morning_Practice_[WEBDL].mp4.part.frag.urls"
[aria2c] Downloaded 1530225472 bytes)][#043d71 2.1MiB/3.0MiB(69%)][#b192f7 2.3M
[download] 100% of 1.43GiB in 00:49
[debug] ffmpeg command line: "D:\ffmpeg301\ffprobe" -show_streams "file:Softenni__S00E01__Morning_Practice_[WEBDL].mp4"
[FixupM3u8] Fixing malformed AAC bitstream of "Softenni__S00E01__Morning_Practice_[WEBDL].mp4"
[debug] ffmpeg command line: "D:\ffmpeg301\ffmpeg" -y -loglevel "repeat+info" -i "file:Softenni__S00E01__Morning_Practice_[WEBDL].mp4" -c copy -map 0 -dn -f mp4 "-bsf:a" aac_adtstoasc "file:Softenni__S00E01__Morning_Practice_[WEBDL].temp.mp4"
```
~~This may fix it, but I don't have an account to test.~~

**EDIT**: I started a trial and confirmed the patch works.

```diff
diff --git a/yt_dlp/downloader/external.py b/yt_dlp/downloader/external.py
index 9db248df4..b758b0e25 100644
--- a/yt_dlp/downloader/external.py
+++ b/yt_dlp/downloader/external.py
@@ -8,6 +8,7 @@ import time
 
 try:
     from Crypto.Cipher import AES
+    from Crypto.Util.Padding import pad
     can_decrypt_frag = True
 except ImportError:
     can_decrypt_frag = False
@@ -165,7 +166,7 @@ class ExternalFD(FileDownloader):
                             self._prepare_url(info_dict, info_dict.get('_decryption_key_url') or decrypt_info['URI'])).read()
                         encrypted_data = src.read()
                         decrypted_data = AES.new(
-                            decrypt_info['KEY'], AES.MODE_CBC, iv).decrypt(encrypted_data)
+                            decrypt_info['KEY'], AES.MODE_CBC, iv).decrypt(pad(encrypted_data, 16))
                         dest.write(decrypted_data)
                     else:
                         fragment_data = src.read()
```
Sweet, I was going to test it when i woke up, but you beat me to it. :-) Thank you.
Please don't copy your comments on both the issue and PR. Keep the discussion ~~either here or~~ there, but not spread b/w both
Log is missing
I'll provide one no worries.
So this one does not work with aria2c
```
[debug] Command-line config: ['-o', '%(series)s__S%(season_number)02dE%(episode_number)02d__%(title)s_[WEBDL].%(ext)s', '-u', 'PRIVATE', '-p', 'PRIVATE', '--downloader', 'dash,m3u8:aria2c', '-f', 'best[format_id*=hardsub-en-US]/best[format_id!*=hardsub]/best', '--cookies-from-browser', 'chrome', '--restrict-filenames', '--ffmpeg-location', 'D:\\ffmpeg301', '--sub-langs', 'en.*', '--write-sub', '--convert-subs', 'ass', '--verbose', 'https://vrv.co/watch/G60X100VR\r']
[Cookies] Extracting cookies from chrome
[debug] extracting from: "C:\Users\Sipherdrakon\AppData\Local\Google\Chrome\User Data\Default\Cookies"
[Cookies] Extracted 3089 cookies from chrome
[debug] Encodings: locale cp1252, fs utf-8, out cp1252, pref cp1252
[debug] yt-dlp version 2021.09.02 (exe)
[debug] Python version 3.8.10 (CPython 64bit) - Windows-10-10.0.18363-SP0
[debug] exe versions: ffmpeg 3.0.1, ffprobe 3.0.1
[debug] Optional libraries: mutagen, pycryptodome, sqlite, websockets
[debug] Proxy map: {}
[vrv] None: Downloading webpage
[vrv] Downloading Token Credentials JSON metadata
[debug] [vrv] Extracting URL: https://vrv.co/watch/G60X100VR
[vrv] G60X100VR: Downloading resource path JSON metadata
[vrv] G60X100VR: Downloading CMS Signing JSON metadata
[vrv] G60X100VR: Downloading object JSON metadata
[vrv] G60X100VR: Downloading video JSON metadata
[vrv] G60X100VR: Downloading streams JSON metadata
[vrv] G60X100VR: Downloading dash-audio-ja-JP information
[vrv] G60X100VR: Downloading hls-audio-ja-JP information
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, vcodec:vp9.2(10), acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[debug] Downloading subtitles: en-US
[info] G60X100VR: Downloading 1 format(s): hls-audio-ja-JP-8122-1
[info] Writing video subtitles to: Gatchaman_II__S00E52__The_Downfall_of_Leader_X_[WEBDL].en-US.vtt
[debug] Invoking downloader on "https://v.vrv.co/evs/24ae8067dedd8bfc40e4d17a5a1469d6/assets/920d37e26a5f6f6ee05e39647b08ccfb_timed_text_subtitle_en-US.vtt?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cCo6Ly92LnZydi5jby9ldnMvMjRhZTgwNjdkZWRkOGJmYzQwZTRkMTdhNWExNDY5ZDYvYXNzZXRzLzkyMGQzN2UyNmE1ZjZmNmVlMDVlMzk2NDdiMDhjY2ZiX3RpbWVkX3RleHRfc3VidGl0bGVfZW4tVVMudnR0IiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNjMyMDMyOTUyfX19XX0_&Signature=gMEwbfc5qFdTlD6~BPvIq6pcL5fk0kEevslf78nfZeBqxlgN9yMeHXw1KiVkSkdedNF1a6UOnbiyH3BCCoY6oV3d95zW9Est1HdAD5vhBn7akykNyPTx1vzSk3xmln5tyeCaL9zYZ8IoFgXkZWyRc0tLVwFIgiiJ-dd1pyBZaUwbEct-mCCBDlZG1CT9rLCOj5gim23cdCJFujBKwK1qrNd0aXLNqjLieGd9VaqghcUJA3JBm827N1UcWHtJPN~f1-HF987KB3FxA5bUv~Q74oF0jz86RokIRwVbTUSmU0fFEM7QK3bzYZqv5TSuyRsnt0EeyRCZeC~MG57zZO0E8g__&Key-Pair-Id=APKAJMWSQ5S7ZB3MF5VA"
[download] Destination: Gatchaman_II__S00E52__The_Downfall_of_Leader_X_[WEBDL].en-US.vtt
[download] 100% of 27.20KiB in 00:00
[SubtitlesConvertor] Converting subtitles
[debug] ffmpeg command line: "D:\ffmpeg301\ffmpeg" -y -loglevel "repeat+info" -i "file:Gatchaman_II__S00E52__The_Downfall_of_Leader_X_[WEBDL].en-US.vtt" -f ass "file:Gatchaman_II__S00E52__The_Downfall_of_Leader_X_[WEBDL].en-US.ass"
Deleting original file Gatchaman_II__S00E52__The_Downfall_of_Leader_X_[WEBDL].en-US.vtt (pass -k to keep)
[debug] Invoking downloader on "https://pl.crunchyroll.com/evs1/24ae8067dedd8bfc40e4d17a5a1469d6/assets/920d37e26a5f6f6ee05e39647b08ccfb_38085046_1080.mp4/index-v1-a1.m3u8?Expires=1632039996&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9wbC5jcnVuY2h5cm9sbC5jb20vZXZzMS8yNGFlODA2N2RlZGQ4YmZjNDBlNGQxN2E1YTE0NjlkNi9hc3NldHMvOTIwZDM3ZTI2YTVmNmY2ZWUwNWUzOTY0N2IwOGNjZmJfKi5tM3U4PyoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2MzIwMzk5OTZ9fX1dfQ__&Signature=h9iqBc-eBidnbnF-qG4nB~MiSk4gODvMb5gl0zrZhZYxGJ7nv3HKfGuVzTXnoTr2O7a2eK32MM7IUKDSJ5YdkScQ99z6-0jFcNl~FfIcJJkU07KBZjuiZY1p~cOj5S8~eXDo4TMAMTv4Pp3FcT4y7ZUbfWeqqDFHohLcGMYoKLQqUIlnaW~5FfV0tQq7qQqU5F3P9YJAgCA3w-Zbji1kkgrySwfBBCa2ICSaogLDSd0J0bi9fC6GueIpdKH8eNKKXvn2cWuCF8dbFwi69tcJwTNa18mcmtzbsgSlzUhxucNcuikl9EEXG~XhEweUw5LVsoe6IXczHFadDUwNHZMFDg__&Key-Pair-Id=APKAJMWSQ5S7ZB3MF5VA&cdn=ll-prod"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Fragment downloads will be delegated to aria2c
[hlsnative] Total fragments: 701
[download] Destination: Gatchaman_II__S00E52__The_Downfall_of_Leader_X_[WEBDL].mp4
[debug] aria2c command line: aria2c -c "--console-log-level=warn" "--summary-interval=0" "--download-result=hide" "--file-allocation=none" -x16 -j16 -s16 "--allow-overwrite=true" "--allow-piece-length-change=true" --header "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3759.5 Safari/537.36" --header "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" --header "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" --header "Accept-Encoding: gzip, deflate" --header "Accept-Language: en-us,en;q=0.5" --header "Cookie: VILOS_DRM_ROLLOUT=9d5ed678fe57bcca610140957afab571_1; __cf_bm=IbFOidZfOH4CFZU.aqkoD1WxZQklag_bDplaYPxAPso-1631823461-0-AdP/zC4H4J33FEYugDHTcrmVxiptRnmLHcXQTLkhFNqin4wbH10uqw/w1aV11JaMrDD239TKjnzkoEQRv8C9iYKhe6jA9HgkaFx0/syfGzbL; __utma=91784648.1829331791.1607297886.1607297930.1607297930.1; _ga=GA1.2.1829331791.1607297886; _gcl_au=1.1.1964847412.1624418220; ajs_anonymous_id=%221198a070-dcfe-41ba-be02-464ff0681043%22; c_visitor=f6da0fdd-4c9c-42ec-add0-fbf5ed67995b; cto_bundle=XDDGeF9qR2NTVVVnR2hVbCUyQkh2TldzdmplRDRCeFVjMkJOZFhkJTJCMUJ1Zk1QVUcxUHdSZjRXY0xycnFTcVB3OTRiSjFicWZDbyUyRjlEYWgxeFNtY2RybEYzV1BoMTVSVzYyWXB3RHRodzNvanhERjlsRkhlZWdDOWhnbzB1V3FMUnZ5bjVNWnZHb0g3UW1GZ2VNZWxEVkxFbHJ3aEElM0QlM0Q" "--check-certificate=true" "--remote-time=true" "--auto-file-renaming=false" "--file-allocation=none" "--uri-selector=inorder" -i "Gatchaman_II__S00E52__The_Downfall_of_Leader_X_[WEBDL].mp4.part.frag.urls"
[DL:0B][#da1d12 0B/0B][#e1b1fe 0B/0B][#5bdc6e 0B/0B]ERROR: Data must be padded to 16 byte boundary in CBC mode
Traceback (most recent call last):
  File "yt_dlp\YoutubeDL.py", line 1214, in wrapper
  File "yt_dlp\YoutubeDL.py", line 1252, in __extract_info
  File "yt_dlp\YoutubeDL.py", line 1298, in process_ie_result
  File "yt_dlp\YoutubeDL.py", line 2320, in process_video_result
  File "yt_dlp\YoutubeDL.py", line 2798, in process_info
  File "yt_dlp\YoutubeDL.py", line 2461, in dl
  File "yt_dlp\downloader\common.py", line 386, in download
  File "yt_dlp\downloader\hls.py", line 251, in real_download
  File "yt_dlp\downloader\external.py", line 47, in real_download
  File "yt_dlp\downloader\external.py", line 167, in _call_downloader
  File "Crypto\Cipher\_mode_cbc.py", line 246, in decrypt
ValueError: Data must be padded to 16 byte boundary in CBC mode
```
But this one and many others do

```
[debug] Command-line config: ['-o', '%(series)s__S%(season_number)02dE%(episode_number)02d__%(title)s_[WEBDL].%(ext)s', '-u', 'PRIVATE', '-p', 'PRIVATE', '--downloader', 'dash,m3u8:aria2c', '-f', 'best[format_id*=hardsub-en-US]/best[format_id!*=hardsub]/best', '--cookies-from-browser', 'chrome', '--restrict-filenames', '--ffmpeg-location', 'D:\\ffmpeg301', '--sub-langs', 'en.*', '--write-sub', '--convert-subs', 'ass', '--verbose', 'https://vrv.co/watch/G64PMJ0JR']
[Cookies] Extracting cookies from chrome
[debug] extracting from: "C:\Users\Sipherdrakon\AppData\Local\Google\Chrome\User Data\Default\Cookies"
[Cookies] Extracted 3088 cookies from chrome
[debug] Encodings: locale cp1252, fs utf-8, out cp1252, pref cp1252
[debug] yt-dlp version 2021.09.02 (exe)
[debug] Python version 3.8.10 (CPython 64bit) - Windows-10-10.0.18363-SP0
[debug] exe versions: ffmpeg 3.0.1, ffprobe 3.0.1
[debug] Optional libraries: mutagen, pycryptodome, sqlite, websockets
[debug] Proxy map: {}
[vrv] None: Downloading webpage
[vrv] Downloading Token Credentials JSON metadata
[debug] [vrv] Extracting URL: https://vrv.co/watch/G64PMJ0JR
[vrv] G64PMJ0JR: Downloading resource path JSON metadata
[vrv] G64PMJ0JR: Downloading CMS Signing JSON metadata
[vrv] G64PMJ0JR: Downloading object JSON metadata
[vrv] G64PMJ0JR: Downloading video JSON metadata
[vrv] G64PMJ0JR: Downloading streams JSON metadata
[vrv] G64PMJ0JR: Downloading dash-audio-ja-JP information
[vrv] G64PMJ0JR: Downloading hls-audio-ja-JP information
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, vcodec:vp9.2(10), acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[debug] Downloading subtitles: en-US
[info] G64PMJ0JR: Downloading 1 format(s): hls-audio-ja-JP-8121-1
[info] Writing video subtitles to: Softenni__S00E01__Morning_Practice_[WEBDL].en-US.vtt
[debug] Invoking downloader on "https://v.vrv.co/evs/a0718e4631bf5833f0899bb8f24c1d4b/assets/d187440739a9161091dd16bbca276534_timed_text_subtitle_en-US.vtt?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cCo6Ly92LnZydi5jby9ldnMvYTA3MThlNDYzMWJmNTgzM2YwODk5YmI4ZjI0YzFkNGIvYXNzZXRzL2QxODc0NDA3MzlhOTE2MTA5MWRkMTZiYmNhMjc2NTM0X3RpbWVkX3RleHRfc3VidGl0bGVfZW4tVVMudnR0IiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNjMyMDI1NTczfX19XX0_&Signature=IkTanYo56qAb-hXdf6hn6kbFfC1CKdbRWMyTb-M8Mb4ormht5gNOPhmDT5w~8sD3A4VODDqAy6Yjlbpf3eh-CS1qaoBP3tZweubZ77O-rKV1Rvsbmmx8GMA~JaiB1rNjwsyw0OIfcU5cyeE9vI3ollVPewBpFdnWNtsjVHC-6Q2BReIAxNAzIwJJutZI27YZwlUHtbdlwfZUKZUVNLBNuuMDhL5H-6-mXGqJInCfydzNrjzj4-vOrk2TV0UjVKNHgq2dfxRE6wROPOchL9Mtr2f6ttZSOpft1qSRUuP6MdMKMoA70RYBOb3D40vJpjJS82MTLocozMZUqZJswVHCzw__&Key-Pair-Id=APKAJMWSQ5S7ZB3MF5VA"
[download] Destination: Softenni__S00E01__Morning_Practice_[WEBDL].en-US.vtt
[download] 100% of 59.28KiB in 00:00
[SubtitlesConvertor] Converting subtitles
[debug] ffmpeg command line: "D:\ffmpeg301\ffmpeg" -y -loglevel "repeat+info" -i "file:Softenni__S00E01__Morning_Practice_[WEBDL].en-US.vtt" -f ass "file:Softenni__S00E01__Morning_Practice_[WEBDL].en-US.ass"
Deleting original file Softenni__S00E01__Morning_Practice_[WEBDL].en-US.vtt (pass -k to keep)
[debug] Invoking downloader on "https://pl.crunchyroll.com/evs1/a0718e4631bf5833f0899bb8f24c1d4b/assets/d187440739a9161091dd16bbca276534_38048858_1080.mp4/index-v1-a1.m3u8?Expires=1632040282&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9wbC5jcnVuY2h5cm9sbC5jb20vZXZzMS9hMDcxOGU0NjMxYmY1ODMzZjA4OTliYjhmMjRjMWQ0Yi9hc3NldHMvZDE4NzQ0MDczOWE5MTYxMDkxZGQxNmJiY2EyNzY1MzRfKi5tM3U4PyoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2MzIwNDAyODJ9fX1dfQ__&Signature=H9Yn3SE2T~TPKM6nFzt0FiO3enxJbgmTanXfbq1Ge7deue1hYCvzdAVZNBGK765dDtTyu7AWPO-pNoQVTuAZbQSoPm4Ue3DbXtIBc5ZUJ~lUd2zR70pecwqI5RsDXFYUy-fReKPR1xPT2ue1NsMnortD9adjmkb0QsqD3jA6DKdQbe-Q1KcCk~qD5LXn6jEtblXu1LYYEdvO31AOYiNfGh6pbt3frsT2Bzet8xWGNEKEFeBkmZ~Qun~dfZzZKOudu6Pup19utxN-6cDsGzENTJJ063qmTNGJ3oYmZHD6byTA5yU0qhYLaFScS8aZnmhxX33ZQQTyo8jpGRjVKrrtxA__&Key-Pair-Id=APKAJMWSQ5S7ZB3MF5VA&cdn=fy-prod"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Fragment downloads will be delegated to aria2c
[hlsnative] Total fragments: 733
[download] Destination: Softenni__S00E01__Morning_Practice_[WEBDL].mp4
[debug] aria2c command line: aria2c -c "--console-log-level=warn" "--summary-interval=0" "--download-result=hide" "--file-allocation=none" -x16 -j16 -s16 "--allow-overwrite=true" "--allow-piece-length-change=true" --header "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3667.2 Safari/537.36" --header "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" --header "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" --header "Accept-Encoding: gzip, deflate" --header "Accept-Language: en-us,en;q=0.5" --header "Cookie: VILOS_DRM_ROLLOUT=9d5ed678fe57bcca610140957afab571_1; __cf_bm=IbFOidZfOH4CFZU.aqkoD1WxZQklag_bDplaYPxAPso-1631823461-0-AdP/zC4H4J33FEYugDHTcrmVxiptRnmLHcXQTLkhFNqin4wbH10uqw/w1aV11JaMrDD239TKjnzkoEQRv8C9iYKhe6jA9HgkaFx0/syfGzbL; __utma=91784648.1829331791.1607297886.1607297930.1607297930.1; _ga=GA1.2.1829331791.1607297886; _gcl_au=1.1.1964847412.1624418220; ajs_anonymous_id=%221198a070-dcfe-41ba-be02-464ff0681043%22; c_visitor=f6da0fdd-4c9c-42ec-add0-fbf5ed67995b; cto_bundle=XDDGeF9qR2NTVVVnR2hVbCUyQkh2TldzdmplRDRCeFVjMkJOZFhkJTJCMUJ1Zk1QVUcxUHdSZjRXY0xycnFTcVB3OTRiSjFicWZDbyUyRjlEYWgxeFNtY2RybEYzV1BoMTVSVzYyWXB3RHRodzNvanhERjlsRkhlZWdDOWhnbzB1V3FMUnZ5bjVNWnZHb0g3UW1GZ2VNZWxEVkxFbHJ3aEElM0QlM0Q" "--check-certificate=true" "--remote-time=true" "--auto-file-renaming=false" "--file-allocation=none" "--uri-selector=inorder" -i "Softenni__S00E01__Morning_Practice_[WEBDL].mp4.part.frag.urls"
[aria2c] Downloaded 1530225472 bytes)][#043d71 2.1MiB/3.0MiB(69%)][#b192f7 2.3M
[download] 100% of 1.43GiB in 00:49
[debug] ffmpeg command line: "D:\ffmpeg301\ffprobe" -show_streams "file:Softenni__S00E01__Morning_Practice_[WEBDL].mp4"
[FixupM3u8] Fixing malformed AAC bitstream of "Softenni__S00E01__Morning_Practice_[WEBDL].mp4"
[debug] ffmpeg command line: "D:\ffmpeg301\ffmpeg" -y -loglevel "repeat+info" -i "file:Softenni__S00E01__Morning_Practice_[WEBDL].mp4" -c copy -map 0 -dn -f mp4 "-bsf:a" aac_adtstoasc "file:Softenni__S00E01__Morning_Practice_[WEBDL].temp.mp4"
```
~~This may fix it, but I don't have an account to test.~~

**EDIT**: I started a trial and confirmed the patch works.

```diff
diff --git a/yt_dlp/downloader/external.py b/yt_dlp/downloader/external.py
index 9db248df4..b758b0e25 100644
--- a/yt_dlp/downloader/external.py
+++ b/yt_dlp/downloader/external.py
@@ -8,6 +8,7 @@ import time
 
 try:
     from Crypto.Cipher import AES
+    from Crypto.Util.Padding import pad
     can_decrypt_frag = True
 except ImportError:
     can_decrypt_frag = False
@@ -165,7 +166,7 @@ class ExternalFD(FileDownloader):
                             self._prepare_url(info_dict, info_dict.get('_decryption_key_url') or decrypt_info['URI'])).read()
                         encrypted_data = src.read()
                         decrypted_data = AES.new(
-                            decrypt_info['KEY'], AES.MODE_CBC, iv).decrypt(encrypted_data)
+                            decrypt_info['KEY'], AES.MODE_CBC, iv).decrypt(pad(encrypted_data, 16))
                         dest.write(decrypted_data)
                     else:
                         fragment_data = src.read()
```
Sweet, I was going to test it when i woke up, but you beat me to it. :-) Thank you.
Please don't copy your comments on both the issue and PR. Keep the discussion ~~either here or~~ there, but not spread b/w both

Resolving patch:
diff --git a/yt_dlp/downloader/fragment.py b/yt_dlp/downloader/fragment.py
--- a/yt_dlp/downloader/fragment.py
+++ b/yt_dlp/downloader/fragment.py
@@ -355,7 +355,8 @@ def decrypt_fragment(fragment, frag_content):
             # not what it decrypts to.
             if self.params.get('test', False):
                 return frag_content
-            decrypted_data = aes_cbc_decrypt_bytes(frag_content, decrypt_info['KEY'], iv)
+            padding_len = 16 - (len(frag_content) % 16)
+            decrypted_data = aes_cbc_decrypt_bytes(frag_content + bytes([padding_len] * padding_len), decrypt_info['KEY'], iv)
             return decrypted_data[:-decrypted_data[-1]]
 
         return decrypt_fragment


Test patch: