Youtube-API icon indicating copy to clipboard operation
Youtube-API copied to clipboard

Can't get it to work

Open sFxMTA opened this issue 2 years ago • 10 comments

Hello, i installed and added to environment paths ffmpeg and yt-dlp but for some reasons this part of the code $dl->setBinPath($ytdlp); breaks my php page showing a HTTP ERROR 500, without it says {"error":true,"message":"\"youtube-dl\" executable was not found. Did you forgot to configure it's binary path? ex.: $yt->setBinPath('\/usr\/bin\/youtube-dl') ?."} I tried to configure it in my own way with $dl->setBinPath("C:\inetpub\wwwroot\yt_api\yt-dlp.exe"); but still doesn't works. Yeah if you wonder i'm using windows, not linux

sFxMTA avatar May 17 '22 15:05 sFxMTA

Never tested it on Windows so mhm

Did you try

$dl->setBinPath("C:\inetpub\wwwroot\yt_api");

or

$dl->setBinPath("C:\\inetpub\\wwwroot\\yt_api\\yt-dlp.exe");

Like only the folder or double quotes (not sure if that'll work)

MichaelBelgium avatar May 19 '22 11:05 MichaelBelgium

Never tested it on Windows so mhm

Did you try

$dl->setBinPath("C:\inetpub\wwwroot\yt_api");

or

$dl->setBinPath("C:\\inetpub\\wwwroot\\yt_api\\yt-dlp.exe");

Like only the folder or double quotes (not sure if that'll work)

Yes i tried tho the bin path is already set on environment variables aswell, but when i use setBinPath i get a error 500... I'm actually sticking with yt-dlp without any kind of php api but this is nasty, it would be way better with your api, also some commands with exec won't work due to permissions so yeah, i'd def stick with your api if i found a way to make it work, i was using it in the past with a linux vps and i loved it but now i'm on a windows vps and i can't switch

sFxMTA avatar May 21 '22 02:05 sFxMTA

Do you have yt-dlp folder added in PATH (, so you also can use it in CLI from anywhere) ? If you have it in PATH, I don't think you need $dl->setBinPath

EDIT: you could also try forward slashes

$dl->setBinPath("C:/inetpub/wwwroot/yt_api/yt-dlp.exe");

MichaelBelgium avatar May 21 '22 12:05 MichaelBelgium

Do you have yt-dlp folder added in PATH (, so you also can use it in CLI from anywhere) ? If you have it in PATH, I don't think you need $dl->setBinPath

EDIT: you could also try forward slashes

$dl->setBinPath("C:/inetpub/wwwroot/yt_api/yt-dlp.exe");

I got it in my environment variables, i could use it from any directory by just typing "yt-dlp link" in cmd along with ffmpeg

If i get rid of setBinPath the problem seems to be on getVideos

sFxMTA avatar May 21 '22 13:05 sFxMTA

If i get rid of setBinPath the problem seems to be on getVideos

What problem? I think that's progress, and that you don't ned setBinPath

MichaelBelgium avatar May 21 '22 13:05 MichaelBelgium

I recommend that you look into running docker on your Windows host, and deploy using that, if possible :)

dennorske avatar May 21 '22 19:05 dennorske

If i get rid of setBinPath the problem seems to be on getVideos

What problem? I think that's progress, and that you don't ned setBinPath

Notice: Undefined offset: 0 in C:\inetpub\wwwroot\yt_api\mic\convert.php on line 103

Fatal error: Uncaught Error: Call to a member function getError() on null in C:\inetpub\wwwroot\yt_api\mic\convert.php:105 Stack trace: #0 {main} thrown in C:\inetpub\wwwroot\yt_api\mic\convert.php on line 105

If i freeze getError the problem appears to be getVideos, so i guess the functions can't load properly for some reasons, i installed it through composer so i'm sure there's everything included

I recommend that you look into running docker on your Windows host, and deploy using that, if possible :)

Yeah i might eventually try it tho it would be my first time using docker

sFxMTA avatar May 22 '22 10:05 sFxMTA

That looks like it did not find any video's? What video are you trying to convert

MichaelBelgium avatar May 23 '22 20:05 MichaelBelgium

I tried with many different videos but everything gives the same, also not sure it's about the video since it cannot even reach getError

sFxMTA avatar May 24 '22 01:05 sFxMTA

Yes, whenever i set the bin path the page returns a 500 error :(


From: Michael V. @.> Sent: Thursday, May 19, 2022 1:02:35 PM To: MichaelBelgium/Youtube-API @.> Cc: sFx @.>; Author @.> Subject: Re: [MichaelBelgium/Youtube-API] Can't get it to work (Issue #34)

Never tested it on Windows so mhm

Did you try

$dl->setBinPath("C:\inetpub\wwwroot\yt_api");

or

$dl->setBinPath("C:\inetpub\wwwroot\yt_api\yt-dlp.exe");

Like only the folder or double quotes (not sure if that'll work)

— Reply to this email directly, view it on GitHubhttps://github.com/MichaelBelgium/Youtube-API/issues/34#issuecomment-1131548301, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANOMXENCXYWMP2QJS6AU63DVKYNUXANCNFSM5WFLRZRQ. You are receiving this because you authored the thread.Message ID: @.***>

sFxMTA avatar Oct 11 '22 08:10 sFxMTA

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Jun 04 '23 01:06 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Jun 12 '23 01:06 github-actions[bot]