def sched_downloads(d_set,dl_dir,num_threads,vids):
d_set_dir = dl_dir+'/'+d_set+'/'
# Make the directory for this dataset
check_call(' '.join(['mkdir', '-p', d_set_dir]), shell=True)
# Tell the user when downloads were started
datetime.now().strftime("%Y-%m-%d %H:%M:%S")
# Download and cut in parallel threads giving
with futures.ProcessPoolExecutor(max_workers=num_threads) as executor:
fs = [executor.submit(dl_and_cut,vid) for vid in vids]
for i, f in enumerate(futures.as_completed(fs)):
# Write progress to error so that it can be seen
sys.stderr.write( \
"Downloaded video: {} / {} \r".format(i, len(vids)))
print( d_set+': All videos downloaded' )
评论列表
文章目录