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

new : Added qbt-send-msg.sh

This commit is contained in:
Sayantan Santra 2023-05-30 18:01:39 -05:00
parent 3022a5b273
commit be806fc459
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F
2 changed files with 15 additions and 1 deletions

View file

@ -1,4 +1,4 @@
![Number of scripts](https://img.shields.io/badge/number_of_scripts-34-blue) ![Number of scripts](https://img.shields.io/badge/number_of_scripts-35-blue)
# Random Scripts # Random Scripts
This repository is for random scripts I wrote mostly for personal use. This repository is for random scripts I wrote mostly for personal use.

14
qbt-send-msg.sh Normal file
View file

@ -0,0 +1,14 @@
#!/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