mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-01 00:43:37 +00:00
Merge pull request #754 from adam111316/fix_blackhole
Fixes rejection of invalid torrent files
This commit is contained in:
commit
a21e455de7
1 changed files with 10 additions and 4 deletions
|
@ -166,7 +166,11 @@ class GenericProvider:
|
|||
else:
|
||||
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):
|
||||
"""
|
||||
|
@ -182,9 +186,11 @@ class GenericProvider:
|
|||
parser.stream._input.close()
|
||||
except:
|
||||
pass
|
||||
if mime_type != 'application/x-bittorrent':
|
||||
logger.log(u"Result is not a valid torrent file", logger.WARNING)
|
||||
return False
|
||||
if mime_type == 'application/x-bittorrent':
|
||||
return True
|
||||
|
||||
logger.log(u"Result is not a valid torrent file", logger.WARNING)
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
|
Loading…
Reference in a new issue