Show HN: Transcribe YouTube Videos
I often want to read the contents of YouTube videos but I don’t want to watch them, and YouTube’s captioning leaves a lot to be desired.
So I wrote a shell script that takes a URL, downloads the video, transcribes it with whisper, and turns it into a clean HTML page for reading.
11 comments
[ 3.2 ms ] story [ 37.8 ms ] thread---
Another use case is being able to quickly jump to a specific spot inside a video. Could you add timestamps with links that jump directly to that point in the video?
I accomplished something similar by modifying oTranscribe:
- https://otranscribe.netlify.app/?vsl=definedefine
- https://otranscribe.netlify.app/?vsl=letter
---
Finally, I'm a windows user so a whisper.cpp version would be nice~
A timestamp flag is also a good idea.
Will noodle on a whisper.cpp version!
A question: on mac I can `brew install whisper-cpp`. Is there any equivalent way to install it on a windows machine? I haven't used windows in a very long time.
I was able to do this:
With mlx_whisper, I just have to tell it to use a model and it will download it if it's not already present: https://github.com/llimllib/yt-transcribe/blob/244841f83d833...
so if I add whisper.cpp as a dependency, I also have to add huggingface-cli or something similar. It also seems like huggingface-cli is not available on scoop
The model is specified via whisper.exe `--model FNAME` parameter. By default, it looks for `models/ggml-base.en.bin`, but even that model must be downloaded separately.
So you could do this:
[1]: https://huggingface.co/ggerganov/whisper.cpp/blob/main/ggml-...Just forward the error message output by whisper, or even make a more user-friendly error message with instructions on how/where to download the models.
Whisper does provide a simple bash script to download models: https://github.com/ggerganov/whisper.cpp/blob/master/models/...
(As a Windows user, I can run bash scripts via Git Bash for Windows[1])
[1]: https://git-scm.com/download/win
(I used to upload videos to YouTube just to get the auto captions.)
I did some investigation, and it would not be difficult to convert the whisper LRC subtitle output into the format my fork of oTranscribe expects.
I already made a simple tool to convert YouTube TTML/SBV subtitle output: https://github.com/Leftium/otrgen
I'm working on a golang version that links to whisper.cpp directly to maybe make porting easier/possible