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

Doesn't work at the code level #44

Closed Synth3s closed 1 month ago

Synth3s commented 1 month ago

When I run yt-dlp in the console it works fine yt-dlp --netrc https://youtube.com/shorts/RGlr-SqBUyM?si=qrmptdj9pMobMKmk

But when I want to do the same thing by running a python file, I still get an authorization error

filename = f'{int(time.time() * 1000)}.mp4'
ydl_opts = {
    'format': 'bestvideo+bestaudio/best',
    'outtmpl': filename,
    'merge_output_format': 'mp4',
    'postprocessors': [{
        'key': 'FFmpegVideoConvertor',
        'preferedformat': 'mp4',
    }],
    'netrc': True,
    'verbose': True,
}

try:
    with yt_dlp.YoutubeDL(ydl_opts) as ydl:
        ydl.download([url])
except Exception as e:
        logging.error(f"Error: {e}")

Does anyone know what the problem is?

coletdjnz commented 1 month ago

send verbose log if u are still having the issue, I can't tell from the above.

{'verbose': True} youtubedl opt

Synth3s commented 1 month ago

send verbose log if u are still having the issue, I can't tell from the above.

{'verbose': True} youtubedl opt

I've already solved the problem, thanks

{
    'username': 'oauth2',
    'password': ''
}