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

14 lines
564 B
Bash

#!/bin/bash
# A very simple script to send message using telegram.sh 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"
if [ "$3" == "add" ]; then
/downloads/.telegram/telegram.sh -T "qBittorrent" -M "The torrent '$name' ($size) has been added."
elif [ "$3" == "fin" ]; then
/downloads/.telegram/telegram.sh -T "qBittorrent" -M "The torrent '$name' ($size) has finished downloading."
fi