Closed VijayQin closed 8 years ago
this issue is fix by adding try……exception when fetching torrent. try : u = urllib2.urlopen(torrent_url) torrent = u.read() u.close() fileName = self.formulate_title(torrent_url.split('/')[-1]) file_path = self.prune_title(path, fileName)
# f.write(torrent)
with DMHY_Write_file_exception(file_path, 'wb', url) as f :
f.write(torrent)
except urllib2.HTTPError, e:
if 404 == e.code :
print "HTTPError error({0}): {1}".format(e.code, e.reason)
else :
print e.code
print e.reason
raise
except Exception as e:
print e.code
print e.reason
raise
When parsing https://share.dmhy.org/topics/view/438761_Qualidea_Code_04_MP4_720p.html#description-end we will get urllib2.HTTPError: HTTP Error 404: Not Found because the torrent inside was delete.