Repository: yt-dlp
Issue: [Google Drive] Cannot download source file when cookies are given
Labels: account-needed,site-bug,triage,can-share-account

### 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)
- [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

worldwide

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

When trying to download the source file for a google drive file, I seem to be getting Error 400 when cookies are provided. (example provided below). Now for publicly available files its not much of an issue to run without cookies to get the source file, but for privately shared files, or those on my own drive, I won't be able to access them without cookies, also video files that haven't been processed and don't have any other option other than source.

Not sure if the below are related, not knowledgeable enough to tell, but doesn't seem like the exact same issue.

[#4580](https://github.com/yt-dlp/yt-dlp/issues/4580)
[#9313](https://github.com/yt-dlp/yt-dlp/issues/9313)

If you are wondering why I would download files with yt-dlp from google drive, its is because I use MPV, which uses a yt-dlp hook, to stream google drive files.

### 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
*/ With cookies /*

yt-dlp -vU -F --cookies-from-browser=firefox https://drive.google.com/file/d/1SlteKbVi2xOTzFEcGoyTNnoN8gcrW8v-/view?usp=sharing
[debug] Command-line config: ['-vU', '-F', '--cookies-from-browser=firefox', 'https://drive.google.com/file/d/1SlteKbVi2xOTzFEcGoyTNnoN8gcrW8v-/view?usp=sharing']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2025.01.15 from yt-dlp/yt-dlp [c8541f8b1] (pip)
[debug] Python 3.13.1 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 3.0.15 3 Sep 2024)
[debug] exe versions: ffmpeg 2023-08-28-git-b5273c619d-full_build-www.gyan.dev (setts), ffprobe 2023-08-28-git-b5273c619d-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2024.08.30, mutagen-1.47.0, requests-2.32.3, sqlite3-3.45.3, urllib3-2.2.3, websockets-14.1
[debug] Proxy map: {}
Extracting cookies from firefox
[debug] Extracting cookies from: "C:\Users\Name\AppData\Roaming\Mozilla\Firefox\Profiles\4on6caty.default\cookies.sqlite"
Extracted 2771 cookies from firefox
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1837 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2025.01.15 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2025.01.15 from yt-dlp/yt-dlp)
[GoogleDrive] Extracting URL: https://drive.google.com/file/d/1SlteKbVi2xOTzFEcGoyTNnoN8gcrW8v-/view?usp=sharing
[GoogleDrive] 1SlteKbVi2xOTzFEcGoyTNnoN8gcrW8v-: Downloading video webpage
[GoogleDrive] 1SlteKbVi2xOTzFEcGoyTNnoN8gcrW8v-: Requesting source file
[GoogleDrive] 1SlteKbVi2xOTzFEcGoyTNnoN8gcrW8v-: Requesting confirmed source file
WARNING: [GoogleDrive] Unable to request confirmed source file: HTTP Error 400: Bad Request
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec, channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[info] Available formats for 1SlteKbVi2xOTzFEcGoyTNnoN8gcrW8v-:
ID EXT RESOLUTION │ PROTO │ VCODEC  ACODEC
───────────────────────────────────────────
18 mp4 640x360    │ https │ unknown unknown
22 mp4 1280x720   │ https │ unknown unknown
37 mp4 1920x1080  │ https │ unknown unknown


*/ without cookies /*

yt-dlp -vU -F  https://drive.google.com/file/d/1SlteKbVi2xOTzFEcGoyTNnoN8gcrW8v-/view?usp=sharing
[debug] Command-line config: ['-vU', '-F', 'https://drive.google.com/file/d/1SlteKbVi2xOTzFEcGoyTNnoN8gcrW8v-/view?usp=sharing']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2025.01.15 from yt-dlp/yt-dlp [c8541f8b1] (pip)
[debug] Python 3.13.1 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 3.0.15 3 Sep 2024)
[debug] exe versions: ffmpeg 2023-08-28-git-b5273c619d-full_build-www.gyan.dev (setts), ffprobe 2023-08-28-git-b5273c619d-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2024.08.30, mutagen-1.47.0, requests-2.32.3, sqlite3-3.45.3, urllib3-2.2.3, websockets-14.1
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1837 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2025.01.15 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2025.01.15 from yt-dlp/yt-dlp)
[GoogleDrive] Extracting URL: https://drive.google.com/file/d/1SlteKbVi2xOTzFEcGoyTNnoN8gcrW8v-/view?usp=sharing
[GoogleDrive] 1SlteKbVi2xOTzFEcGoyTNnoN8gcrW8v-: Downloading video webpage
[GoogleDrive] 1SlteKbVi2xOTzFEcGoyTNnoN8gcrW8v-: Requesting source file
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec, channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[info] Available formats for 1SlteKbVi2xOTzFEcGoyTNnoN8gcrW8v-:
ID     EXT RESOLUTION │ PROTO │ VCODEC  ACODEC
───────────────────────────────────────────────
18     mp4 640x360    │ https │ unknown unknown
22     mp4 1280x720   │ https │ unknown unknown
37     mp4 1920x1080  │ https │ unknown unknown
source mp4 unknown    │ https │ unknown unknown
```