Skip to content

Plugin that adds OAuth2 login support to yt-dlp's YouTube extractors

License

Notifications You must be signed in to change notification settings

coletdjnz/yt-dlp-youtube-oauth2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YouTube OAuth2 for yt-dlp

This repository contains a plugin package that adds support for logging into YouTube with OAuth2 to yt-dlp's YouTube Extractors.

Please note: This is experimental and may break at any time!!.

Installation

Requires yt-dlp 2023.10.13 or above.

If yt-dlp is installed through pip or pipx, you can install the plugin with the following:

pip:

python3 -m pip install -U https://github.com/coletdjnz/yt-dlp-youtube-oauth2/archive/refs/heads/master.zip

pipx:

pipx inject yt-dlp https://github.com/coletdjnz/yt-dlp-youtube-oauth2/archive/refs/heads/master.zip

If you have not installed yt-dlp through pip or pipx, see installing yt-dlp plugins for the other methods this plugin package can be installed.

Usage

Enabling

Enable logging in with OAuth2 with --username oauth2 --password ''.

Alternatively, if you only want to apply this for the YouTube extractor, you can add the following to a .netrc file:

machine youtube login oauth2 password ""

Logging in

On first run you will be prompted to authorize yt-dlp to access your YouTube account.

[youtube+oauth2] To give yt-dlp access to your account, go to https://www.google.com/device and enter code XXX-YYY-ZZZ

Open the link in your browser and enter the code. It will say the request is for YouTube on TV - this is normal, as we are using the YouTube on TV client for oauth ;)

The token data is saved in the yt-dlp cache.

Note: avoid running with YouTube cookies, as it may cause issues.

About

Plugin that adds OAuth2 login support to yt-dlp's YouTube extractors

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages