6.0 alpha 4 not finding the yt-dlp.exe or youtube-dp.exe that is placed in the same folder as gropple.exe, while 5.5 was #25

Closed
opened 2023-11-11 09:04:24 +10:30 by soulmaestro · 12 comments
soulmaestro commented 2023-11-11 09:04:24 +10:30 (Migrated from github.com)

where the 5.5-version didn't need the yt-dlp.exe to be added to the systems path on windows and just used the one that is sitting in the same folder as gropple's-executable, the 6.0 alpha v4 demands that it's added to the path or will not start the download.

error starting command 'yt-dlp': exec: "yt-dlp": cannot run executable found relative to current directory

Can this be reverted back to like 5.5 works ?
so that the 6.0 version is a drop-in replacement?

where the 5.5-version didn't need the yt-dlp.exe to be added to the systems path on windows and just used the one that is sitting in the same folder as gropple's-executable, the 6.0 alpha v4 demands that it's added to the path or will not start the download. error starting command 'yt-dlp': exec: "yt-dlp": cannot run executable found relative to current directory Can this be reverted back to like 5.5 works ? so that the 6.0 version is a drop-in replacement?
tardisx commented 2023-11-11 10:00:25 +10:30 (Migrated from github.com)

This was a security problem, fixed in the go compiler in version 1.19:

https://pkg.go.dev/os/exec#hdr-Executables_in_the_current_directory

You should be able to use .\yt-dlp.exe or maybe ./yt-dlp.exe instead

This was a security problem, fixed in the go compiler in version 1.19: https://pkg.go.dev/os/exec#hdr-Executables_in_the_current_directory You should be able to use `.\yt-dlp.exe` or maybe `./yt-dlp.exe` instead
soulmaestro commented 2023-11-12 04:37:25 +10:30 (Migrated from github.com)

can confirm that replacing "yt-dlp" (which is working in the 5.5-config) to ".\yt-dlp.exe" in all profiles (and not just 1) allows the configuration to be saved with 6.0a4 without the error that yt-dlp can not be found in path.

however, trying to use it will still give the above error

error starting command './yt-dlp.exe': exec: "yt-dlp.exe": cannot run executable found relative to current directory

and

error starting command '.\yt-dlp.exe': exec: "yt-dlp.exe": cannot run executable found relative to current directory

can confirm that replacing "yt-dlp" (which is working in the 5.5-config) to ".\yt-dlp.exe" in all profiles (and not just 1) allows the configuration to be saved with 6.0a4 without the error that yt-dlp can not be found in path. however, trying to use it will still give the above error error starting command './yt-dlp.exe': exec: "yt-dlp.exe": cannot run executable found relative to current directory and error starting command '.\yt-dlp.exe': exec: "yt-dlp.exe": cannot run executable found relative to current directory
soulmaestro commented 2023-11-12 04:56:27 +10:30 (Migrated from github.com)

because it will become a question:

yes yt-dlp.exe is in the same folder as gropple.

Directory of E:_gropple
15/09/2019 21:32 67.081.216 ffmpeg.exe
15/09/2019 21:32 66.966.528 ffplay.exe
15/09/2019 21:32 66.993.152 ffprobe.exe
09/04/2022 03:59 10.327.040 gropple-5.5.exe
14/03/2023 19:49 11.105.792 gropple-6.0.exe
21/01/2022 09:00 8.170.320 youtube-dl.exe
29/10/2023 15:35 13.848.884 yt-dlp.exe

because it will become a question: yes yt-dlp.exe is in the same folder as gropple. Directory of E:\_gropple 15/09/2019 21:32 67.081.216 ffmpeg.exe 15/09/2019 21:32 66.966.528 ffplay.exe 15/09/2019 21:32 66.993.152 ffprobe.exe 09/04/2022 03:59 10.327.040 gropple-5.5.exe 14/03/2023 19:49 11.105.792 gropple-6.0.exe 21/01/2022 09:00 8.170.320 youtube-dl.exe 29/10/2023 15:35 13.848.884 yt-dlp.exe
soulmaestro commented 2023-11-12 05:02:13 +10:30 (Migrated from github.com)

reading the info in the linked doc:

----quote----
var ErrDot = errors.New("cannot run executable found relative to current directory")

ErrDot indicates that a path lookup resolved to an executable in the current directory due to ‘.’ being in the path, either implicitly or explicitly. See the package documentation for details.

Note that functions in this package do not return ErrDot directly. Code should use errors.Is(err, ErrDot), not err == ErrDot, to test whether a returned error err is due to this condition.
----end quote----

the note makes it sounds like this is not the case in the code of gropple?

