#!/bin/sh # name: YouTube DL # version: 0.1.0 # description: TODO. # authors: ["Mathieu Ablasou "] # license: MIT # dependencies: ["gum", "yt-dlp"] # macos_install: brew install gum yt-dlp # docs: no # tests: no set -e gum format "Choose where to download files:" TARGET_DIRECTORY=$(gum file --file=false --directory) echo "> $TARGET_DIRECTORY" while : do gum format "Enter a YouTube URL:" URL=$(gum input --placeholder="YouTube URL") test -n "$URL" gum spin --title="Downloading '$URL' at '$TARGET_DIRECTORY'..." -- yt-dlp -P "$TARGET_DIRECTORY" -- "$URL" gum format "Downloaded '$URL' at '$TARGET_DIRECTORY'." echo "$URL" >> "$TARGET_DIRECTORY/youtube_dl_history.txt" done