×

注意!页面内容来自https://github.com/yt-dlp/yt-dlp/wiki/Extractors,本站不储存任何内容,为了更好的阅读体验进行在线解析,若有广告出现,请及时反馈。若您觉得侵犯了您的利益,请通知我们进行删除,然后访问 原网页

Skip to content

Extractors

bashonly edited this page Jun 112025 · 12 revisions

YouTube

Important

YouTube is gradually enforcing the use of a "PO Token" to be able to download videos. Due to the nature of these tokensyt-dlp cannot generate them and they must be provided externally.

By defaultyt-dlp will attempt to download videos using clients that do not currently require a PO Token. Howeversome formats and features may not be available without the token(s).

At this timeif you are having issues with the default clientsit is suggested to use the mweb client with a PO Token. Refer to the PO Token Guide on how to set up yt-dlp for this.

Exporting YouTube cookies

Caution

By using your account with yt-dlpyou run the risk of it being banned (temporarily or permanently). Be mindful with the request rate and amount of downloads you make with an account. Use it only when necessaryor consider using a throwaway account.

Note

This is only necessary for content that requires an account to accesssuch as private playlistsage-restricted videos and members-only content.

If you are unfamiliar with the basics of exporting cookies and passing them to yt-dlpthen first see How do I pass cookies to yt-dlp?

YouTube rotates account cookies frequently on open YouTube browser tabs as a security measure. To export cookies that will remain working with yt-dlpyou will need to export cookies in such a way that they are never rotated.

One way to do this is through a private browsing/incognito window:

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

Note

Do NOT use the --cookies COOKIEFILE --cookies-from-browser BROWSER method (as described in the above FAQ link) to export your cookies to a cookiefile. This will export all of your regular browser cookiesbut not the cookies from this private/incognito YouTube session. Insteaduse one of the browser extensions recommended in the FAQ.

Passing Visitor Data without cookies

In some casesyou may not want to use cookies and instead pass Visitor Data to use in Innertube API requests.

Warning

This method is not recommended for most cases. It requires skipping webpage requests so that the VISITOR_INFO1_LIVE cookie does not interfere. This results in more requests needing to be sent as well as less stable extraction.

You can do this with:

--extractor-args "youtubetab:skip=webpage" --extractor-args "youtube:player_skip=webpage,configs;visitor_data=VISITOR_DATA_VALUE_HERE"

Common YouTube Errors

This content isn't availabletry again later

This error is caused by your YouTube guest session or account exceeding the YouTube video request rate limit.

It is recommended to add a delay of around 5-10 seconds between downloads with -t sleep or with the sleep options.

With the default yt-dlp settingsthe rate limit for guest sessions is ~300 videos/hour (~1000 webpage/player requests per hour). For accountsit is ~2000 videos/hour (~4000 webpage/player requests per hour).

PO Token Guide

This section has been moved to a dedicated page

Logging in with OAuth

Caution

Due to new restrictions enacted by YouTubelogging in with OAuth no longer works with yt-dlp. You should use cookies instead.

Clone this wiki locally