更新
This commit is contained in:
parent
b4423f9084
commit
41c6c887f5
@ -61,11 +61,13 @@ def tasks(device: str, start_time: str, end_time: str):
|
||||
start = datetime.datetime.now()
|
||||
start_str = start.strftime("%Y-%m-%d %H:%M:%S.%f")
|
||||
print(f"{start_str} 开始下载: {url}")
|
||||
urllib.request.urlretrieve(url,
|
||||
f"{tmp_path}/{device}_{start_time}_{end_time}.mp4")
|
||||
file_path = f"{tmp_path}/{device}_{start_time}_{end_time}.mp4"
|
||||
urllib.request.urlretrieve(url, file_path)
|
||||
end = datetime.datetime.now()
|
||||
print(
|
||||
f"{device} {start_time}-{end_time}: 下载用时: {(end - start).total_seconds()} 秒")
|
||||
stats = os.stat(file_path)
|
||||
print(f"文件 {file_path} 大小: {stats.st_size}")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
Reference in New Issue
Block a user