From 66ec7cb7cad2de49c513496f1c1b8b61a1e458bc Mon Sep 17 00:00:00 2001 From: nemunaire Date: Wed, 17 Dec 2014 07:07:54 +0100 Subject: [PATCH] [tpb] More usefull information --- modules/tpb.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/tpb.py b/modules/tpb.py index ab4d23c..f6e38a9 100644 --- a/modules/tpb.py +++ b/modules/tpb.py @@ -1,5 +1,7 @@ +from datetime import datetime import urllib +from tools import human from tools.web import getJSON nemubotversion = 3.4 @@ -34,6 +36,8 @@ def cmd_tpb(msg): if torrents: for t in torrents: - res.append_message("\x03\x02{title}\x03\x02 in {category}, {size}B; id: {id}; magnet: {magnet}".format(**t)) + t["sizeH"] = human.size(t["size"]) + t["dateH"] = datetime.fromtimestamp(t["date"]).strftime('%Y-%m-%d %H:%M:%S') + res.append_message("\x03\x02{title}\x03\x02 in {category}, {sizeH}; added at {dateH}; magnet: {magnet}; id: {id}".format(**t)) return res