Commit 155227b6 authored by hujun's avatar hujun

Revert "1"

This reverts commit f849aae0.
parent f849aae0
......@@ -25,6 +25,7 @@ class DownFile:
self.save_path = save_path
self.page_string = page_string
self.call_date_string = call_date_string
self.lock = threading.Lock()
@staticmethod
def ali_yun_sdk(call_time, call_id):
......@@ -89,6 +90,9 @@ class DownFile:
if len(item['voice_file']) > 0:
local_file = self.save_path + item['voice_file']
if self.check_file(local_file):
self.lock.acquire()
self.old_num = self.old_num + 1
self.lock.release()
continue
time_array = time.strptime(item['call_time'], '%Y-%m-%d %H:%M:%S')
......@@ -136,13 +140,22 @@ class DownFile:
continue
if self.check_file(local_file):
self.lock.acquire()
self.old_num = self.old_num + 1
self.lock.release()
continue
self.check_dir(self.save_path + local_dir)
result = request.urlretrieve(url, local_file)
self.lock.acquire()
self.download_num = self.download_num + 1
self.lock.release()
self.log('url', url)
self.log('download_file', result)
self.log("download_num", self.download_num)
self.log("old_num", self.old_num)
def download_remote(self, data):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment