Repository: yt-dlp/yt-dlp

Issue:
[Dropbox] "No video formats found!" on some pages
### 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

_No response_

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

For some videos hosted on Dropbox yt-dlp gives an error "No video formats found!" Others are downloaded without problems. The example of a problematic URL is https://www.dropbox.com/s/h4nny8z62nnhezj/Side.Milf.Milk.mp4?dl=0 (Warning: NSFW!)

### 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: ['-F', 'https://www.dropbox.com/s/h4nny8z62nnhezj/Side.Milf.Milk.mp4?dl=0', '-vU']
[debug] User config "/home/tkzv/yt-dlp.conf": ['--alias', 'tg', '--write-info-json -o "%(channel)s[%(id)s].%(ext)s"']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2024.03.22.232703 from yt-dlp/yt-dlp-nightly-builds [e5d4f1110] (pip)
[debug] Python 3.11.8 (CPython x86_64 64bit) - Linux-5.15.32-gentoo-r1-x86_64-AMD_FX-tm-8300_Eight-Core_Processor-with-glibc2.38 (OpenSSL 3.0.13 30 Jan 2024, glibc 2.38)
[debug] exe versions: ffmpeg 6.0.1 (fdk,setts), ffprobe 6.0.1, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.19.0, brotli-1.1.0, certifi-2023.07.22, mutagen-1.47.0, requests-2.31.0, sqlite3-3.45.1, urllib3-2.1.0, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1807 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Latest version: nightly@2024.03.22.232703 from yt-dlp/yt-dlp-nightly-builds
yt-dlp is up to date (nightly@2024.03.22.232703 from yt-dlp/yt-dlp-nightly-builds)
[Dropbox] Extracting URL: https://www.dropbox.com/s/h4nny8z62nnhezj/Side.Milf.Milk.mp4?dl=0
[Dropbox] h4nny8z62nnhezj: Downloading webpage
ERROR: [Dropbox] h4nny8z62nnhezj: 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 "/home/tkzv/.local/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1605, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tkzv/.local/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1761, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tkzv/.local/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1820, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tkzv/.local/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 2808, in process_video_result
    self.raise_no_formats(info_dict)
  File "/home/tkzv/.local/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1103, in raise_no_formats
    raise ExtractorError(msg, video_id=info['id'], ie=info['extractor'],
yt_dlp.utils.ExtractorError: [Dropbox] h4nny8z62nnhezj: 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:
the extractor needs this:
```diff
diff --git a/yt_dlp/extractor/dropbox.py b/yt_dlp/extractor/dropbox.py
index bc2efce12..0246975c1 100644
--- a/yt_dlp/extractor/dropbox.py
+++ b/yt_dlp/extractor/dropbox.py
@@ -65,12 +65,14 @@ def _real_extract(self, url):
         formats, subtitles, has_anonymous_download = [], {}, False
         for encoded in reversed(re.findall(r'registerStreamedPrefetch\s*\(\s*"[\w/+=]+"\s*,\s*"([\w/+=]+)"', webpage)):
             decoded = base64.b64decode(encoded).decode('utf-8', 'ignore')
+            if not has_anonymous_download:
+                has_anonymous_download = self._search_regex(
+                    r'(anonymous:\tanonymous)', decoded, 'anonymous', default=False)
             transcode_url = self._search_regex(
                 r'\n.(https://[^\x03\x08\x12\n]+\.m3u8)', decoded, 'transcode url', default=None)
             if not transcode_url:
                 continue
             formats, subtitles = self._extract_m3u8_formats_and_subtitles(transcode_url, video_id, 'mp4')
-            has_anonymous_download = self._search_regex(r'(anonymous:\tanonymous)', decoded, 'anonymous', default=False)
             break
 
         # downloads enabled we can get the original file
```

p.s. you can just change `dl=0` to `dl=1` in the url to d/l manually

Resolving patch:
diff --git a/yt_dlp/extractor/dropbox.py b/yt_dlp/extractor/dropbox.py
--- a/yt_dlp/extractor/dropbox.py
+++ b/yt_dlp/extractor/dropbox.py
@@ -65,12 +65,14 @@ def _real_extract(self, url):
         formats, subtitles, has_anonymous_download = [], {}, False
         for encoded in reversed(re.findall(r'registerStreamedPrefetch\s*\(\s*"[\w/+=]+"\s*,\s*"([\w/+=]+)"', webpage)):
             decoded = base64.b64decode(encoded).decode('utf-8', 'ignore')
+            if not has_anonymous_download:
+                has_anonymous_download = self._search_regex(
+                    r'(anonymous:\tanonymous)', decoded, 'anonymous', default=False)
             transcode_url = self._search_regex(
                 r'\n.(https://[^\x03\x08\x12\n]+\.m3u8)', decoded, 'transcode url', default=None)
             if not transcode_url:
                 continue
             formats, subtitles = self._extract_m3u8_formats_and_subtitles(transcode_url, video_id, 'mp4')
-            has_anonymous_download = self._search_regex(r'(anonymous:\tanonymous)', decoded, 'anonymous', default=False)
             break
 
         # downloads enabled we can get the original file


Test patch: