1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-10 19:35:08 -05:00

Merge pull request #754 from adam111316/fix_blackhole

Fixes rejection of invalid torrent files
This commit is contained in:
echel0n 2014-08-25 22:58:53 -07:00
commit a21e455de7

View File

@ -166,7 +166,11 @@ class GenericProvider:
else: else:
logger.log(u"Saved result to " + filename, logger.MESSAGE) logger.log(u"Saved result to " + filename, logger.MESSAGE)
return self._verify_download(filename) if self._verify_download(filename):
return True
logger.log(u"Failed to download result", logger.ERROR)
return False
def _verify_download(self, file_name=None): def _verify_download(self, file_name=None):
""" """
@ -182,9 +186,11 @@ class GenericProvider:
parser.stream._input.close() parser.stream._input.close()
except: except:
pass pass
if mime_type != 'application/x-bittorrent': if mime_type == 'application/x-bittorrent':
logger.log(u"Result is not a valid torrent file", logger.WARNING) return True
return False
logger.log(u"Result is not a valid torrent file", logger.WARNING)
return False
return True return True