Skip to content

Instantly share code, notes, and snippets.

@sathishshan
Last active August 13, 2026 13:15
Show Gist options
  • Select an option

  • Save sathishshan/79b850c8cb14190c37d199a564611bd6 to your computer and use it in GitHub Desktop.

Select an option

Save sathishshan/79b850c8cb14190c37d199a564611bd6 to your computer and use it in GitHub Desktop.
Download youtube private or member videos
#single video
youtube-dl --cookies youtube.com_cookies.txt "URL"
#playlist
youtube-dl --yes-playlist --cookies youtube.com_cookies.txt "URL"
You can use: --playlist-start, --playlist-end, --playlist-reverse or --playlist-items to achieve this goal.
#Note: cookie should be in Netscape format
Addons
#https://chrome.google.com/webstore/detail/get-cookiestxt/bgaddhkoddajcdgocldbbfleckgcbcid
#https://addons.mozilla.org/en-US/firefox/addon/cookies-txt/
python.exe -m pip install --upgrade pip
pip install yt-dlp
yt-dlp --yes-playlist --playlist-start 16 --cookies cookies.txt "https://www.youtube.com/playlist?"
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -
-------------
Youtube-dl multiple videos download from a file.
yt-dlp.exe -a file.txt
-------------
Subtitile & Video Resolution:
yt-dlp --list-subs --cookies youtube_cookie.txt URL
yt-dlp --write-auto-sub --sub-format srt --sub-lang en --skip-download --cookies youtube_cookie.txt URL
To select the video quality, first use the -F option to list the available formats, here’s an example,
youtube-dl -F URL
The best quality is 22 so use -f 22 instead of -F to download the MP4 video with 1280x720 resolution like this:
youtube-dl -f 22 URL
@effortless-guy

Copy link
Copy Markdown

How to download Membership only videos?

This guide documents the setup process that worked for me on Windows. It assumes you already have legitimate access to the videos through your own account.

Important: Respect copyright laws and platform terms. Only access content you are authorized to view.

Prerequisites

  • Windows 10 or Windows 11
  • Google Chrome
  • YouTube account with access to the videos
  • Administrator rights to install software

Step 1 - Prepare Google Chrome

  1. Install Google Chrome if not already installed.
  2. Set Chrome as your default browser.
  3. Sign into Chrome using the same Google account that has access to the videos.
  4. Open YouTube and verify you can watch the videos normally.

Step 2 - Install Python

  1. Download Python from https://www.python.org/downloads/
  2. During installation check Add Python to PATH.
  3. Finish installation.

Verify:

python --version

You should see something similar to:

Python 3.12.x

Step 3 - Install Node.js

  1. Download Node.js LTS from https://nodejs.org
  2. Install using default options.

Verify:

node --version
npm.cmd --version

Step 4 - Install Deno

Some environments may use Deno when working with yt-dlp JavaScript challenge solving.

Install:

irm https://deno.land/install.ps1 | iex

Verify:

deno --version

Step 5 - Install FFmpeg

Install:

winget install Gyan.FFmpeg
After installing FFmpeg, completely close PowerShell / CMD and open a new terminal window. Otherwise ffmpeg may not be detected because PATH has not refreshed yet.

Verify:

ffmpeg -version

Step 6 - Install yt-dlp

python -m pip install -U yt-dlp

Verify:

python -m yt_dlp --version

Step 7 - Install yt-dlp-ejs

python -m pip install -U yt-dlp-ejs

Step 8 - Verify Everything

python --version
node --version
npm.cmd --version
deno --version
ffmpeg -version
python -m yt_dlp --version

All commands should display version information without errors.

Step 9 - Export Cookies

Install the following Chrome extension:

  • Get cookies.txt Locally

Chrome Web Store:
https://chromewebstore.google.com/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc

GitHub Project:
https://github.com/kairi003/Get-cookies.txt-Locally

  1. Open YouTube in Chrome.
  2. Make sure you are logged in.
  3. Click the extension icon.
  4. Export cookies in Netscape format.
  5. Save the file as cookies.txt.

Step 10 - Download Videos

Replace VIDEO_URL with the actual URL.

python -m yt_dlp --cookies cookies.txt --remote-components ejs:npm -f "bv*+ba/b" --merge-output-format mp4 "Video/PlayList Link"

If you have already donnwloaded 80 video oit of 120 in a p playlios then yiu can start from 81st vdieo with this command

python -m yt_dlp --playlist-start 81 --cookies cookies.txt --remote-components ejs:npm -f "bv*+ba/b" --merge-output-format mp4 "URL"

This shows download the best available format of video and confirms your setup is working.

Optional - Download Videos to a Specific Folder

By default, videos will be downloaded to the current folder where you run the command.

You can create a dedicated folder for your downloads:

mkdir MyVideos
cd MyVideos

You can still reference cookies.txt from another location using a relative path:

python -m yt_dlp --cookies ..\cookies.txt --remote-components ejs:npm -f "bv*+ba/b" --merge-output-format mp4 "VIDEO_URL"

Example folder structure:

Downloads
├── cookies.txt
└── MyVideos

In this example, cookies.txt stays in Downloads while all downloaded videos are stored inside MyVideos.

Frequently Asked Questions (FAQ)

Q: ffmpeg is installed but Windows says 'ffmpeg is not recognized'?

A: Close all PowerShell/CMD windows and open a brand new terminal. FFmpeg updates the PATH variable during installation and existing terminals will not see the change.

