Proof of Origin (PO) token is a parameter that YouTube requires to be sent with video playback requests from some clients. Without it, requests for the affected clients' format URLs may return HTTP Error 403, or result in your account or IP address being blocked.
This token is generated by BotGuard (Web) / DroidGuard (Android) to attest the requests are coming from a genuine client. This guide will be assuming the use of a PO Token generated by BotGuard, for use with the web
client.
For PO Tokens generated by BotGuard, when logged out, the PO Token is bound to a Visitor ID. This Visitor ID is found in the
VISITOR_INFO1_LIVE
cookie, or in thevisitorData
value which is sent with Innertube API requests. When logged in, the PO Token is bound to the account Session ID (part of the Data Sync ID), rather than the Visitor ID.
This process goes through manually obtaining a PO Token generated on YouTube in a web browser, and then manually passing that to yt-dlp via the po_token
extractor argument.
Steps:
v1/player
serviceIntegrityDimensions.poToken
and save that value--extractor-args "youtube:player-client=web,default;po_token=web+PO_TOKEN_VALUE_HERE"
with cookies (--cookies COOKIES_FILE
)Addendum:
videoplayback
URLs (it is the pot
query parameter).--cookies-from-browser
if that is pointed to the browser session with the same logged-out session you extracted the PO Token from.In some cases, you 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 "youtube:player-client=web,default;player-skip=webpage,configs;po_token=web+PO_TOKEN_VALUE_HERE;visitor_data=VISITOR_DATA_VALUE_HERE"
The process for obtaining a PO Token for use when yt-dlp is logged into an account is similar to the above. The PO Token obtained should work with either cookies or OAuth.
Steps:
--extractor-args "youtube:player-client=web;po_token=web+PO_TOKEN_VALUE_HERE"
with your method of auth (cookies or OAuth)Note only the web
client is used above example (instead of web
and default
). When logged in, it is recommended to explicitly supply a PO token to all clients used to help avoid getting your account blocked.
mweb
, you should append mweb+PO_TOKEN_VALUE_HERE
to the po_token
argument and append mweb
to the player-client
argument.If you are using cookies, see Exporting YouTube Cookies on how to export cookies without them being invalidated.
If you are unfamiliar with the basics of exporting cookies and passing them to yt-dlp, then first see How do I pass cookies to yt-dlp?
YouTube rotates cookies frequently on open YouTube browser tabs as a security measure. To export cookies that will remain working with yt-dlp, you 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:
[!CAUTION] Due to new restrictions enacted by YouTube, logging in with OAuth no longer works with yt-dlp. You should use cookies instead.