ASB Auto Subs is a tool for generating subtitles from YouTube videos using whisper locally, or groq remotely. It monitors the clipboard for YouTube links, as well as file path (shift right click "copy as path" on windows), gets the audio, and generates subtitles in .srt format. The project also integrates with the ASBPlayer WebSocket server for automatically loading subtitles.
Currently Hard-coded for japanese, but you can change it in groq_sub_gen/local.py or groq_sub_gen/remote.py to any language you want.
To get started, clone this repository:
git clone --recurse-submodules https://github.com/bpwhelan/asb-groq-sub.git
cd asb-groq-sub- Python 3.8+
ffmpeginstalled and available in your system's PATH- Required Python libraries (install via
pip):pip install -r requirements.txt
Before running the project, you need to configure the config.yaml file. This file contains essential settings, changing how asb-auto-subs will behave.
This will be generated on first run if it doesn't exist (idk where).
- Open the
config.yamlfile in a text editor . - Update the configuration values as needed. For example:
process_locally: true whisper_model: "small" GROQ_API_KEY: "" RUN_ASB_WEBSOCKET_SERVER: true model: "whisper-large-v3-turbo" # model: "whisper-large-v3" output_dir: "output" language: "ja" cookies: ""
- Save the file.
process_locally: Determines if the transcription is done locally or via the groq API.whisper_model: The whisper model to use for local transcription.GROQ_API_KEY: Your API key for accessing Groq's services.RUN_ASB_WEBSOCKET_SERVER: Whether to run the ASBPlayer WebSocket server.model: The groq transcription model to use.output_dir: Directory where output files are saved.language: Language code for transcription. Also used to check if the video's language is what we want.cookies: Cookies for authenticated yt-dlp requests.
Can sign up here https://console.groq.com/ and after sign up it will ask you to generate an api key.
The script monitors your clipboard for YouTube links. When a valid YouTube link is detected, it automatically downloads the audio, generates subtitles, saves them, and then sends them to the ASBPlayer WebSocket server.
To start the script:
python -m groq_sub_gen.mainThis project integrates with the ASBPlayer WebSocket server for subtitle synchronization. You can find more information about ASBPlayer and its WebSocket server here.
If you run into issues, you can make an issue here.
- https://github.com/killergerbah/asbplayer
- https://huggingface.co/spaces/Nick088/Fast-Subtitle-Maker/tree/main
- https://github.com/m1guelpf/yt-whisper for the yt-download logic/idea
If you've benefited from this or any of my other projects, please consider supporting my work via Github Sponsors or Ko-fi.