Note: This article was translated with the assistance of AI. I wrote the original in Chinese. If you can read Chinese, you are welcome to read the original Chinese version for the most authentic and unfiltered expression.

Foreword

This tutorial offers one possible solution. If you have a better free solution, feel free to share it in the comments.

⚠️For paid videos, make sure your account has viewing access.

Tool Setup

Step 1: Install yt-dlp

Method 1: Download the binary directly and configure environment variables manually

For example, on Windows:

https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe

Method 2: Install via Python

1
pip install -U yt-dlp

Run yt-dlp --version to verify the installation:

1
2025.01.26

Step 2: Get YouTube cookies

Install the extension Get cookies.txt LOCALLY - Chrome Web Store

On YouTube, click the extension and download the cookies as a txt file in Netscape format.

Note ⚠️: In my experience, if YouTube is open in a regular browser tab, the cookies may refresh and invalidate the ones you just exported. To avoid this, use a less frequently used browser or open an incognito window when exporting cookies.

Download Command

You’ll need to configure your network environment yourself. For more yt-dlp commands and options, see:

yt-dlp/yt-dlp: A feature-rich command-line audio/video downloader

Run the following command:

1
yt-dlp [playlist_url] -f mp4 --cookies [path_to_cookies.txt]

For example:

1
yt-dlp https://www.youtube.com/playlist?list=PLZHQObOWTQDOMxJDswBaLu8xBMKxSTvg8 -f mp4 --cookies youtube.com_cookies.txt

The program will then automatically download all videos in the playlist. Videos are saved to the current directory by default. For paid videos, make sure the cookie account has viewing access.