Skip to content
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

Recommend .local/bin instead of /usr/local/bin #10

Merged
merged 6 commits into from Jan 12, 2024

Conversation

dalto8
Copy link
Contributor

@dalto8 dalto8 commented Jan 1, 2023

Recommending running sudo yt-dlp -U is somewhat questionable advice from a security perspective.

To avoid this, we can modify the instructions to install to ~/.local/bin instead where sudo is not needed.

@bashonly
Copy link
Member

bashonly commented Jan 1, 2023

Agreed that sudo is not ideal here.
But the user might not have a ~/.local/bin directory and/or it may not be in their PATH

@dalto8
Copy link
Contributor Author

dalto8 commented Jan 1, 2023

Instructions could be provided to check that or it could be changed to write to a directory inside of ~ and run from there.

There is also no guarantee that /usr/local/bin is in your path or that sudo is installed.

@bashonly
Copy link
Member

bashonly commented Jan 1, 2023

Instructions could be provided to check that or it could be changed to write to a directory inside of ~ and run from there.

Sure, let's do that in this PR

@dalto8
Copy link
Contributor Author

dalto8 commented Jan 1, 2023

Sure, let's do that in this PR

I can do that. Which one? Ensuring that ~/.local/bin exists and is in the path or putting it in a different directory?

@bashonly
Copy link
Member

bashonly commented Jan 1, 2023

I think ~/.local/bin is a systemd convention, but it doesn't necessarily apply to all distros that use systemd (e.g. Arch doesn't create this directory or add it to PATH). Otherwise the conventional user binary dir is ~/bin. I guess it doesn't matter which one is used, as long as it will work for all Unix-like OSes

If you can come up with simple instructions for ensuring the directory exists and is in the PATH, that would be good. They do need to be applicable to MacOS, Linux and BSD though, so it may be tricky to come up with a simple & universal explanation for how to add a directory to the PATH (taking into account different shells, .profile vs .bash_profile, etc)

@pukkandan
Copy link
Member

pukkandan commented Jan 15, 2023

This is just overcomplicating the install instructions. Instead, we can keep the old one and simply add a line If "~/bin" is in your PATH, you can use it instead of "/usr/local/bin". But then again, the people who know if it's in the path don't need this instruction anyway...

@dalto8
Copy link
Contributor Author

dalto8 commented Jan 15, 2023

How about this version?

Installation.md Outdated Show resolved Hide resolved
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
@pukkandan pukkandan merged commit 7f2a4ee into yt-dlp:master Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants