fixed release_downloads, now properly returning data

This commit is contained in:
jkaberg
2014-03-16 22:15:37 +01:00
parent a95671491d
commit f3cd569e77
+3 -2
View File
@@ -68,12 +68,13 @@ class qBittorrent(Downloader):
data['protocol'] = 'torrent' data['protocol'] = 'torrent'
info = bdecode(filedata)["info"] info = bdecode(filedata)["info"]
torrent_hash = sha1(bencode(info)).hexdigest().upper() torrent_hash = sha1(bencode(info)).hexdigest()
# Convert base 32 to hex # Convert base 32 to hex
if len(torrent_hash) == 32: if len(torrent_hash) == 32:
torrent_hash = b16encode(b32decode(torrent_hash)) torrent_hash = b16encode(b32decode(torrent_hash))
print torrent_hash
# Send request to qBittorrent # Send request to qBittorrent
try: try:
self.qb.add_file(filedata) self.qb.add_file(filedata)
@@ -106,7 +107,7 @@ class qBittorrent(Downloader):
for torrent in torrents: for torrent in torrents:
if torrent.hash in ids: if torrent.hash in ids:
self.qb.update_general() # get extra info torrent.update_general() # get extra info
torrent_files = [] torrent_files = []
t_files = torrent.get_files() t_files = torrent.get_files()