[~] Refactor

This commit is contained in:
Siarhei Siniak 2024-07-07 12:19:59 +03:00
parent 4d2e9a3fd7
commit 5db573c025

@ -204,7 +204,6 @@ def tiktok_videos_fetch(
error=0, error=0,
) )
with multiprocessing.Pool(processes=1) as pool:
for o in tqdm.tqdm(meta): for o in tqdm.tqdm(meta):
stats['total'] += 1 stats['total'] += 1
path = os.path.join( path = os.path.join(
@ -218,17 +217,14 @@ def tiktok_videos_fetch(
force force
): ):
try: try:
pool.apply( tiktok_video_fetch.apply_async(
tiktok_video_fetch,
kwds=dict(
id=o['id'], id=o['id'],
url=o['url'], url=o['url'],
fname=o['fname'], fname=o['fname'],
method=method, method=method,
method_str=method_str, method_str=method_str,
result_dir=o['result_dir'], result_dir=o['result_dir'],
), ).wait()
)
stats['saved'] += 1 stats['saved'] += 1
except KeyboardInterrupt: except KeyboardInterrupt:
break break