Skip to content

YouTube Cookies

Kieran edited this page Oct 29, 2024 · 8 revisions

Caution

yt-dlp no longer recommends using YouTube cookies since they can cause YouTube to issue IP bans. This is an evolving situation but the recommendation for now is to not use this feature until more is known. See here for more.

You can optionally pass along your YouTube cookies to download private playlists or age-restricted content. This is a feature of yt-dlp and I don't know if this presents any risk of your account getting banned - perform at your own risk.

Here's how to set it up:

  1. Set up Pinchflat and start the app at least once so all the required directories are created
  2. Get your login cookies using this guide on your personal computer. In my case, this comment helped.
    • Do NOT share your cookie file with anyone and do NOT include it in bug reports
    • README: The command(s) to get your login cookies should not be run from the Pinchflat container. Instead, you want to run them on a computer with a browser that's logged in to the YouTube account you want. This means you may have to install yt-dlp on that computer, or you can use one of the extensions they've indicated so long as you feel comfortable doing so. Please read the entire guide linked above to fully understand any security risks.
  3. Locate your config directory for Pinchflat (either on the host or in the container) and look for the /extras/cookies.txt file. This file should be empty.
    • If you're decent in the CLI, open the container's console and run nano /config/extras/cookies.txt
  4. Paste your cookies from step 1 in the cookies.txt file
  5. That's it! You can add a source with private videos (make sure to enable Use Cookies for Downloading in your source!)

If you're having trouble, check your Docker container logs. If you see something like YouTube said: The playlist does not exist, there's a very high chance the problem is how you've acquired or formatted your cookies which is a concern of yt-dlp, not Pinchflat. Feel free to open an issue, but you'll have more luck checking out the yt-dlp issue tracker/Discord.