Youtube-dl requires authentication #250
Replies: 3 comments 12 replies
-
Hi @StarEngineer89 |
Beta Was this translation helpful? Give feedback.
-
if using the CLI it says: "Sign in to confirm you’re not a bot. Use --cookies-from-browser or --cookies for the authentication. See https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp for how to manually pass cookies. Also see https://github.com/yt-dlp/yt-dlp/wiki/Extractors#exporting-youtube-cookies for tips on effectively exporting YouTube cookies" |
Beta Was this translation helpful? Give feedback.
-
Hi,
I use this library in Codeigniter 4.
The code is like here:
$yt = new YoutubeDl();
$yt->setBinPath('C:\ffmpeg\bin\yt-dlp.exe');
$collection = $yt->download(
Options::create()
->downloadPath(WRITEPATH . 'uploads/youtube')
->extractAudio(true)
->audioFormat('mp3')
->audioQuality('0') // best
->output($video_id)
->url($youtubeLink)
);
But I'm getting this error:
"Error downloading video: [youtube] DpoeBatCwBQ: Sign in to confirm you're not a bot. This helps protect our community. Learn more."
So I tried to use the authenticate method and changed the code like this:
$yt = new YoutubeDl();
$yt->setBinPath('C:\ffmpeg\bin\yt-dlp.exe');
$youtubeUsername = env('youtube_auth_username');
$youtubePassword = env('youtube_auth_password');
$collection = $yt->download(
Options::create()
->authenticate($youtubeUsername, $youtubePassword)
->downloadPath(WRITEPATH . 'uploads/youtube')
->extractAudio(true)
->audioFormat('mp3')
->audioQuality('0') // best
->output($video_id)
->url($youtubeLink)
);
But I'm still getting the same error.
How can I resolve this issue?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions