-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Extractors
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.
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:
- Open a new private browsing/incognito window and log into YouTube
- 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) - Export
youtube.comcookies 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.
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"
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).
This section has been moved to a dedicated page
Caution
Due to new restrictions enacted by YouTubelogging in with OAuth no longer works with yt-dlp. You should use cookies instead.