-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with yt-dlp #197
Comments
Not sure what's going on then, I've tested with this snippet and it works for me: <?php
require __DIR__.'/vendor/autoload.php';
$yt = new \YoutubeDl\YoutubeDl();
$yt->setBinPath('/usr/local/bin/yt-dlp');
$yt->debug(function ($type, $buffer) {
if (\Symfony\Component\Process\Process::ERR === $type) {
echo $buffer;
} else {
echo $buffer;
}
});
$options = \YoutubeDl\Options::create()
->downloadPath(__DIR__.'/dd')
->url('https://youtu.be/4A67iTiOD_g');
$collection = $yt->download($options);
echo "Download completed\n"; debug output
norkunas@norkunas-A5-K1:~/Projects/www/youtube-dl-php$ php issue197.php
[youtube] Extracting URL: https://youtu.be/4A67iTiOD_g
[youtube] 4A67iTiOD_g: Downloading webpage
[youtube] 4A67iTiOD_g: Downloading android player API JSON
[info] 4A67iTiOD_g: Downloading 1 format(s): 313+251
[info] Writing video metadata as JSON to: /home/norkunas/Projects/www/youtube-dl-php/dd/Юрий Шевчук, Дмитрий Емельянов — Родина, вернись домой.-4A67iTiOD_g.info.json
[download] Destination: /home/norkunas/Projects/www/youtube-dl-php/dd/Юрий Шевчук, Дмитрий Емельянов — Родина, вернись домой.-4A67iTiOD_g.f313.webm
[download] 100% of 300.89MiB in 00:00:10 at 27.53MiB/s
[download] Destination: /home/norkunas/Projects/www/youtube-dl-php/dd/Юрий Шевчук, Дмитрий Емельянов — Родина, вернись домой.-4A67iTiOD_g.f251.webm
[download] 100% of 4.42MiB in 00:00:00 at 23.28MiB/s
[Merger] Merging formats into "/home/norkunas/Projects/www/youtube-dl-php/dd/Юрий Шевчук, Дмитрий Емельянов — Родина, вернись домой.-4A67iTiOD_g.webm"
Deleting original file /home/norkunas/Projects/www/youtube-dl-php/dd/Юрий Шевчук, Дмитрий Емельянов — Родина, вернись домой.-4A67iTiOD_g.f313.webm (pass -k to keep)
Deleting original file /home/norkunas/Projects/www/youtube-dl-php/dd/Юрий Шевчук, Дмитрий Емельянов — Родина, вернись домой.-4A67iTiOD_g.f251.webm (pass -k to keep)
Download completed
|
|
Did you try with latest version of this library? But that maybe not related, because I've tested with 0.x, 1.x and it works for me. |
Final command line: '/usr/local/bin/yt-dlp' 'https://youtu.be/4A67iTiOD_g' (specially commented out all options) |
Maybe it has something related with options, dunno then.. |
The server and IP address are of course the same as in the first, in the second case. |
Does it fail only on your server? |
I only use one server. Until 02/17/2023 everything worked |
I mean does it work locally for you? Or you don't even test your app locally? :) |
I don't test locally. |
So will you give the final cmd with full options? |
Hello Norkunas, it is related to new youtube users usernames, yt-dlp team have made patch and soon will make it available in master branch. I have same issues with your wrapper.
You can read on original issue at yt-dlp Norkunas here : yt-dlp/yt-dlp#6247 |
Hello Norkunas, are you going to fix it soon ? Regards, |
Hi, i'm not sure what I should fix, if the issue was in yt-dlp? |
I had this issue before when I was using the youtube-dl and then we switched to yt-dlp, it worked on my local in this case, but it doesn't work on our staging server. And it doesn't even give us any error and it works when running in the terminal 😅 |
I need a reproducer otherwise it's impossible to guess what's the issue :) |
Ah I got mine solved, my re-installing |
Hi Tomas, if your php wrapper somehow processing user id, error started to appear instantly after this change on youtube platform and later yt-dlp was patched for youtube :
|
I'm not coder walked around code and found this entry, looks like this wrapper is involved in whole process, since i found this function :) I'm trying to get log error to work for this wrapper so I can give more details, my whole website is down since youtube have made changes :)
|
This wrapper just returns what the python binary returns :) |
Oh ok, I thought that being as an intermediate it could cause error for me in the whole process, I have found that wrapper is modified on my end it took me 2 days to figure it out comparing all lines in whole project. Thank you for great php wrapper you have made freely available to everyone. |
You're welcome 😉 |
how to fix this output: The system cannot find the path specified. |
Maybe you set the unexisting download path? |
Can u just update your repo? cuz i'm confused to use it when i tried your code and nothing happen <?php
declare(strict_types=1);
require __DIR__ . '/vendor/autoload.php';
use YoutubeDl\Options;
use YoutubeDl\YoutubeDl;
$yt = new YoutubeDl();
$yt->setBinPath('/usr/bin/youtube-dl');
$collection = $yt->download(
Options::create()
->downloadPath('/path/to/downloads')
->extractAudio(true)
->audioFormat('mp3')
->audioQuality('0') // best
->output('%(title)s.%(ext)s')
->url('https://www.youtube.com/watch?v=oDAw7vW7H0c')
);
foreach ($collection->getVideos() as $video) {
if ($video->getError() !== null) {
echo "Error downloading video: {$video->getError()}.";
} else {
echo "work";
$video->getFile(); // audio file
}
} |
@liwa-dev If nothing happened then I suggest to use a debugger or at least enable error handling in your front script to see what's happening, because there is nothing to update currently. and please do not comment on unrelated issues, because other people get useless notifications |
I am using yt-dlp:
$dl->setBinpath('/usr/local/bin/yt-dlp');
But I am getting an error:
ERR > ERROR: [youtube] 4A67iTiOD_g: Unable to extract uploader id; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
At the same time, if I call the command on the command line, then the video is downloaded without problems:
yt-dlp -vU https://youtu.be/4A67iTiOD_g
The problem arose after updating yt-dlp to the latest version on 02/17/2023.
The text was updated successfully, but these errors were encountered: