Remove requests iter_content

- inter_content might have been the reason for repeated encoding issues
- let's try with good old r.text
This commit is contained in:
Noam
2016-02-17 16:20:37 +02:00
parent 5adf684dbe
commit da5ac9757a

View File

@@ -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