2024-09-12 08:36:06 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Required parameters:
|
|
|
|
# @raycast.schemaVersion 1
|
2024-09-12 08:42:47 -07:00
|
|
|
# @raycast.title Extract YouTube Info
|
2024-09-12 08:36:06 -07:00
|
|
|
# @raycast.mode fullOutput
|
|
|
|
|
|
|
|
# Optional parameters:
|
|
|
|
# @raycast.icon 📹
|
|
|
|
# @raycast.argument1 { "type": "text", "placeholder": "YouTube link", "optional": false, "percentEncoded": true }
|
|
|
|
|
|
|
|
# Documentation:
|
2024-09-12 08:42:47 -07:00
|
|
|
# @raycast.description Run yt on a YouTube link
|
2024-09-12 08:36:06 -07:00
|
|
|
# @raycast.author Daniel Miessler
|
|
|
|
# @raycast.authorURL https://github.com/danielmiessler
|
|
|
|
|
|
|
|
# Set PATH to include common locations and $HOME/go/bin
|
|
|
|
PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/go/bin:$PATH"
|
|
|
|
|
2024-09-12 08:42:47 -07:00
|
|
|
# Check if yt command is available
|
|
|
|
if command -v yt >/dev/null 2>&1; then
|
|
|
|
# Directly call yt with the YouTube link
|
|
|
|
yt "${1}"
|
2024-09-12 08:36:06 -07:00
|
|
|
else
|
2024-09-12 08:42:47 -07:00
|
|
|
echo "Error: yt command not found in PATH"
|
2024-09-12 08:36:06 -07:00
|
|
|
echo "Current PATH: $PATH"
|
|
|
|
exit 1
|
|
|
|
fi
|
2024-09-12 08:42:47 -07:00
|
|
|
|