You can easily download your own videos of youtube (or even your entire playlists) through the application youtube-dl
or yt-dlp
.
1. In (K)Ubuntu 24.04
In Kubuntu 24.04, I could download playlists with these apps that I could obtain from Discover app:
- Video Downloader. Its seems to be a nice and simple GUI for yt-dlp, which does all the job in the background for you, just after you paste the playlist url and select whether you want auidio or video.
- UMD4 (Ultimate Media Downloader). However, it seems to be an eavluation version, available for free during 15d
- Youtube Downloader. However, it seems to be an eavluation version, available for free during 3d
Other options, from console (youtube-dl, yt-dlp, failed for me for different reasons, even if I could make them work in previous kubuntu versions)
2. youtube-dl
2.1. Installation
In Ubuntu 24.04 - failed
You can download youtube playlist using playlist-dl
In Kubuntu:
https://snapcraft.io/install/playlist-dl/kubuntu#install
In other distros:
https://snapcraft.io/playlist-dl
Commands in a terminal window
sudo snap install playlist-dl
#playlist-dl 2.2 de keshavbhatt (keshavnrj✪) installed
However, it fails to work:
xavi@tricholoma:~/Baixades/Youtube$ playlist-dl
Gtk-Message: 14:39:13.122: Failed to load module "xapp-gtk3-module"
Gtk-Message: 14:39:13.261: Failed to load module "window-decorations-gtk-module"
Gtk-Message: 14:39:13.261: Failed to load module "colorreload-gtk-module"
Qt: Session management error: Could not open network socket
propsReply "An AppArmor policy prevents this sender from sending this message to this recipient; type=\"method_call\", sender=\":1.583\" (uid=1000 pid=119180 comm=\"/snap/playlist-dl/16/usr/bin/playlist-dl\" label=\"snap.playlist-dl.playlist-dl (enforce)\") interface=\"org.freedesktop.DBus.Properties\" member=\"GetAll\" error name=\"(unset)\" requested_reply=\"0\" destination=\"org.freedesktop.NetworkManager\" (uid=0 pid=1551 comm=\"/usr/sbin/NetworkManager --no-daemon\" label=\"unconfined\")"
nmReply "An AppArmor policy prevents this sender from sending this message to this recipient; type=\"method_call\", sender=\":1.583\" (uid=1000 pid=119180 comm=\"/snap/playlist-dl/16/usr/bin/playlist-dl\" label=\"snap.playlist-dl.playlist-dl (enforce)\") interface=\"org.freedesktop.NetworkManager\" member=\"GetDevices\" error name=\"(unset)\" requested_reply=\"0\" destination=\"org.freedesktop.NetworkManager\" (uid=0 pid=1551 comm=\"/usr/sbin/NetworkManager --no-daemon\" label=\"unconfined\")"
"Object path cannot be empty"
[119180:119180:0608/143913.425839:FATAL:credentials.cc(122)] Check failed: . : Permission denied (13)
Trampa de traçat/punt d’aturada (s'ha bolcat la memòria)
xavi@tricholoma:~/Baixades/Youtube$
In Ubuntu 22.04
I couldn't find youtube-dl, but could use yt-dlp
(see below)
In Ubuntu 20.04
You can install youtube-dl
from repositories, even if it won't be updated as frequently as needed sometimes, to get sync with youtube way of working. Therefore, you are encouraged to install through the command-line:
Commands in a terminal window
sudo apt update && sudo apt install youtube-dl # install programs from repos if you don't have them yet
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl # get latest version from developers site
sudo chmod a+rx /usr/local/bin/youtube-dl # fix permissions of the downloaded file
sudo youtube-dl -U # update your previous youtube-dl version
2.2. Usage
You can download your own youtube playlist with:
Commands in a terminal window
youtube-dl -ci "https://www.youtube.com/playlist?list=YOURPLAYLISTID" -o "%(title)s-%(id)s.%(ext)s"
Replace YOURPLAYLISTID with your own YouTube playlist id (note it's not your youtube channel ID, but the youtube playlist id). You can get it from the url of a video when shown through it's own playlist. That url might look like:
Therefore, the playlist id is that part after list= and before any ampersand (&) if any.
In this case: PLM2ch5TKp0OdtMZeqCOJQw6BwJ19VDcj4
Therefore, this would be the instruction in the command line:
Commands in a terminal window
youtube-dl -ci "https://www.youtube.com/playlist?list=PLM2ch5TKp0OdtMZeqCOJQw6BwJ19VDcj4" -o "%(title)s-%(id)s.%(ext)s"
And if you need in mp4 format only (because your tv doesn't accept some webm or mkv codec files, or whatever other reason), you can add these extra params -f 'bestvideoext=mp4+bestaudioext=m4a/mp4'
:
Commands in a terminal window
youtube-dl -ci -o "%(title)s-%(id)s.%(ext)s" -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' "https://www.youtube.com/playlist?list=PLM2ch5TKp0OdtMZeqCOJQw6BwJ19VDcj4"
2.3. Looking for a GUI for youtube-dl? youtube-dlg
There is a nice GUI called youtube-dlg, however, it doesn't seem to be updated as frequently as needed to keep it updated to latest youtube-dl changes (and therefore, with youtube changes).
You might try the GUI Download-DLG, in case it still works for you (if did for me months ago, but not currently, so I had to go to the command line to be able to fetch my own video playlist successfully)
#sudo add-apt-repository ppa:nilarimogard/webupd8 # needed once for youtube-dlg
sudo apt update && sudo apt install youtube-dlg # install programs from repos if you don't have them yet
# refresh youtube-dl from the commands above so that you have the latest version installed
Derived from:
3. yt-dlp
If youtube-dl doesn't work for you any more (it did fail for me in 2023-10), you can try installing yt-dlp
from discover app, or through pip, and launch the command with this program
Commands in a terminal window
yt-dlp -ci -o "%(title)s-%(id)s.%(ext)s" -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' "https://www.youtube.com/playlist?list=PLM2ch5TKp0OdtMZeqCOJQw6BwJ19VDcj4"
You can check the version of yt-dlp with:
$ yt-dlp -U
Current version: stable@2023.12.30 from yt-dlp/yt-dlp
Latest version: stable@2024.04.09 from yt-dlp/yt-dlp
If installed with pip, you will see this message:
ERROR: You installed yt-dlp with pip or using the wheel from PyPi; Use that to update
To upgrade you need to run a command out of two, it depends on how you installed it.
If you installed it via pip, use:
pip install --upgrade yt-dlp
otherwise use:
Example:
pip install --upgrade yt-dlp
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: yt-dlp in /home/xavi/.local/lib/python3.10/site-packages (2023.12.30)
Collecting yt-dlp
Downloading yt_dlp-2024.4.9-py3-none-any.whl (3.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.1/3.1 MB 391.7 kB/s eta 0:00:00
Requirement already satisfied: websockets>=12.0 in /home/xavi/.local/lib/python3.10/site-packages (from yt-dlp) (12.0)
Requirement already satisfied: pycryptodomex in /usr/lib/python3/dist-packages (from yt-dlp) (3.11.0)
Requirement already satisfied: brotli in /usr/lib/python3/dist-packages (from yt-dlp) (1.0.9)
Requirement already satisfied: requests<3,>=2.31.0 in /home/xavi/.local/lib/python3.10/site-packages (from yt-dlp) (2.31.0)
Requirement already satisfied: urllib3<3,>=1.26.17 in /home/xavi/.local/lib/python3.10/site-packages (from yt-dlp) (2.2.0)
Requirement already satisfied: mutagen in /home/xavi/.local/lib/python3.10/site-packages (from yt-dlp) (1.47.0)
Requirement already satisfied: certifi in /usr/lib/python3/dist-packages (from yt-dlp) (2020.6.20)
Requirement already satisfied: charset-normalizer<4,>=2 in /home/xavi/.local/lib/python3.10/site-packages (from requests<3,>=2.31.0->yt-dlp) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests<3,>=2.31.0->yt-dlp) (3.3)
Installing collected packages: yt-dlp
Attempting uninstall: yt-dlp
Found existing installation: yt-dlp 2023.12.30
Uninstalling yt-dlp-2023.12.30:
Successfully uninstalled yt-dlp-2023.12.30
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
spotdl 4.2.4 requires yt-dlp<2024.0.0,>=2023.11.16, but you have yt-dlp 2024.4.9 which is incompatible.
Successfully installed yt-dlp-2024.4.9
You might also install sitewide with root permissions, but it is not recommended. See below:
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Example run as root user:
sudo pip install --upgrade yt-dlp
[sudo] contrasenya per a xavi:
Collecting yt-dlp
Downloading yt_dlp-2024.4.9-py3-none-any.whl (3.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.1/3.1 MB 213.7 kB/s eta 0:00:00
Requirement already satisfied: brotli in /usr/lib/python3/dist-packages (from yt-dlp) (1.0.9)
Collecting mutagen
Downloading mutagen-1.47.0-py3-none-any.whl (194 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 194.4/194.4 KB 565.0 kB/s eta 0:00:00
Requirement already satisfied: certifi in /usr/lib/python3/dist-packages (from yt-dlp) (2020.6.20)
Collecting websockets>=12.0
Downloading websockets-12.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (130 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 130.2/130.2 KB 398.3 kB/s eta 0:00:00
Collecting requests<3,>=2.31.0
Downloading requests-2.31.0-py3-none-any.whl (62 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.6/62.6 KB 363.6 kB/s eta 0:00:00
Collecting urllib3<3,>=1.26.17
Downloading urllib3-2.2.1-py3-none-any.whl (121 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 121.1/121.1 KB 599.6 kB/s eta 0:00:00
Requirement already satisfied: pycryptodomex in /usr/lib/python3/dist-packages (from yt-dlp) (3.11.0)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests<3,>=2.31.0->yt-dlp) (3.3)
Collecting charset-normalizer<4,>=2
Downloading charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 142.1/142.1 KB 553.8 kB/s eta 0:00:00
Installing collected packages: websockets, urllib3, mutagen, charset-normalizer, requests, yt-dlp
Attempting uninstall: urllib3
Found existing installation: urllib3 1.26.5
Not uninstalling urllib3 at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'urllib3'. No files were found to uninstall.
Attempting uninstall: requests
Found existing installation: requests 2.25.1
Not uninstalling requests at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'requests'. No files were found to uninstall.
Successfully installed charset-normalizer-3.3.2 mutagen-1.47.0 requests-2.31.0 urllib3-2.2.1 websockets-12.0 yt-dlp-2024.4.9
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Derived from:
Alias names for this page:
playlist | playlists | Youtube | YoutubeLists | YoutubeList | Youtube Lists | Youtube List