diff --git a/bot.py b/bot.py index ae306e0..79eeb43 100644 --- a/bot.py +++ b/bot.py @@ -93,7 +93,7 @@ class QBittorrentAPICaller(): def torrentList(self, modifier=""): the_url = self.url + "/" + "api/v2/torrents/info" - to_ret = "" + to_ret = "```" for f in ["downloading", "completed"]: resp = self.session.post(the_url, data={"filter":f}) if resp.status_code != 200: @@ -106,9 +106,9 @@ class QBittorrentAPICaller(): to_ret += (self.truncate_string(p["name"]) if modifier == "full" else p["name"]) + " | " + "{:.2f}".format(float(p["progress"])*100) + "% | " + "{:.2f}".format(float(p["dlspeed"])/1000000) + " MB/s" + " | " + str(datetime.timedelta(seconds=int(p["eta"]))) + "\n" else: for p in parsed: - to_ret += p["name"] + "\n" + to_ret += (self.truncate_string(p["name"]) if modifier == "full" else p["name"]) + "\n" - to_ret += "--\n" + to_ret += "--\n```" return to_ret diff --git a/init.sh b/init.sh index 52beaa7..442075c 100755 --- a/init.sh +++ b/init.sh @@ -3,6 +3,7 @@ apk add python3 apk add py3-pip pip3 install --break-system-packages slixmpp + apk add py3-requests exec python3 /bot.py