dotfiles/home/default/scripts/append-urls-to-titles
2021-11-29 12:59:03 -05:00

24 lines
512 B
Bash
Executable File

#!/usr/bin/env sh
set -eou pipefail
# Old script to get json url for some reason? Don't know why I did this
# youtube-dl -j --flat-playlist -a - | \
# jq -r '.id' | \
# sed 's_^_https://youtu.be/_' | \
# wget-titles-from-urls >> titles.txt
test -f append.txt
if [[ $? -ne 0 ]]; then
echo No append.txt found! Cannot append
exit
fi
if [[ ! -s append.txt ]]; then
echo append.txt is empty
exit
fi
cat append.txt | wget-titles-from-urls >> titles.txt
cat append.txt | youtube-audio
> append.txt