m1guelpf / yt-whisper

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

transcribe local files #28

Open sloganking opened 1 year ago

sloganking commented 1 year 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 1 year ago
iwasthesword commented 1 year 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 1 year ago

@iwasthesword

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

iwasthesword commented 1 year 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 1 year 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 1 year 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.