Repository: yt-dlp/yt-dlp

Issue:
[ADN] Subtitles download support broken
### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2021.12.01**. ([update instructions](https://github.com/yt-dlp/yt-dlp#update))
- [X] I've checked that all provided URLs are alive and playable in a browser
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/ytdl-org/youtube-dl#video-url-contains-an-ampersand-and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues including closed ones. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

France

### Description

I had opened an issue on the yt-dl repo this summer, but since it is inactive, I never received a response.

The problem is that since this summer, it’s impossible to download the subtitles from ADN, for the videos there is no problem. Before, you had to change a key in the code regularly to be able to download them. The method to obtain this key had explained [here](https://github.com/ytdl-org/youtube-dl/issues/12724#issuecomment-481673353) by a contributor.

But since July the key obtained with this method does not change so the subtitles are impossible to download.

Does anyone have a solution to this problem?

Thank you for your help.


### Verbose log

```shell
[debug] Command-line config: ['--username', 'PRIVATE', '--password', 'PRIVATE', '-f', 'best[height=1080]/best', '--all-subs', '-Uv', 'https://animedigitalnetwork.fr/video/boruto-naruto-next-generations/7936-episode-1-boruto-uzumaki']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, err utf-8, pref cp1252
[debug] yt-dlp version 2021.12.01 [91f071a] (win_exe)
[debug] Python version 3.8.10 (CPython 64bit) - Windows-10-10.0.19044-SP0
[debug] exe versions: ffmpeg 2021-09-27-git-b786bc7433-full_build-www.gyan.dev (setts), ffprobe 2021-09-27-git-b786bc7433-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
Latest version: 2021.12.01, Current version: 2021.12.01
yt-dlp is up to date (2021.12.01)
[ADN] Logging in
[debug] [ADN] Extracting URL: https://animedigitalnetwork.fr/video/boruto-naruto-next-generations/7936-episode-1-boruto-uzumaki
[ADN] 7936: Downloading player config JSON metadata
[ADN] 7936: Downloading access token
[ADN] 7936: Downloading links JSON metadata
[ADN] 7936: Downloading links JSON metadata
[ADN] 7936: Downloading vf mobile JSON metadata
[ADN] 7936: Downloading m3u8 information
[ADN] 7936: Downloading vf sd JSON metadata
[ADN] 7936: Downloading m3u8 information
[ADN] 7936: Downloading vf hd JSON metadata
[ADN] 7936: Downloading m3u8 information
[ADN] 7936: Downloading vf fhd JSON metadata
[ADN] 7936: Downloading m3u8 information
[ADN] 7936: Downloading vf auto JSON metadata
[ADN] 7936: Downloading m3u8 information
[ADN] 7936: Downloading vostf mobile JSON metadata
[ADN] 7936: Downloading m3u8 information
[ADN] 7936: Downloading vostf sd JSON metadata
[ADN] 7936: Downloading m3u8 information
[ADN] 7936: Downloading vostf hd JSON metadata
[ADN] 7936: Downloading m3u8 information
[ADN] 7936: Downloading vostf fhd JSON metadata
[ADN] 7936: Downloading m3u8 information
[ADN] 7936: Downloading vostf auto JSON metadata
[ADN] 7936: Downloading m3u8 information
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[ADN] 7936: Downloading additional video metadata
[ADN] 7936: Downloading subtitles location
[ADN] 7936: Downloading subtitles data
ERROR: 'utf-8' codec can't decode byte 0xa2 in position 1: invalid start byte
Traceback (most recent call last):
  File "yt_dlp\YoutubeDL.py", line 1329, in wrapper
  File "yt_dlp\YoutubeDL.py", line 1398, in __extract_info
  File "yt_dlp\extractor\common.py", line 597, in extract
  File "yt_dlp\extractor\adn.py", line 257, in _real_extract
  File "yt_dlp\extractor\common.py", line 3536, in extract_subtitles
  File "yt_dlp\extractor\adn.py", line 93, in _get_subtitles
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa2 in position 1: invalid start byte
```



Discussion:
> Before, you had to change a key in the code regularly to be able to download them. The method to obtain this key had explained here by a contributor.

Provide a link to the conversation if possible
Sorry, I forgot to include the link. I edited my message with the link.
Hello,

I found an issue on the youtube-dl repository containing a possible way to download the subtitles. https://github.com/ytdl-org/youtube-dl/issues/30407 
Would it be possible to use this to solve the problem or work around it?

Thanks for your help

Hi @pukkandan,

I don't know if you have seen my previous message, if so, can it help to solve the problem?
If not, I have the actual key for the subtitles, it was given to me exceptionally by someone who will not give me the method nor the key in the future. I can share it with you in private if that can help.

Gaby
Hello, @Gaby13627  i have the same problem but i didn't really get how to solve it. Could you explain me the way to fix it ?
> I don't know if you have seen my previous message, if so, can it help to solve the problem? If not, I have the actual key for the subtitles, it was given to me exceptionally by someone who will not give me the method nor the key in the future. I can share it with you in private if that can help.


I have read your message. But you can't expect me to fix each of the 1500+ supported websites myself in addition to maintaining the core project/reviewing PRs. It will be fixed when someone writes a PR. There is no point in pinging me. In general, don't expect me to work on any site-specific issues unless I have assigned it to myself.

Resolving patch:
diff --git a/yt_dlp/extractor/adn.py b/yt_dlp/extractor/adn.py
--- a/yt_dlp/extractor/adn.py
+++ b/yt_dlp/extractor/adn.py
@@ -82,7 +82,7 @@ def _get_subtitles(self, sub_url, video_id):
         # http://animedigitalnetwork.fr/components/com_vodvideo/videojs/adn-vjs.min.js
         dec_subtitles = unpad_pkcs7(aes_cbc_decrypt_bytes(
             compat_b64decode(enc_subtitles[24:]),
-            binascii.unhexlify(self._K + 'ab9f52f5baae7c72'),
+            binascii.unhexlify(self._K + '7fac1178830cfe0c'),
             compat_b64decode(enc_subtitles[:24])))
         subtitles_json = self._parse_json(dec_subtitles.decode(), None, fatal=False)
         if not subtitles_json:


Test patch: