about summary refs log tree commit diff stats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xhm/soispha/pkgs/scripts/specific/ytcc/ytc9
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";