Repository: yt-dlp
Issue: How To Add Cookies While Using yt-dlp in python api
Labels: incomplete

### 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 asking a question and **not** reporting a bug or requesting a feature
- [x] I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme)
- [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 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 questions **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)

### Please make sure the question is worded well enough to be understood

_I am Requesting this Url, and making Python Script to Scrap with Flask and Fast Api_ 

URl is
**"url": "https://www.instagram.com/reel/DC8gC__NeU0/"**

Getting This Error 

{
    "error": "ERROR: [Instagram] DC8gC__NeU0: Requested content is not available, rate-limit reached or login required. Use --cookies, --cookies-from-browser, --username and --password, --netrc-cmd, or --netrc (instagram) to provide account credentials. See  https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp  for how to manually pass cookies"
}

Code Is     ydl_opts = {
        'quiet': True,  # Suppress output
        'noplaylist': True,  # Don't extract playlist videos, only the individual video
        'restrict_filenames': True,  # Prevent special characters in filenames
        'cookiefile': 'cookielist.txt',  # Provide path to your cookies.txt if necessary
        'format': 'bestvideo+bestaudio/best',  # Force video + audio selection
    }

    try:
        # Initialize yt-dlp with the options
        with yt_dlp.YoutubeDL(ydl_opts) as ydl:
            # Extract metadata from the provided URL
            info_dict = ydl.extract_info(url, download=False)


Also Placing Script file and cookielist together But Still have error

{
    "error": "ERROR: [Instagram] DC8gC__NeU0: Requested content is not available, rate-limit reached or login required. Use --cookies, --cookies-from-browser, --username and --password, --netrc-cmd, or --netrc (instagram) to provide account credentials. See  https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp  for how to manually pass cookies"
}

WARNING: [Instagram] DC8gC__NeU0: General metadata extraction failed (some metadata might be missing).
WARNING: [Instagram] unable to extract shared data; 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
WARNING: [Instagram] Main webpage is locked behind the login page. Retrying with embed webpage (some metadata might be missing).
WARNING: [Instagram] unable to extract additional data; 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 vers
ion using  yt-dlp -U
ERROR: [Instagram] DC8gC__NeU0: Requested content is not available, rate-limit reached or login required. Use --cookies, --cookies-from-browser, --username and --password, --netrc-cmd, or --netrc (instagram) 
to provide account credentials. See  https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp  for how to manually pass cookies
Error: ERROR: [Instagram] DC8gC__NeU0: Requested content is not available, rate-limit reached or login required. Use --cookies, --cookies-from-browser, --username and --password, --netrc-cmd, or --netrc (inst
agram) to provide account credentials. See  https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp  for how to manually pass cookies

### Provide verbose output that clearly demonstrates the problem

- [x] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [x] 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
C:\Users\Cybron>yt-dlp -vu https://www.instagram.com/reel/DC8gC__NeU0/#
[debug] Command-line config: ['-vu', 'https://www.instagram.com/reel/DC8gC__NeU0/#']
Type account password and press [Return]:
[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: none
[debug] Optional libraries: certifi-2024.12.14, sqlite3-3.45.3, websockets-14.2
[debug] Proxy map: {}
[debug] Request Handlers: urllib, websockets
[debug] Loaded 1837 extractors

Usage: yt-dlp [OPTIONS] URL [URL...]

yt-dlp: error: You must provide at least one URL.
Type yt-dlp --help to see a list of all options.
```