31 lines
644 B
Bash
31 lines
644 B
Bash
|
# download video from URL in background.
|
||
|
vdl()
|
||
|
{
|
||
|
echo "$@" > src.txt
|
||
|
yt-dlp -f 'bestvideo[height<=?1081]+bestaudio/best' --download-archive index.txt --embed-thumbnail --embed-subs --write-auto-subs --embed-metadata --merge-output-format mkv -cio '%(playlist_index)000006d_%(id)s.%(ext)s' "$@"
|
||
|
}
|
||
|
|
||
|
# download all videos from file.
|
||
|
alias vdl_file="vdl -a"
|
||
|
|
||
|
# update playlist.
|
||
|
vdl_update()
|
||
|
{
|
||
|
local src="$(cat src.txt)"
|
||
|
vdl "$src"
|
||
|
}
|
||
|
|
||
|
# update all playlists recursively.
|
||
|
vdl_update_all()
|
||
|
{
|
||
|
local root="$PWD"
|
||
|
local dir
|
||
|
for file in **/src.txt; do
|
||
|
dir="${file%/*}"
|
||
|
cd "$dir"
|
||
|
echo "$PWD"
|
||
|
vdl_update
|
||
|
cd "$root"
|
||
|
done
|
||
|
}
|