

NOTE: Ensure long cookies are intact, copy/paste directly to repair any that were cut off if needed. ), copy the table of cookies into the clipboard, then paste it at the end of the file you've opened in step 2. YouTube, and log in.įor each URL under Cookies (e.g. Navigate to the site you need cookies from, e.g. In Chrome/Chromium, launch Developer Tools (F12) It requires a terminal window, Node.js, and this open-source script I published.ĭownload the script (or clone the repo if you prefer) This approach doesn't require installing any browser extension, which could pose a security risk, as also pointed out. This works well to download full episodes from sites that require cable provider login.

Paste that value into the example command above to replace COOKIE_STRING_EXTRACTED_FROM_BROWSER (inside the quotes)

This method is also quite a bit easier than extracting a cookie jar from a modern browser, especially since those tend to be encrypted and people often turn to questionable 3rd party tools to extract that data.

You can use this optionĬookies are ultimately just submitted to the server as HTTP headers, so all you have to do is set the Cookie header on the request. Youtube-dl has an option called -add-header: -add-header FIELD:VALUE Specify a custom HTTP header and its value, separated by a colon ':'. While this may not work for YouTube specifically, I wanted to highlight an easier approach that works well for youtube-dl to download from a site that requires login (and uses cookies to track the session).Įdit: Unfortunately YouTube is dependent on cookies set across multiple domains, so this approach probably will not work there.
