antiboredom / videogrep

automatic video supercuts with python
https://antiboredom.github.io/videogrep
Other
3.33k stars 257 forks source link

FileNotFoundError: [Errno 2] No such file or directory: '' not finding subtitles #112

Closed wkrettek closed 2 years ago

wkrettek commented 2 years ago

This seems like a very basic issue but I can't figure out what's causing it. I'm running video grep on a file and it can't seem to find to proper transcript. I've tested with a .vtt file and the .json file generated with --transcribe (transcription still works). Anybody else run into this issue and have tips?

Traceback (most recent call last):
  File "/home/warren/.local/bin/videogrep", line 8, in <module>
    sys.exit(main())
  File "/home/warren/.local/lib/python3.10/site-packages/videogrep/cli.py", line 146, in main
    videogrep(
  File "/home/warren/.local/lib/python3.10/site-packages/videogrep/videogrep.py", line 472, in videogrep
    segments = search(files, query, search_type)
  File "/home/warren/.local/lib/python3.10/site-packages/videogrep/videogrep.py", line 207, in search
    transcript = parse_transcript(file, prefer=prefer)
  File "/home/warren/.local/lib/python3.10/site-packages/videogrep/videogrep.py", line 61, in parse_transcript
    subfile = find_transcript(videoname, prefer)
  File "/home/warren/.local/lib/python3.10/site-packages/videogrep/videogrep.py", line 32, in find_transcript
    all_files = [f.path for f in os.scandir(os.path.dirname(videoname)) if f.is_file()]
FileNotFoundError: [Errno 2] No such file or directory: ''
antiboredom commented 2 years ago

hi - can you paste in the full command you're typing?

wkrettek commented 2 years ago

Command is videogrep -i puzzle.mp4 -s "hot dish"

antiboredom commented 2 years ago

Thanks! also can you check what version of videogrep you're running and make sure it's the most recent?

wkrettek commented 2 years ago

Yeah, I just keep a copy of the repo. Just pulled again. Using poetry shell then switching into a new working directory. --version returns 2.1.1

antiboredom commented 2 years ago

Hmm - the latest version should be 2.1.2 (there was definitely a bug about finding transcripts in 2.1.1)

wkrettek commented 2 years ago

Upgraded to 2.1.2 from PyPi and and it works now! What probably happened is I was using the older version through my global videogrep, even though I was shelled into the repo, so it was probs my fault! Thanks!

antiboredom commented 2 years ago

Glad it’s working now!