animetosho2mks: Use parallel processing
This commit is contained in:
parent
b31f03679b
commit
61ef98c688
|
@ -1,9 +1,11 @@
|
|||
#!/usr/bin/env cached-nix-shell
|
||||
#!nix-shell -i python3 -p "python3.withPackages(ps: [ ps.tqdm ])" mkvtoolnix-cli
|
||||
from subprocess import run
|
||||
from tqdm import tqdm
|
||||
import glob
|
||||
import multiprocessing
|
||||
import os.path
|
||||
from subprocess import run
|
||||
|
||||
from tqdm import tqdm
|
||||
|
||||
|
||||
class SubtitleTrack:
|
||||
|
@ -69,5 +71,8 @@ class AnimeToshoFile:
|
|||
run(command, check=True)
|
||||
|
||||
|
||||
for file in tqdm(list(map(AnimeToshoFile, glob.glob("*.mkv")))):
|
||||
file.merge()
|
||||
files = list(map(AnimeToshoFile, glob.glob("*.mkv")))
|
||||
|
||||
|
||||
with multiprocessing.Pool() as pool:
|
||||
list(tqdm(pool.imap_unordered(AnimeToshoFile.merge, files), total=len(files)))
|
||||
|
|
Loading…
Reference in a new issue