====== youtube-dl ======
===== Installation =====
sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
=== Nötige Pakete ===
apt-get install jq
===== Datei download =====
youtube-dl
youtube-dl --list-extractors --> Verfügbare Sites zum Download
youtube-dl -x --audio-format mp3 --audio-quality 5 --> extrahier mp3 aus dem Video
youtube-dl -F --> Verfügbare qualität der Videos
youtube-dl -f --> läd Video mit vorgegebener qualität runterladen
youtube-dl -f bestaudio -o - | ffplay -nodisp -autoexit -i -
===== Playlist download =====
Bsp. Youtube:\\
Playlist auswählen/anklicken -> Fenster mit 1. Video -> rechts Playlist (alle Videos) -> Playlist-Name rechte Maus -> Link-Adresse kopieren\\
z.B.: https://www.youtube.com/playlist?list=PLzMcBGfZo4-kwmIcMDdXSuy_wSqtU-xDP (Playlist-URL)
youtube-dl --continue --ignore-errors
youtube-dl -ci
youtube-dl -ci -o "%(title)s-%(id)s.%(ext)s"
===== Video-Liste erstellen =====
Liste mit Video-URLs
youtube-dl -j --flat-playlist "https://www.youtube.com/path/to/videos" | jq -r '.id, .title' | sed 's_^_https://youtu.be/_;n' > video_list.txt
Liste mit Video-URLs und Titel
youtube-dl -j --flat-playlist "https://www.youtube.com/path/to/videos" | jq -r '.id, .title' | sed 's_^_https://youtu.be/_;n' > video_list_title.txt
====== yt-dlp ======
===== Installation =====
sudo curl -L 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
yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best"
cat urls
https://youtu.be/0tjWWS2DGmU
https://youtu.be/Cyqahzn-cXw
...
for i in `cat urls`
do
yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" $i
done