2023-12-31 21:59:50 +01:00
|
|
|
########################################################################
|
|
|
|
# YOUTUBE-DL
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
ytdl_playlist() {
|
|
|
|
yt-dlp \
|
|
|
|
-o '%(playlist_title)s/%(title)s.%(ext)s' \
|
|
|
|
"$@";
|
|
|
|
}
|
|
|
|
|
|
|
|
ytdl_channel() {
|
|
|
|
yt-dlp \
|
|
|
|
--download-archive ytdl_channel.txt \
|
|
|
|
-o '%(upload_date)s - %(title)s.%(ext)s' \
|
|
|
|
"$@";
|
|
|
|
}
|
|
|
|
ytdl_bandcamp() {
|
|
|
|
yt-dlp \
|
|
|
|
--extract-audio \
|
|
|
|
--audio-format mp3 \
|
|
|
|
--embed-thumbnail \
|
|
|
|
--add-metadata \
|
|
|
|
-o '%(artist)s/%(album)s/%(track_number)02d - %(track)s.%(ext)s' \
|
|
|
|
"$@";
|
|
|
|
}
|
|
|
|
ytdl_audio() {
|
|
|
|
yt-dlp \
|
|
|
|
-f bestaudio \
|
|
|
|
--extract-audio \
|
|
|
|
--embed-thumbnail \
|
|
|
|
--add-metadata \
|
|
|
|
-o "%(title)s-%(id)s.%(ext)s" \
|
|
|
|
"$@";
|
|
|
|
}
|
2024-01-18 08:06:35 +01:00
|
|
|
|
2023-12-31 21:59:50 +01:00
|
|
|
xdl() {
|
2024-01-17 18:18:42 +01:00
|
|
|
if [ ! -z $2 ]
|
|
|
|
then
|
|
|
|
mkdir -p "$HOME/x/$1/"
|
|
|
|
cd "$HOME/x/$1/" && yt-dlp "$2"
|
|
|
|
ksh-update-completions
|
|
|
|
else
|
|
|
|
echo "First argument should be a category."
|
|
|
|
fi
|
2023-12-31 21:59:50 +01:00
|
|
|
}
|
|
|
|
|
2024-01-17 18:18:42 +01:00
|
|
|
ytdl() {
|
|
|
|
if [ ! -z $2 ]
|
|
|
|
then
|
|
|
|
mkdir -p "$HOME/Videos/YouTube/$1/"
|
2024-01-18 08:06:35 +01:00
|
|
|
cd "$HOME/Videos/YouTube/$1/" \
|
|
|
|
&& yt-dlp -o '%(upload_date)s - %(title)s.%(ext)s' "$2"
|
2024-01-17 18:18:42 +01:00
|
|
|
ksh-update-completions
|
|
|
|
else
|
|
|
|
echo "First argument should be a category."
|
|
|
|
fi
|
|
|
|
}
|