Allow passing cookies to yt-dlp for get around YouTube restrictions
Vistanz
As we all know, YouTube is getting stricter on usage of yt-dlp now days, and causes trouble on viewing them in VRChat. I have discover a way that can effectively get around it, which is
--cookies
argument.Good news is yt-dlp itself supports accepting additional arguments by putting a
yt-dlp.conf
file alongside with it.But here is the twist, VRChat's custom build took away support of
--cookies
argument, make it no way to do so unless we manually replaces the executable to the original build.Here is how I found it works:
- Creating the config file with provided cookies as yt-dlp documented in the Tools folder: It complains unrecognize --cookiesargument. (Indicates we can use config file passes additional arguments)
- Replaces yt-dlp with official build: It complains unable creates temp directory. (Indicates official build also works for VRChat)
- Use icaclswith/setintegritylevel medium: Works, but everytime VRChat reloads the executable replaced with VRChat custom build. (Indicates previous issue just caused by Windows security design)
So I hope VRChat can at least enable
--cookies
argument for the custom yt-dlp build, the rest can be handle by users themselves (extract login session with browser extensions such as "Get cookies.txt LOCALLY" then feed to yt-dlp with config file).Log In
Deantwo
yt-dlp was not designed to be used in the way that VRChat is using it. It was designed to be a small tool you can use to download a few YouTube videos, not to endlessly use it to skip ads and embed the videos into a video game.
yt-dlp advises against using cookies, this was mainly just a solution when YouTube was using CAPTCHA to verify users weren't bots. Now that YouTube demand you are logged in to an account, you are more likely to just end up getting your YouTube account suspended for abusing their API and circumventing ads.
I doubt there is a good solution to the issue, aside from VRChat removing yt-dlp and implementing a more standard video embed, basically so YouTube can serve ads to users. Therefore, world creators in VRChat really need to stop relying on YouTube for background music and video hosting.
Deantwo
> ## Exporting YouTube cookies
>
Caution
> By using your account with yt-dlp, you 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 necessary, or consider using a throwaway account.