Running yt-dlp as root

I am a user of yt-dlp. When the app stopped working I went to the GitHub site of yt-dlp and discovered there was a fixed version and proceeded to install it.
I first uninstalled the OLD yt-dlp and then followed directions on the yt-dlp wiki site to install the revised app.

From yt-dlp wiki:
In UNIX-like OSes (MacOS, Linux, BSD), you can also install the same in one of the following ways:

sudo wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O /usr/local/bin/yt-dlp
sudo chmod a+rx /usr/local/bin/yt-dlp # Make executable

Not sure what has happened or what I did but now yt-dlp will only run in root.
Was the chmod command wrong?
Somewhere I have seen that running apps as root is not a good idea.
What can I do to change this back, if indeed running this app as root is not a good idea?

Well, yes, it is not a good idea to run such programs as root.

What’s the output from:

ls -ld /usr/local/bin/yt-dlp   /usr/local/bin

@LaQuirrELL just install as you user then…

wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O ~/bin/yt-dlp
chmod 0755 ~/bin/yt-dlp

Compare output of

echo $PATH

as root and other user.

@nrickert

dabud@localhost:~> ls -ld /usr/local/bin/yt-dlp /usr/local/bin
drwxr-xr-x 2 root root 4096 Feb 21 20:30 /usr/local/bin
-rwxr-xr-x 1 root root 2736998 Feb 17 07:52 /usr/local/bin/yt-dlp
dabud@localhost:~>

So I’m gathering that I need to change permissions, as this shows only root?
May seem a silly question, any idea how I made this root only? Was it the chmod command?

@malcolmlewis
So just reinstall and change the chmod command?

wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O ~/bin/yt-dlp
chmod 0755 ~/bin/yt-dlp

@arvidjaar

output is:
localhost:/home/dabud # echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
localhost:/home/dabud # exit
exit
dabud@localhost:~> echo $PATH
/home/dabud/.local/bin:/home/dabud/bin:/usr/local/bin:/usr/bin:/bin
dabud@localhost:~>

Not until 5 days ago. Tumbleweed is using now the latest upstream version yt-dlp 2023.02.17
Easiest would be to uninstall all the stuff you did and reinstall the packed version from OSS repo…

The OSS package is using the /usr/bin path…

I am having another problem that seems to relate to yt-dlp, although I am not sure if I should do a separate post.
I would like advice on this.

to download a song from spotify.com I use an app in terminal called ā€œspotdlā€

la@localhost:~> spotdl download [URL]

When I did this [above] what actually happened is I rec’d the following error msg that seems to be referring to yt-dlp: [not spotdl]
Exception: ERROR: XVqWXkMz9LY: Unable to extract uploader id; please report this issue on
GitHub - yt-dlp/yt-dlp: A youtube-dl fork with additional features and fixes , filling out the ā€œBroken siteā€ issue template properly. Confirm
you are on the latest version using yt-dlp -U

I have posted an issue at https://github.com/spotDL/spotify-downloader/issues/1750

but have rec’d no answer yet.

Not sure but, I do think that spotdl may link to youtube to get songs.

@hui
Thank you.
When I originally did that It wasn’t updating. Hence going to GitHub.
I would prefer to stay in my own backyard if possible. LOL

It shows as root root because you issued commands using sudo, effectively processing as if logged in as root. root root shows only who owns the file or directory and what group its owner belongs to. drwxr-xr-x indicates the directory is accessible to all users. -rwxr-xr-x indicates the file can be read and executed by all users, and can be modified or removed only by its owner: root.

1 Like

What exactly does it mean? Obviously, everyone who answers understands it differently. Show complete command line invocation and its full output were it runs and where it does not run.

@hui

Easiest would be to uninstall all the stuff you did and reinstall the packed version from OSS repo…

I uninstalled the yt-dlp version that would only run as root and went back to Yast and installed the version from Software Management. I checked the version and it stated that it was 02.17.2023.
I opened a terminal and tried a download from youtube.com and it gave me the old error:

dabud@localhost:~> yt-dlp K.D. Lang sings Leonard Cohen's Hallelujah - YouTube
[youtube] P_NpxTWbovE: Downloading webpage
[youtube] P_NpxTWbovE: Downloading android player API JSON
ERROR: [youtube] P_NpxTWbovE: Unable to extract uploader id; please report this i
ssue on GitHub - yt-dlp/yt-dlp: A youtube-dl fork with additional features and fixes , filling out the ā€œBroken siteā€ issue t
emplate properly. Confirm you are on the latest version using yt-dlp -U
dabud@localhost:~>

I tried to update yt-dlp thru terminal using yt=dlp -U and this msg was returned:

Latest version: 2023.02.17, Current version: 2022.08.02

So even though Yast>Software Management says it is the most current version [2023.02.17], the command in terminal [yt-dlp -U] tells me that my current version is 2022.08.02.

Not sure what is really going on here. Is there a more accurate way to tell which version is really installed?
Is there any way to make sure I have uninstalled everything and there are no lagging files that would be giving me this incorrect info??

Although I do not want to I have gone back to running yt-dlp under root as it is the only way it seems to work right now. When I check the version now I get:

dabud@localhost:~> yt-dlp -U
Latest version: 2023.02.17, Current version: 2023.02.17
yt-dlp is up to date (2023.02.17)
dabud@localhost:~>

@arvidjaar

Show complete command line invocation and its full output were it runs and where it does not run.

How do I do this?

I am NOT a user of yt-dlp. However yt-dlp is available on my machine upgraded to 20230225 and for sure it works perfectly:

3400G:~ # zypper if yt-dlp
Loading repository data...
Reading installed packages...


Information for package yt-dlp:
-------------------------------
Repository     : openSUSE-Tumbleweed-Oss
Name           : yt-dlp
Version        : 2023.02.17-1.1
Arch           : noarch
Vendor         : openSUSE
Installed Size : 2.8 MiB
Installed      : Yes
Status         : up-to-date
Source package : yt-dlp-2023.02.17-1.1.src
Upstream URL   : https://github.com/yt-dlp/yt-dlp
Summary        : Enhanced fork of youtube-dl, a video site downloader for offline watching
Description    : 
    yt-dlp is a command-line program to retrieve videos from
    YouTube.com and other video sites for later watching.

3400G:~ # 

Invocation by user karl:

 karl@3400G:~> yt-dlp https://www.youtube.com/watch?v=2pbWnxBxGGc
[youtube] Extracting URL: https://www.youtube.com/watch?v=2pbWnxBxGGc
[youtube] 2pbWnxBxGGc: Downloading webpage
[youtube] 2pbWnxBxGGc: Downloading android player API JSON
[info] 2pbWnxBxGGc: Downloading 1 format(s): 248+251
[download] Destination: UKRAINE-INVASION: "Für Putin ist Krieg ein Mittel der Politik!" Der fatale Irrtum des Westens [2pbWnxBxGGc].f248.webm
[download] 100% of   18.37MiB in 00:00:26 at 723.60KiB/s
[download] Destination: UKRAINE-INVASION: "Für Putin ist Krieg ein Mittel der Politik!" Der fatale Irrtum des Westens [2pbWnxBxGGc].f251.webm
[download] 100% of    1.68MiB in 00:00:02 at 843.90KiB/s
[Merger] Merging formats into "UKRAINE-INVASION: "Für Putin ist Krieg ein Mittel der Politik!" Der fatale Irrtum des Westens [2pbWnxBxGGc].webm"
Deleting original file UKRAINE-INVASION: "Für Putin ist Krieg ein Mittel der Politik!" Der fatale Irrtum des Westens [2pbWnxBxGGc].f251.webm (pass -k to keep)
Deleting original file UKRAINE-INVASION: "Für Putin ist Krieg ein Mittel der Politik!" Der fatale Irrtum des Westens [2pbWnxBxGGc].f248.webm (pass -k to keep)
karl@3400G:~> 

Presumably the malfunction is caused by inappropriate maintenance of your installation or clueless tinkering.