coletdjnz / yt-dlp-youtube-oauth2

[OBSOLETE] Plugin that adds OAuth2 login support to yt-dlp's YouTube extractors
The Unlicense
260 stars 38 forks source link

How to used this plugin in python code? #29

Closed rmaleki closed 2 months ago

rmaleki commented 3 months ago

I want to use this plugin in my code. I couldn't find any documentation on this topic.

from yt_dlp import YoutubeDL

ydl_opts = {
    "quiet": True,
    "extract_flat": True,
    "force_generic_extractor": True,
    "cachedir": "/tmp",
}

with YoutubeDL(ydl_opts) as ydl:
    result = ydl.extract_info(reel_path, download=True)
coletdjnz commented 3 months ago

Install as normal, and should be able to just pass {'username': 'oauth2', 'password': ''} to ydl to enable

run ydl with 'verbose': True to check that it is loaded if it is not working.