From da5ac9757a6b90cdd4243370574eda5d24f95bd3 Mon Sep 17 00:00:00 2001 From: Noam Date: Wed, 17 Feb 2016 16:20:37 +0200 Subject: [PATCH] Remove requests iter_content - inter_content might have been the reason for repeated encoding issues - let's try with good old r.text --- headphones/deluge.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/headphones/deluge.py b/headphones/deluge.py index a33d4fd5..3c29b019 100644 --- a/headphones/deluge.py +++ b/headphones/deluge.py @@ -89,9 +89,10 @@ def addTorrent(link, data=None): r = requests.get(link, headers=headers) if r.status_code == 200: logger.debug('Deluge: 200 OK') - for chunk in r.iter_content(chunk_size=1024): - if chunk: # filter out keep-alive new chunks - torrentfile = torrentfile + chunk + torrentfile = r.text + #for chunk in r.iter_content(chunk_size=1024): + # if chunk: # filter out keep-alive new chunks + # torrentfile = torrentfile + chunk else: logger.debug('Deluge: Trying to GET %s returned status %d' % (link, r.status_code)) return False