diff options
author | Soispha <soispha@vhack.eu> | 2024-01-04 19:53:06 +0100 |
---|---|---|
committer | Soispha <soispha@vhack.eu> | 2024-01-04 19:53:06 +0100 |
commit | 552f466a1be0cb0fa794a44510e1c63c2528563a (patch) | |
tree | 279f0912d8a379a24268d1a585bdf931b26dab00 /hm | |
parent | fix(hm/pkgs/scr/ytcc/ytc): Keep sorting from input (diff) | |
download | nixos-config-552f466a1be0cb0fa794a44510e1c63c2528563a.tar.gz nixos-config-552f466a1be0cb0fa794a44510e1c63c2528563a.zip |
feat(hm/pkgs/scr/ytcc/ytc): Add support for direct urls
Diffstat (limited to 'hm')
-rwxr-xr-x | hm/soispha/pkgs/scripts/specific/ytcc/ytc | 9 |
1 files changed, 8 insertions, 1 deletions
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"; |