Youtube-dl requires authentication #250
Unanswered
StarEngineer89
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi @StarEngineer89 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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