Repository: yt-dlp/yt-dlp

Issue:
German ADN Site doesn't work with cookies
### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting that yt-dlp is broken on a **supported** site
- [X] I've verified that I have **updated yt-dlp to nightly or master** ([update instructions](https://github.com/yt-dlp/yt-dlp#update-channels))
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#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 [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and 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)
- [ ] 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

Germany

### Provide a description that is worded well enough to be understood

The German ADN Site support was added last week but it doesn't work. Maybe something changed on the website.

I just tried to download: [https://animationdigitalnetwork.de/video/my-instant-death-ability-is-so-overpowered-no-one-in-this-other-world-stands-a-chance-against-me/24108-folge-1-mort-subite](url)

Thank you for your great work.

### Provide verbose output that clearly demonstrates the problem

- [X] 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
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
[debug] Command-line config: ['-vU', '--cookies-from-browser', 'firefox', 'https://animationdigitalnetwork.de/video/my-instant-death-ability-is-so-overpowered-no-one-in-this-other-world-stands-a-chance-against-me/24108-folge-1-mort-subite']
Extracting cookies from firefox
[debug] Extracting cookies from: "C:\Users\vm\AppData\Roaming\Mozilla\Firefox\Profiles\6zzghx8w.default-release\cookies.sqlite"
Extracted 241 cookies from firefox
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2024.01.23.232723 from yt-dlp/yt-dlp-nightly-builds [5f25f348f] (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-full_build-www.gyan.dev (setts)
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2023.11.17, mutagen-1.47.0, requests-2.31.0, sqlite3-3.35.5, urllib3-2.1.0, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1819 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Latest version: nightly@2024.01.23.232723 from yt-dlp/yt-dlp-nightly-builds
yt-dlp is up to date (nightly@2024.01.23.232723 from yt-dlp/yt-dlp-nightly-builds)
[ADN] Extracting URL: https://animationdigitalnetwork.de/video/my-instant-death-ability-is-so-overpowered-no-one-in-this-other-world-stands-a-chance-against-me/24108-folge-1-mort-subite
[ADN] 24108: Downloading player config JSON metadata
[ADN] 24108: Downloading access token
[ADN] 24108: Downloading links JSON metadata
[ADN] 24108: Downloading vostde mobile JSON metadata
WARNING: [ADN] Unable to download JSON metadata: HTTP Error 404: Not Found
[ADN] 24108: Downloading vostde sd JSON metadata
WARNING: [ADN] Unable to download JSON metadata: HTTP Error 404: Not Found
[ADN] 24108: Downloading additional video metadata
ERROR: [ADN] 24108: No video formats found!; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
Traceback (most recent call last):
  File "yt_dlp\YoutubeDL.py", line 1586, in wrapper
  File "yt_dlp\YoutubeDL.py", line 1742, in __extract_info
  File "yt_dlp\YoutubeDL.py", line 1801, in process_ie_result
  File "yt_dlp\YoutubeDL.py", line 2780, in process_video_result
  File "yt_dlp\YoutubeDL.py", line 1084, in raise_no_formats
yt_dlp.utils.ExtractorError: [ADN] 24108: No video formats found!; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
```



Discussion:
cc @infanf
Cookies authorization doesn't work with ADN (also doesn't work with the French site). Try username and password instead.
is this check not effective?
https://github.com/yt-dlp/yt-dlp/blob/5f25f348f9eb5db842b1ec6799f95bebb7ba35a7/yt_dlp/extractor/adn.py#L186-L188

we also need to change it to `self.raise_login_required(method='password')`
The ADN API provides dead links for some formats on the German site. I guess this is one of the reasons why it is still in Beta. If you are not logged in or don't have a subscription, the formats you would be able to watch are the formats that are not available.
Currently there is no free German content, so we could just hardcode the login requirement for .de Links. But this may change once the site launches officially. There was free content a few weeks ago, so this may change at any time.
> Cookies authorization doesn't work with ADN (also doesn't work with the French site). Try username and password instead.

Thank you. With username and password it works.
I didn't find anything regarding which login method is working for different supported Sites.
I thought "Cookies authorization" would be the best way.

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
@@ -3,6 +3,7 @@
 import json
 import os
 import random
+import time
 
 from .common import InfoExtractor
 from ..aes import aes_cbc_decrypt_bytes, unpad_pkcs7
@@ -17,6 +18,7 @@
     int_or_none,
     intlist_to_bytes,
     long_to_bytes,
+    parse_iso8601,
     pkcs1pad,
     strip_or_none,
     str_or_none,
@@ -185,7 +187,10 @@ def _real_extract(self, url):
 
         user = options['user']
         if not user.get('hasAccess'):
-            self.raise_login_required()
+            start_date = traverse_obj(options, ('video', 'startDate', {str}))
+            if (parse_iso8601(start_date) or 0) > time.time():
+                raise ExtractorError(f'This video is not available yet. Release date: {start_date}', expected=True)
+            self.raise_login_required('This video requires a subscription', method='password')
 
         token = self._download_json(
             user.get('refreshTokenUrl') or (self._PLAYER_BASE_URL + 'refresh/token'),
@@ -267,6 +272,9 @@ def _real_extract(self, url):
                         f['language'] = 'de'
                 formats.extend(m3u8_formats)
 
+        if not formats:
+            self.raise_login_required('This video requires a subscription', method='password')
+
         video = (self._download_json(
             self._API_BASE_URL + 'video/%s' % video_id, video_id,
             'Downloading additional video metadata', fatal=False) or {}).get('video') or {}


Test patch: