Jacob Chapman

Results 111 comments of Jacob Chapman

I could see two options for fixing this: 1. Improve the speed of searching a lot (but it might not be enough unless you only look for subtitles that are...

yeah I think glob("*.vtt") + glob("*.srt") would be a lot faster... but also if you could add `--no-auto-subs` that would be nice

yeah I think the iterdir() is maybe the thing that's making it slow

yeah feel free to put some functions here and I'll test it from ipython

it should probably be video_path.stem not stem() on a small directory it already seems faster. I'll try the big one next ```py import re from pathlib import Path video =...

that is `ms`. It is quite a bit faster. The 3.902s seconds is from my shell; the time it took for [hyperfine](https://github.com/sharkdp/hyperfine) to exit (after running a test where it...

big improvement! the old code is taking `474.056 s` to run. hyperfine wants to run it a bunch of times to get a statistically significant result but that's gonna take...

hmmm yeah it prints `None` when I do ``` video = "/home/xk/d/75_MovieQueue/Lookism (外貌至上主义) EP.30 - Eng Sub (Chinese Drama) [bSA5udcf7mk].webm" ... print(newfunc()) ``` but the subtitle files are named like...

hmm same result my newfunc2 is a tiny bit faster but it's not working either ``` def newfunc(): video_path = Path(video) regex = re.compile(video_path.stem + r".*\.(vtt|srt)", re.I) for entry_path in...

I added re.escape and mine is working but not yours lol :/ ``` def newfunc(): video_path = Path(video) regex = re.compile(re.escape(video_path.stem) + r".*\.(vtt|srt)", re.I) for entry_path in video_path.parent.iterdir(): if regex.match(str(entry_path)):...