1
0

start moving youtube stuff into youtube

This commit is contained in:
dtb 2022-11-04 01:33:21 -04:00
parent 00821b83ab
commit e5d92f1e09

View File

@ -20,6 +20,22 @@ list_channels(){
done
}
stow(){
while str isvalue "$1"
do pig_fetch "$1" | xq -x "$(
date '+%Y-%m-%dT%T' \
| xargs printf '
. * { feed: { pig: {
feed_url: "%b",
pet_sound: "choo",
stow_date: "%b",
version: "0"
} } }' "$1" \
)" >"$(pig_pen)/$(pig_name "$1")"
shift
done
}
usage(){
printf "\
Usage: %s
@ -61,7 +77,11 @@ listen)
;;
refresh)
if ! str isvalue "$2"
then pig_feed # does this in bulk
then for file in "$(pig_pen)"/*
do pig_latin "$file" \
| jq '.feed_url' \
| xargs stow &
done
else
while str isvalue "$2"
do list_channels \
@ -69,7 +89,7 @@ refresh)
| cut -f 2 \
| xargs pig_latin \
| jq '.feed_url' \
| xargs pig_stow
| xargs stow
shift
done
fi
@ -77,7 +97,7 @@ refresh)
subscribe)
str isvalue "$2" && ! str isvalue "$3" \
|| usage
pig_stow "$(feedurl "$(id "$2")")"
stow "$(feedurl "$(id "$2")")"
;;
watch) # needs work
str isvalue "$2" \
@ -88,9 +108,7 @@ watch) # needs work
shift
done
;;
*)
usage
;;
*) usage ;;
esac
exit 0