Skip to main content

ASB Auto Subs

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.

Getting Started

Clone the Repository

To get started, clone this repository:

git clone --recurse-submodules https://github.com/bpwhelan/asb-groq-sub.git
cd asb-groq-sub

Requirements

  • Python 3.8+
  • ffmpeg installed and available in your system's PATH
  • Required Python libraries (install via pip):
    pip install -r requirements.txt
    

Configure config.yaml

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).

  1. Open the config.yaml file in a text editor .
  2. 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"
    skip_language_check: false
    cookies: ""
    
  3. Save the file.

What Each Config Does:

  • 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.
  • skip_language_check: When true, bypasses YouTube metadata language validation entirely.
  • cookies: Cookies for authenticated yt-dlp requests.

Setup API Usage

Where to get Groq API Key? (REQUIRED)

Can sign up here https://console.groq.com/ and after sign up it will ask you to generate an api key.

Run the Script

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

ASBPlayer WebSocket Server

This project integrates with the ASBPlayer WebSocket server for subtitle synchronization. You can find more information about ASBPlayer and its WebSocket server here.

Contact

If you run into issues, you can make an issue here.

Credits

Donations

If you've benefited from this or any of my other projects, please consider supporting my work via Github Sponsors or Ko-fi.

Metadata

Release files for asb-groq-sub 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asb-groq-sub 1.0.0
File Size Uploaded
asb_groq_sub-1.0.0.tar.gz 20.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for asb-groq-sub 1.0.0
File Interpreter ABI Platform
asb_groq_sub-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 43.2 kB

Release files / asb_groq_sub-1.0.0.tar.gz

Download URL asb_groq_sub-1.0.0.tar.gz
Size 20.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e63cd62112fe653e4048170ebb4d2ec5f7b994386136efa778406914cfa641ad
BLAKE2b-256 checksum
How to use checksums
0b4e6c4b3950bdf8e02491acb9d8c09958152c46861920339bf1e94a86986d2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / asb_groq_sub-1.0.0-py3-none-any.whl

Download URL asb_groq_sub-1.0.0-py3-none-any.whl
Size 22.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6da1e3f29b0afc78af8faaa81c0a7a66d6923f0e772f5d618a574481a03d7b60
BLAKE2b-256 checksum
How to use checksums
263a913fa493007d21856abccdbb9d21961991683d43a14f16059c055caa96e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page