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 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(){ usage(){
printf "\ printf "\
Usage: %s Usage: %s
@ -61,7 +77,11 @@ listen)
;; ;;
refresh) refresh)
if ! str isvalue "$2" 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 else
while str isvalue "$2" while str isvalue "$2"
do list_channels \ do list_channels \
@ -69,7 +89,7 @@ refresh)
| cut -f 2 \ | cut -f 2 \
| xargs pig_latin \ | xargs pig_latin \
| jq '.feed_url' \ | jq '.feed_url' \
| xargs pig_stow | xargs stow
shift shift
done done
fi fi
@ -77,7 +97,7 @@ refresh)
subscribe) subscribe)
str isvalue "$2" && ! str isvalue "$3" \ str isvalue "$2" && ! str isvalue "$3" \
|| usage || usage
pig_stow "$(feedurl "$(id "$2")")" stow "$(feedurl "$(id "$2")")"
;; ;;
watch) # needs work watch) # needs work
str isvalue "$2" \ str isvalue "$2" \
@ -88,9 +108,7 @@ watch) # needs work
shift shift
done done
;; ;;
*) *) usage ;;
usage
;;
esac esac
exit 0 exit 0