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:
parent
e3db86ebcd
commit
70e293673d
1 changed files with 5 additions and 3 deletions
|
@ -1,14 +1,16 @@
|
||||||
#!/bin/bash
|
#!/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
|
# in qBittorrent. Just call the script from qBittorrent's external script option
|
||||||
# using <script> "%N" "%Z" (add/fin)
|
# using <script> "%N" "%Z" (add/fin)
|
||||||
|
|
||||||
name="$1"
|
name="$1"
|
||||||
size="$(echo $2 | numfmt --to=iec --format %.2f)B"
|
size="$(echo $2 | numfmt --to=iec --format %.2f)B"
|
||||||
|
url="https://example.com/message?token=<token>"
|
||||||
|
|
||||||
if [ "$3" == "add" ]; then
|
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
|
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
|
fi
|
||||||
|
|
Loading…
Reference in a new issue