reading the info in the linked doc: ----quote---- var ErrDot = [errors](https://pkg.go.dev/errors).[New](https://pkg.go.dev/errors#New)("cannot run executable found relative to current directory") ErrDot indicates that a path lookup resolved to an executable in the current directory due to ‘.’ being in the path, either implicitly or explicitly. See the package documentation for details. Note that functions in this package do not return ErrDot directly. Code should use errors.Is(err, ErrDot), not err == ErrDot, to test whether a returned error err is due to this condition. ----end quote---- the note makes it sounds like this is not the case in the code of gropple?
tardisx commented 2023-11-12 09:55:45 +10:30 (Migrated from github.com)

The other statement in the doc:

Code that always wants to run a program from the current directory can be rewritten to say "./prog" instead of "prog".

Suggests that subverting the error should be unnecessary.

I will investigate, though I don't have easy access to a windows machine.

The other statement in the doc: > Code that always wants to run a program from the current directory can be rewritten to say "./prog" instead of "prog". Suggests that subverting the error should be unnecessary. I will investigate, though I don't have easy access to a windows machine.
soulmaestro commented 2023-11-26 12:14:57 +10:30 (Migrated from github.com)

same problem persists in 1.1.0
error starting command './yt-dlp.exe': exec: "yt-dlp.exe": cannot run executable found relative to current directory

likewise if i use a \ instead of /

if i don't use the './' or '.' before ytdlp.exe, it keeps whaling about 'not found in path', and if i use them tte config can be saved without an error, but it doesn't execute and pops up the above error, while both executables are within the same folder.

why does yt-dlp or youtube-dl have to be in the path anyway?
if it's not a full path or relative path given - for which the current workdir has to be known as well,
why can't it just first search in the workdir, or same folder as were gropple.exe itself is located ?
if that fails, go check $PATH

same problem persists in 1.1.0 error starting command './yt-dlp.exe': exec: "yt-dlp.exe": cannot run executable found relative to current directory likewise if i use a \ instead of / if i don't use the './' or '.\' before ytdlp.exe, it keeps whaling about 'not found in path', and if i use them tte config can be saved without an error, but it doesn't execute and pops up the above error, while both executables are within the same folder. why does yt-dlp or youtube-dl have to be in the path anyway? if it's not a full path or relative path given - for which the current workdir has to be known as well, why can't it just first search in the workdir, or same folder as were gropple.exe itself is located ? if that fails, go check $PATH
tardisx commented 2023-11-26 13:26:21 +10:30 (Migrated from github.com)

I know it still persists in 1.1.0, that's why I didn't close the bug.

As I said above, I do not have easy access to a windows machine for testing, or a lot of personal motivation to support windows as a platform. You will have to be patient.

I may be able to change it to work as you suggest, however the reason why looking in the current directory for executables was removed from go is because it is a security problem, and I'm not in the business of making software with deliberately introduced security problems.

I know it still persists in 1.1.0, that's why I didn't close the bug. As I said above, I do not have easy access to a windows machine for testing, or a lot of personal motivation to support windows as a platform. You will have to be patient. I may be able to change it to work as you suggest, however the reason why looking in the current directory for executables was removed from go is because it is a security problem, and I'm not in the business of making software with deliberately introduced security problems.
tardisx commented 2023-11-26 19:18:39 +10:30 (Migrated from github.com)

Hi @soulmaestro, there is a test release v1.1.1-alpha.1 that may fix your problem.

Please be aware that I have not validated this entirely - it may break non-portable mode and may need rework or reverting at least temporarily.

Hi @soulmaestro, there is a test release [v1.1.1-alpha.1](https://github.com/tardisx/gropple/releases/tag/v1.1.1-alpha.1) that may fix your problem. Please be aware that I have not validated this entirely - it may break non-portable mode and may need rework or reverting at least temporarily.
soulmaestro commented 2023-11-27 00:53:50 +10:30 (Migrated from github.com)

oh sorry for that, that was indeed my fault, i didn't look at the full patchnotes of 1.1.0.
I just noticed it not longer being an alpha-version and as such tested it, and gave the above update/feedback.

thanks for looking into it and i understand your stance on it.
testing with 1.1.1 alpha does seem to work (again) as 0.5.5 does/did with youtube-dl.exe and yt-dlp.exe in the same folder as gropple.exe

it's just that it has always been a drop-in update and it kept working like before, while all of the sudden it didn't anymore.

ps: my stance is that only looking at $path can be the same security risk as not doing it, as a malicious app or version of yt-dlp.exe or youtube-dl.exe can add itself to or overwrite $PATH and be used instead of the non-malicious version in the same dir as gropple.exe.

once again: tyvm for looking into it, finding a workable solution, and for the other QoL updates added to this very handy tool.

oh sorry for that, that was indeed my fault, i didn't look at the full patchnotes of 1.1.0. I just noticed it not longer being an alpha-version and as such tested it, and gave the above update/feedback. thanks for looking into it and i understand your stance on it. testing with 1.1.1 alpha does seem to work (again) as 0.5.5 does/did with youtube-dl.exe and yt-dlp.exe in the same folder as gropple.exe it's just that it has always been a drop-in update and it kept working like before, while all of the sudden it didn't anymore. ps: my stance is that only looking at $path can be the same security risk as not doing it, as a malicious app or version of yt-dlp.exe or youtube-dl.exe can add itself to or overwrite $PATH and be used instead of the non-malicious version in the same dir as gropple.exe. once again: tyvm for looking into it, finding a workable solution, and for the other QoL updates added to this very handy tool.
tardisx commented 2023-11-27 09:58:10 +10:30 (Migrated from github.com)

Good to know, thanks.

I'll leave this open until I've run some tests and made sure it doesn't break non-portable mode.

Good to know, thanks. I'll leave this open until I've run some tests and made sure it doesn't break non-portable mode.
tardisx commented 2023-11-28 22:51:34 +10:30 (Migrated from github.com)

Hi @soulmaestro ,

I've just released v1.1.1-alpha.2 which should still work correctly for you and also in non-portable mode (as I suspected I needed to fix some more things there to remain compatible).

I'd be appreciative if you could give it a try and make sure it's still working well for your setup.

Hi @soulmaestro , I've just released [v1.1.1-alpha.2](https://github.com/tardisx/gropple/releases/tag/v1.1.1-alpha.2) which should still work correctly for you and also in non-portable mode (as I suspected I needed to fix some more things there to remain compatible). I'd be appreciative if you could give it a try and make sure it's still working well for your setup.
tardisx commented 2023-12-09 10:45:36 +10:30 (Migrated from github.com)

Assuming still fixed.

Assuming still fixed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: justin/gropple#25
No description provided.