From 552f466a1be0cb0fa794a44510e1c63c2528563a Mon Sep 17 00:00:00 2001 From: Soispha Date: Thu, 4 Jan 2024 19:53:06 +0100 Subject: feat(hm/pkgs/scr/ytcc/ytc): Add support for direct urls --- hm/soispha/pkgs/scripts/specific/ytcc/ytc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'hm/soispha/pkgs/scripts/specific') diff --git a/hm/soispha/pkgs/scripts/specific/ytcc/ytc b/hm/soispha/pkgs/scripts/specific/ytcc/ytc index 8306be7e..5d5da03a 100755 --- a/hm/soispha/pkgs/scripts/specific/ytcc/ytc +++ b/hm/soispha/pkgs/scripts/specific/ytcc/ytc @@ -56,8 +56,15 @@ if [ "$1" = "id" ]; then for id in "$@"; do ytcc --output json list --attributes url --ids "$id" | jq --raw-output 'map("\(.url);\(.id)") | join("\n")' >> "$bases"; done +elif [ "$1" = "url" ]; then + shift 1 + bases="$(mktmp)"; + for url in "$@"; do + # use 0 as a noop id + echo "$url;0" >> "$bases"; + done else - die "The first arg must be id, but it was: '$1'" + die "The first arg must be one of id or url, but it was: '$1'" fi [ -d "$STATUS_PATH" ] || mkdir "$STATUS_PATH"; -- cgit 1.4.1