yt-dlp-ntfy: more messages

This commit is contained in:
Lukáš Kucharczyk 2024-11-16 20:29:05 +01:00
parent 7728ebfb16
commit bb1eaa30ad
Signed by: lukas
SSH Key Fingerprint: SHA256:vMuSwvwAvcT6htVAioMP7rzzwMQNi3roESyhv+nAxeg
1 changed files with 3 additions and 2 deletions

View File

@ -12,12 +12,15 @@ fi
# Store the PID of the current process # Store the PID of the current process
echo $$ > "$PID_FILE" echo $$ > "$PID_FILE"
echo "Running as PID $(cat $PID_FILE)"
# Define ntfy server and channel # Define ntfy server and channel
NTFY_SERVER="https://notify.kucharczyk.xyz" NTFY_SERVER="https://notify.kucharczyk.xyz"
CHANNEL="clipboard" CHANNEL="clipboard"
ACCESS_TOKEN="$NTFY_ACCESS_TOKEN" ACCESS_TOKEN="$NTFY_ACCESS_TOKEN"
echo "Monitoring channel $CHANNEL of server $NTFY_SERVER"
# Run the script in an infinite loop to listen for new messages # Run the script in an infinite loop to listen for new messages
while true; do while true; do
while read -r message; do while read -r message; do
@ -29,8 +32,6 @@ while true; do
echo "Downloading video from $video_url" echo "Downloading video from $video_url"
yt-dlp "$video_url" yt-dlp "$video_url"
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" -d "Finished downloading." "$NTFY_SERVER/$CHANNEL" curl -s -H "Authorization: Bearer $ACCESS_TOKEN" -d "Finished downloading." "$NTFY_SERVER/$CHANNEL"
else
echo "Received non-URL message: $video_url"
fi fi
done done