Fixed small bug in the getUrl function for helpers.

This commit is contained in:
echel0n 2014-03-19 23:17:18 -07:00
parent 36643acf5e
commit 4b1dc8a63e
2 changed files with 6 additions and 8 deletions

View file

@ -204,13 +204,12 @@ def _remove_file_failed(file):
def download_file(url, filename):
try:
with closing(requests.get(url, stream=True)) as r:
with open(filename, 'wb') as fp:
for chunk in r.iter_content(chunk_size=(16 *1024)):
if chunk:
fp.write(chunk)
fp.flush()
fp.close()
r = requests.get(url, stream=True)
with open(filename, 'wb') as fp:
for chunk in r.iter_content(chunk_size=1024):
if chunk:
fp.write(chunk)
fp.flush()
except requests.HTTPError, e:
_remove_file_failed(filename)

View file

@ -243,7 +243,6 @@ def _xem_refresh(indexer_id):
try:
logger.log(u'Looking up XEM scene mapping for show %s on %s' % (indexer_id, indexer,), logger.DEBUG)
#data = getURL('http://thexem.de/map/all?id=%s&origin=tvdb&destination=scene' % (indexer_id,))
data = None
if 'Tvdb' in indexer:
data = requests.get('http://thexem.de/map/all?id=%s&origin=tvdb&destination=scene' % (indexer_id,)).json()