Q: npm gives an Execution Policy error?

A: Use:

npm.cmd --version

instead of:

npm --version

Q: The command only shows image formats?

A: Usually one of the following:

  • cookies.txt is invalid or expired
  • You are not logged into the correct YouTube account
  • yt-dlp-ejs is not installed
  • Node.js installation is missing or broken

Q: Do I need Deno?

A: Not always. In my testing, the ejs:npm solution using Node.js worked reliably. Deno is included because some setups may use it.

Q: Can I download an entire playlist?

A: Yes.

python -m yt_dlp --cookies cookies.txt --remote-components ejs:npm -f "bv*+ba/b" --merge-output-format mp4 "PLAYLIST_URL"

Q: Can I resume from a specific playlist video?

A: Yes.

python -m yt_dlp --playlist-start 81 --cookies cookies.txt --remote-components ejs:npm -f "bv*+ba/b" --merge-output-format mp4 "PLAYLIST_URL"

Q: How do I download only a few videos from a playlist?

python -m yt_dlp --playlist-items 10-20 --cookies cookies.txt --remote-components ejs:npm -f "bv*+ba/b" --merge-output-format mp4 "PLAYLIST_URL"

Q: My cookies stopped working after a few weeks?

A: Export a fresh cookies.txt file using the browser extension and replace the old one.

Q: Can I keep the downloaded videos forever?

A: Downloaded files stay on your computer until you delete them. Make sure you have enough disk space because large playlists can consume many gigabytes.

Q: How much space do I need?

A: 1080p videos are often hundreds of megabytes each. Large playlists may require tens of gigabytes of free storage.

@vanshsoni13

Copy link
Copy Markdown

[youtube] Extracting URL: https://youtu.be/DlIKbE46pUk?si=pr1Vn6PVB3M4i7hf
[youtube] DlIKbE46pUk: Downloading webpage
[youtube] DlIKbE46pUk: Downloading android vr player API JSON
ERROR: [youtube] DlIKbE46pUk: Join this channel to get access to members-only content like this video, and other exclusive perks.

@vnl

vnl commented Jul 10, 2026

Copy link
Copy Markdown

Same... as above comment. I get an error:

ERROR: [youtube] pHEUmvlQosk: Join this channel to get access to members-only content like this video, and other exclusive perks.

@Retronite13

Copy link
Copy Markdown

still asks me to become a member

@SadKingArthur

Copy link
Copy Markdown

the command is only being read up to this point: "python -m yt_dlp".
Even making nonsensical changes to the rest of the command doesn't alter the error.
I believe it doesn't even recognize "cookies.txt".

@Akarshan-real

Copy link
Copy Markdown

How to download youtube members only video, I am not a member

you can't

You need membership

after done all videos then ask a refund so you get free

is that still possible?

@umeshchess

Copy link
Copy Markdown

So we can't download member videos if we aren't a member for that yt channel

@yashwanththati5

Copy link
Copy Markdown

So we can't download member videos if we aren't a member for that yt channel

Yes, that's how it is.

@yashwanththati5

Copy link
Copy Markdown

Quick question for everyone: does this work if you are a member of the YouTube channel? If so, would it be possible to subscribe, download the content, and then cancel?

@naufalist

Copy link
Copy Markdown

Quick question for everyone: does this work if you are a member of the YouTube channel? If so, would it be possible to subscribe, download the content, and then cancel?

Yes, it is possible.

Anyway, I'm a bit confused about why some people can't download members-only videos even though they are already members of the YouTube channel. I think I'll try joining another YouTube channel that offers memberships and then try downloading its members-only videos to see if I can reproduce the issue.

@yashwanththati5

Copy link
Copy Markdown

Yes, it is possible.

Anyway, I'm a bit confused about why some people can't download members-only videos even though they are already members of the YouTube channel. I think I'll try joining another YouTube channel that offers memberships and then try downloading its members-only videos to see if I can reproduce the issue.

The YouTube application doesn't allow downloading members-only videos. I'm not sure if this can be customized by the channel owner, but it currently doesn't allow you to download them.

@naufalist

Copy link
Copy Markdown

The YouTube application doesn't allow downloading members-only videos. I'm not sure if this can be customized by the channel owner, but it currently doesn't allow you to download them.

Let me clarify. The YouTube app itself doesn't allow this. Even if it lets you download videos, as far as I know, they're only stored on your device in an encrypted format, and the video can only be played in the YouTube app.

I recently joined a YouTube channel and purchased a channel membership. Then I tried downloading one of the members-only videos using yt-dlp, and it still works with the latest version of yt-dlp. These are the commands I used:

This command is used to check which audio and video streams are available:

This command is used to download the video:


❗ According to the official yt-dlp documentation on exporting YouTube cookies (Exporting YouTube cookies), please pay close attention to the following: when exporting the cookies, use an Incognito/Private browser window. Do not use your existing browser session or the browser profile you're currently using. The cookies must be exported in Netscape format. Follow these steps:

  1. Open a new private browsing/incognito window and log into YouTube
  2. In same window and same tab from step 1, navigate to https://www.youtube.com/robots.txt (this should be the only private/incognito browsing tab open)
  3. Export youtube.com cookies from the browser, then close the private browsing/incognito window so that the session is never opened in the browser again.

You can still use this extension to export the cookies in Netscape format: https://chromewebstore.google.com/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc

I'm using Python 3.11.9 and yt-dlp 2026.07.04, and here's a screenshot as proof:

yt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment