Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install-Update-Youtube-dl Linux Mint
# This is a simple script for install youtube-dl and creating a script in /etc/cron.daily
# to automatically update youtube-dl on a daily basis.
# can be executed with:
# sudo su -c "bash <(wget -qO- https://gist.githubusercontent.com/jonath92/0f6bf4606bc8a34be1bb0826c99b73d1/raw/914aabe6c4b15dc614f18c8816f5ad2828755c22/install-Update-Youtube-dl.sh)" root
# Remove apt version to prevent conflicts
apt purge -y youtube-dl
# Fix python not found error https://askubuntu.com/a/1149489/1013434
ln -s /usr/bin/python3 /usr/local/bin/python
# Install youtube-dl
# https://github.com/ytdl-org/youtube-dl#installation
curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
chmod a+rx /usr/local/bin/youtube-dl
# create script for daily update
UPDATE_PATH="/etc/cron.daily/update_youtube_dl"
touch ${UPDATE_PATH}
echo "#! /bin/sh" > ${UPDATE_PATH}
echo "youtube-dl --update" >> ${UPDATE_PATH}
chmod +x ${UPDATE_PATH}
# To uninstall youtube-dl run:
# sudo rm /usr/local/bin/youtube-dl /etc/cron.daily/update_youtube_dl
@vdbhb59
Copy link

vdbhb59 commented Sep 4, 2021

Does this still work? I keep getting update not found daily. :(

@jonath92
Copy link
Author

jonath92 commented Sep 4, 2021

It still works for me. All it does is to run youtube-dl --update every day (as root). These are the official installation instructions. So when there is something not working than it is something on your system I guess. Maybe reinstalling helps .... And obviously you need to be connected to the internet and not being behind some stupid blockade of a internet service provider or a ridiculous government (as in china).

@jezokshe
Copy link

I don’t know, I couldn’t get it to work, everything is complicated.
How about replacing this with yt-dlp
https://github.com/yt-dlp/yt-dlp

@jonath92
Copy link
Author

jonath92 commented Nov 26, 2021

@bamper45 thanks for reporting and sorry for that. Youtube-dl is not deprecated and it is working on my machine. I think your Problem might be caused by someting else. Can you provide more information what is not working? I.e what is the output when running youtube-dl on your machine?

@jezokshe
Copy link

@jonath92
Cjs-Message: 00:45:44.108: JS LOG: [LookingGlass/error] The following error occured at youtube download attempt: Error: /usr/bin/env: «python»: Нет такого файла или каталога
. The used download Command was: youtube-dl --output "/home/noob/%D0%97%D0%B0%D0%B3%D1%80%D1%83%D0%B7%D0%BA%D0%B8/%(title)s.%(ext)s" --extract-audio --audio-format mp3 ytsearch1:"Oasis - Some Might Say" --add-metadata --embed-thumbnail
Cjs-Message: 00:45:44.293: JS LOG: [LookingGlass/warning] Invalid or null source id used when attempting to run Mainloop.source_remove()
overrideDumpStack/global.dump_gjs_stack@/usr/share/cinnamon/js/ui/overrides.js:99:42
overrideMainloop/Mainloop.source_remove@/usr/share/cinnamon/js/ui/overrides.js:133:20
_updateNotificationTimeout@/usr/share/cinnamon/js/ui/messageTray.js:1106:22
_showNotificationCompleted@/usr/share/cinnamon/js/ui/messageTray.js:1095:14
_tweenComplete@/usr/share/cinnamon/js/ui/messageTray.js:1007:24
_addHandler/params[name]@/usr/share/cinnamon/js/ui/tweener.js:256:24
_callOnFunction@resource:///org/gnome/gjs/modules/script/tweener/tweener.js:208:16
_updateTweenByIndex@resource:///org/gnome/gjs/modules/script/tweener/tweener.js:339:24
_updateTweens@resource:///org/gnome/gjs/modules/script/tweener/tweener.js:352:18
_onEnterFrame@resource:///org/gnome/gjs/modules/script/tweener/tweener.js:367:10
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:133:47
_onNewFrame@/usr/share/cinnamon/js/ui/tweener.js:413:14
_init/<@/usr/share/cinnamon/js/ui/tweener.js:389:22

Cinnamon warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x72000f8 (.xsession-)

@jezokshe
Copy link

@jonath92
Yutoube-dl has not been updated for many months, it works for me through the terminal, but the speed is not more than 50 / kb, like most. This development seems to have been abandoned. Now yt-dlp is working as it should.

@jezokshe
Copy link

jezokshe commented Nov 26, 2021

@jonath92
Снимок экрана от 2021-11-27 00-59-14
yt-dlp speed

@jonath92
Copy link
Author

@bamper45 You are right youtube-dl has indeed not been uploaded since month. I will consider switching to the fork you mention in the Radio applet tomorrow but I think there is also a Bug in the applet which is indepent of youtube-dl. Can you tell me which folder you have set in the applet settings for the music download directory?

@jonath92
Copy link
Author

@bamper45 the youtube-dl is not working in the radio applet due to a Bug in Cinnamon when using non UTF-8 characters in folder names. See: linuxmint/cinnamon#10487. I think the download should work when you use a different download folder.

@jezokshe
Copy link

@jonath92 Yes, I used the downloads folder (name in Russian) maybe because of this. And yes, I also found a folder in my home directory like this "% D1% 82% D0% B0% D0% BA% D0% BE% D0% B3% D0% BE" and it contained 2 tracks (similar to this program )
Now I cannot change and double-check, but then I will write.
Thanks for the answer!

@jonath92
Copy link
Author

@bamper45 You are welcome. Feel free to click the like Button on https://cinnamon-spices.linuxmint.com/applets/view/297 as this helps me to increase my Reputation as a Software developer ;-)

@jimalex71
Copy link

jimalex71 commented Sep 28, 2022

Downloading with youtube-dl works but the log says the file can't be copied from tmp.

Gjs-Message: 15:05:36.113: JS LOG: [LookingGlass/error] Failed to copy download from tmp dir. The following error occurred: Error moving file /tmp/.123AB1/abcdefghi.mp3: No such file or directory

@jonath92
Copy link
Author

What do you mean with "youtube-dl" works? Is the Song in the end downloaded to the directory you selected in the settings? Does the directory you selected in the settings exist? Because this is the only thing I can imagine throwing such Kind of error..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment