debian 13.0, downloaded yt-dlp with wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O ~/.local/bin/yt-dlp

the python script is in that directory, but if I execute yt-dlp on the terminal it returns bash: yt-dlp: command not found

what should I do?

SOLVED: add .local/bin to your $PATH

  • onlooker@lemmy.ml
    link
    fedilink
    arrow-up
    9
    ·
    26 days ago

    I’ll assume you’re new to Debian, so apologies if this is not true. The reason I say this is because generally speaking, “installing with wget” isn’t how one is supposed to install software in Debian, using a program called apt is. yt-dlp is available in Debian 13’s repositories. What I suggest doing is running apt install yt-dlp as root. That way the app will be installed globally, meaning it’ll work without the system spitting out the error you’ve described. And on another positive note, the app will get updated automatically whenever you upgrade the system.

    If this isn’t for you, suggestions from other users here are valid and helpful.

  • BombOmOm@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    26 days ago

    I believe you simply downloaded the file to ~/.local/bin/yt-dlp, you did not install it. You need to either add that location to your path or you need to cd to that folder in terminal, then run the command. It will check things in the current folder when trying to run executables.

  • Mikelius@lemmy.ml
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    26 days ago

    Add

    PATH="${PATH}:~/.local/bin"
    

    To your .zhrc or .bashrc (whatever you use) and either source the file or open a new terminal. Should be as simple as that (assuming +x permissions)

  • NauticalNoodle@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    26 days ago

    Have you consulted the ‘README’ that is both in the yt-dlp directory as well as the github regarding installation?

  • Auster@lemmy.world
    link
    fedilink
    arrow-up
    2
    arrow-down
    1
    ·
    26 days ago

    Don’t Python scripts need python at the beginning of the command that summons them?

    Alternatively, you can make an alias to ~/.bashrc: alias yt-dl="python3 /path/to/yt-dlp [options] " And replace [options] for flags you may want to always use, if any. Or delete if you just want the raw script to be tied to a terminal command.

    Then reload .bashrc by running either source .bashrc or . .bashrc

    • SteveTech@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      ·
      26 days ago

      Don’t Python scripts need python at the beginning of the command that summons them?

      Not if the script has a python shebang (e.g. #!/usr/bin/env python3), then it will run like any other script.