m1guelpf / yt-whisper

Using OpenAI's Whisper to automatically generate YouTube subtitles
MIT License
1.37k stars 140 forks source link

transcribe local files #28

Open sloganking opened 2 years ago

sloganking commented 2 years ago

Fixed #25 . Just pass a directory path where you previously passed YouTube URLs, and the CLI will transcribe it. For now the output file name is the same as the entire directory. I leave naming the file to just the name of the video file as an exercise for later.

what-the-diff[bot] commented 2 years ago
iwasthesword commented 2 years ago

I support this PR, awesome feature to have. A few changes I had to made to get it working for me (fork with the changes):

Other than this it's working nicely, thank you

sloganking commented 2 years ago

@iwasthesword

Revert this change as it was giving me error ModuleNotFoundError: No module named 'utils'

iwasthesword commented 2 years ago
  • The reverted change is the only commit in this PR. Did you need to put a . in front of utils? It was in the original project, but it caused crashing for me. I'm not sure why. Are you running this program via running python ./yt_whisper/cli.py or something else?

I'm using as instructed in the README, install via github then yt_whisper

  • This PR added validators to requirments.txt, so pip install -r requirements.txt (which is in the installation steps) should install it.

I think you need to add it to setup.py as well. This worked for me without having to install it manually.

sloganking commented 2 years ago

@iwasthesword

I'm using as instructed in the README, install via github then yt_whisper

Then that installs whatever version @m1guelpf has released on pip. Not what is in this unmerged pull request.

iwasthesword commented 2 years ago

Then that installs whatever version @m1guelpf has released on pip. Not what is in this unmerged pull request.

No, I used the same logic but targeted your repo and branch instead: pip install git+https://github.com/sloganking/yt-whisper.git@transcribe-local-files

deadcoder0904 commented 1 year ago

@sloganking i got this error while trying pip install git+https://github.com/sloganking/yt-whisper.git@transcribe-local-files:

Discarding git+https://github.com/openai/whisper.git@main#egg=whisper: Requested openai-whisper from git+https://github.com/openai/whisper.git@main#egg=whisper (from yt-whisper==1.0) has inconsistent name: expected 'whisper', but metadata has 'openai-whisper'
Collecting yt-dlp
  Using cached yt_dlp-2023.1.6-py2.py3-none-any.whl (2.8 MB)
ERROR: Could not find a version that satisfies the requirement whisper (unavailable) (from yt-whisper) (from versions: 0.9.5, 0.9.6, 0.9.7, 0.9.8, 0.9.9, 0.9.10, 0.9.11, 0.9.12, 0.9.13, 0.9.14, 0.9.15, 0.9.16, 1.0.0, 1.0.1, 1.0.2, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.1.8, 1.1.9, 1.1.10)
ERROR: No matching distribution found for whisper (unavailable)

couldn't get it to install for some reason but would love to have local file support.