Private GIT

Skip to content
Snippets Groups Projects
Commit cac4af0e authored by echel0n's avatar echel0n
Browse files

Added a exception catcher to the verify download function to catch...

Added a exception catcher to the verify download function to catch corrupt/null torrent file exceptions.
parent 2e131862
No related branches found
No related tags found
No related merge requests found
......@@ -188,6 +188,7 @@ class GenericProvider:
# primitive verification of torrents, just make sure we didn't get a text file or something
if self.providerType == GenericProvider.TORRENT:
try:
parser = createParser(file_name)
if parser:
mime_type = parser._getMimeType()
......@@ -197,6 +198,8 @@ class GenericProvider:
pass
if mime_type == 'application/x-bittorrent':
return True
except Exception as e:
logger.log(u"Failed to validate torrent file: " + ex(e), logger.DEBUG)
logger.log(u"Result is not a valid torrent file", logger.WARNING)
return False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment