Added yt raycast script.

This commit is contained in:
Daniel Miessler 2024-09-12 09:21:44 -07:00
parent 18147de7ee
commit 9b3943e1a3

18
patterns/raycast/yt Normal file → Executable file
View File

@ -2,28 +2,26 @@
# Required parameters: # Required parameters:
# @raycast.schemaVersion 1 # @raycast.schemaVersion 1
# @raycast.title Extract YouTube Info # @raycast.title Get YouTube Transcript
# @raycast.mode fullOutput # @raycast.mode fullOutput
# Optional parameters: # Optional parameters:
# @raycast.icon 📹 # @raycast.icon 🧠
# @raycast.argument1 { "type": "text", "placeholder": "YouTube link", "optional": false, "percentEncoded": true } # @raycast.argument1 { "type": "text", "placeholder": "Input text", "optional": false, "percentEncoded": true}
# Documentation: # Documentation:
# @raycast.description Run yt on a YouTube link # @raycast.description Run fabric -y on the input text of a YouTube video to get the transcript from.
# @raycast.author Daniel Miessler # @raycast.author Daniel Miessler
# @raycast.authorURL https://github.com/danielmiessler # @raycast.authorURL https://github.com/danielmiessler
# Set PATH to include common locations and $HOME/go/bin # Set PATH to include common locations and $HOME/go/bin
PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/go/bin:$PATH" PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/go/bin:$PATH"
# Check if yt command is available # Use the PATH to find and execute fabric
if command -v yt >/dev/null 2>&1; then if command -v fabric >/dev/null 2>&1; then
# Directly call yt with the YouTube link fabric -y "${1}"
yt "${1}"
else else
echo "Error: yt command not found in PATH" echo "Error: fabric command not found in PATH"
echo "Current PATH: $PATH" echo "Current PATH: $PATH"
exit 1 exit 1
fi fi