26 lines
620 B
Bash
Executable File
26 lines
620 B
Bash
Executable File
#!/bin/sh -e
|
|
if [ -z $2 ]
|
|
then
|
|
echo "First argument should be a category."
|
|
exit 2
|
|
fi
|
|
|
|
if [ ! -d "$HOME/ytdl/$1/" ]
|
|
then
|
|
mkdir -p "$HOME/ytdl/$1/"
|
|
update-ksh-completions
|
|
. $HOME/.kshrc.autocomplete
|
|
fi
|
|
cd "$HOME/ytdl/$1/"
|
|
shift
|
|
yt-dlp \
|
|
--print filename \
|
|
--cookies-from-browser firefox \
|
|
--user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:142.0) Gecko/20100101 Firefox/142.0" \
|
|
--preset-alias mp4 \
|
|
--embed-metadata \
|
|
--embed-subs \
|
|
--restrict-filenames \
|
|
-o "%(channel&{} - |)s%(uploader&{} - |)s%(playlist|&{} - )s%(playlist_index&{} - |)s%(title)s.%(ext)s" \
|
|
"$@"
|