data tool (continue) fix 权息下载

This commit is contained in:
fasiondog 2018-12-05 00:37:05 +08:00
parent 6b37e7f662
commit 7bbd3ebd0c

View File

@ -53,7 +53,7 @@ class ImportWeightToSqliteTask:
self.queue.put([self.msg_name, '...', 0, 0, 0])
new_md5 = old_md5 = hashlib.md5(buffer).hexdigest()
dest_filename = self.dest_dir+'/weight.rar'
old_md5 = new_md5
old_md5 = None
if os.path.exists(dest_filename):
with open(dest_filename, 'rb') as oldfile:
old_md5 = hashlib.md5(oldfile.read()).hexdigest()
@ -64,7 +64,9 @@ class ImportWeightToSqliteTask:
file.write(net_file.read())
self.queue.put([self.msg_name, '...', 0, 0, 0])
os.system('unrar x -o+ -inul {} {}'.format(dest_filename, self.dest_dir))
x = os.system('unrar x -o+ -inul {} {}'.format(dest_filename, self.dest_dir))
if x != 0:
raise Exception("无法找到unrar命令")
self.queue.put([self.msg_name, '...', 0, 0, 0])
total_count = qianlong_import_weight(connect, self.dest_dir + '/weight', 'SH')