ASB Groq Sub (Name Pending)is a tool for generating subtitles from YouTube videos using a remote Gradio API. It monitors the clipboard for YouTube links, downloads 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+
ffmpeg
installed 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 such as the Gradio API URL and other parameters.
This will be generated on first run if it doesn't exist (idk where).
- Open the
config.yaml
file in a text editor . - Update the configuration values as needed. For example:
LOCAL_OR_REMOTE: 2 # 1 for "Local", 2 for "Remote" GROQ_API_KEY: "" GRADIO_URL: "Nick088/Fast-Subtitle-Maker" RUN_ASB_WEBSOCKET_SERVER: true hf_token: "" model: "whisper-large-v3-turbo" # model: "whisper-large-v3" output_dir: "output"
- Save the file.
Can sign up here https://console.groq.com/ and after sign up it will ask you to generate an api key.
This is optional... I recommend just using "local" with the GROQ_API_KEY
present in the config
Go here https://huggingface.co/spaces/Nick088/Fast-Subtitle-Maker
In the top right menu hit "Duplicate Space", sign up for an account, and it will eventually ask you for your groq api key, enter it there.
Once you are done with that, copy the space name, and put it in your config.yaml
.
You also will need to make an access token (hf_token in config), you can do that here.
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.main
This 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 ask in my Discord, or 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.