1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-26 13:18:35 -06:00

change: Switched to Gotify for qbt-send-msg

This commit is contained in:
Sayantan Santra 2023-06-22 00:53:01 -05:00
parent e3db86ebcd
commit 70e293673d
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F

View file

@ -1,14 +1,16 @@
#!/bin/bash
# A very simple script to send message using telegram.sh whenever a torrent is added/completed
# A very simple script to send message using Gotify whenever a torrent is added/completed
# in qBittorrent. Just call the script from qBittorrent's external script option
# using <script> "%N" "%Z" (add/fin)
name="$1"
size="$(echo $2 | numfmt --to=iec --format %.2f)B"
url="https://example.com/message?token=<token>"
if [ "$3" == "add" ]; then
/downloads/.telegram/telegram.sh -T "qBittorrent" -M "The torrent '$name' ($size) has been added."
curl -X POST "$url" -F "title=qBittorrent" -F "message=The torrent '$name' has been added." -F "priority=4"
elif [ "$3" == "fin" ]; then
/downloads/.telegram/telegram.sh -T "qBittorrent" -M "The torrent '$name' ($size) has finished downloading."
size="$(echo $2 | numfmt --to=iec --format %.2f)B"
curl -X POST "$url" -F "title=qBittorrent" -F "message=The torrent '$name' ($size) has finished downloading."
fi