gogadget
is a toolkit for producing immersion and priming materials for language learning.
- It tries to solve the problem that many of the most powerful tools available are hard to install, difficult to use or require lots of effort to configure for optimal results.
- It is capable of downloading audio and video files, automatically transcribing subtitles from videos and podcasts, and automatically producing filtered Anki decks with sentence audio / translations / screenshots / definitions.
Full documentation is available in the manual. If you want to dive straight in, you may find the following useful:
- Installation instructions: An installer is available for Windows and simple terminal commands are available for macOS
- Example commands: Simple examples of the most common commands.
- Detailed command reference: Every command listed with all possible parameters and examples. Warning - could be overwhelming!
- Video tutorial: A video tutorial covering the installation of the tool and an overview of its functions.
- Getting help with problems: How to get help with problems if you can't find the answer in the manual.
Click on the image below to view a video tutorial covering the installation of the tool and the use of its key functions. Alternatively, click here to read the manual.
- Simple, well documented interface that is consistent across each of its tools.
- Download video, audio and subtitle files.
- Automatic generation of subtitles from video and audio files.
- Produce filtered Anki decks from subtitles that:
- Contain images and sentence audio from the source video / audio files.
- Automatically filter out common and known words to reduce Anki review load.
- Prioritises words that are the most frequent in the source media.
- Include automatic translations of sentences and definitions of words.
- Can be built for an individual episode or a whole season.
- Create word frequency analyses for priming purposes.
- One click installer for Windows and simple installation steps for macOS and Linux.
- Ability to save defaults so that commands can be kept as short and memorable as possible.
- It supports 19 languages fully with partial support for many more.
- Once you have installed the resources for your language, all modules apart from
gogadget download
are fully offline. This makes it useful for travelling or for processing personal conversations as there is no server involved.
You may prefer to watch the Youtube Tutorial for demonstrations of the features, including configuration for more advanced users.
Download video from a website.
gogadget download --url "https://www.videosite.com/watch?v=videoid"
Note: The commands gogadget download-audio
and gogadget download-subtitles
are also available.
Automatically generate subtitles for a video / folder of videos that are in English (en
):
gogadget transcribe --input "your folder or filename" --language en
Note: If you have followed the steps in the installation instructions to enable GPU transcription, add --gpu
to the end of the command to significantly speed up the transcription.
Generate Anki cards from a full season of an Italian (it
) program. Include images / audio on the cards, translate the sentences to the default language (English) and exclude the 1000 most common Italian words:
gogadget anki-deck --input "folder name" --language it --excluded-words "ita_top_1000_words.xlsx"
See the manual for details on how to obtain dictionaries, exclude word spreadsheets and word audio to use with this command.
Note: You can set default parameters using gogadget set-defaults --custom
. Once you have set up your defaults, this would allow you use this shortened version of the command:
gogadget anki-deck --input "folder name"
An example for setting defaults can be found in the manual.
Installation instructions for Windows:
-
Download the latest version of the gogadget installer from this page.
-
Run the installer. It's highly recommended that you accept all of the default settings unless you know what you are doing!
-
You can run gogadget from the desktop shortcut, from the start menu or by right clicking inside a folder and selecting "Open gogadget here".
-
[Optional] You can install all of the models required for your chosen language. Type the following to get the instructions:
gogadget install
Note: If you want to enable GPU transcription of subtitles, please tick the "CUDA" checkbox in the installer. For more information, please see here.
Installation instructions for macOS:
-
Install homebrew if you haven't already got it installed by pasting the following line into the Terminal app and hitting enter.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Install the required support packages, using Terminal:
brew install ffmpeg uv
-
Install gogadget, using Terminal:
uv tool install gogadget --python 3.12 --upgrade
-
You can then run the tool by typing the following command into Terminal:
gogadget
-
[Optional] You can install all of the models required for your chosen language. Type the following into Terminal to get the instructions:
gogadget install
Installation instructions for Linux:
-
Install uv using the following terminal command. uv is a python package manager that is used to keep gogadget packages separate so that they don't interfere with your existing python installation.
curl -LsSf https://astral.sh/uv/install.sh | sh
-
Install required packages (if you don't already have them) using your package manager. This will depend on your distribution. For example:
- Ubuntu based distributions:
sudo apt install ffmpeg build-essential python3-dev
- Fedora based distributions:
sudo dnf install ffmpeg @development-tools python3-devel
- Arch based distributions:
sudo pacman -S ffmpeg base-devel
- Ubuntu based distributions:
-
Configure your paths if they aren't already set up:
source $HOME/.local/bin/env
-
Install gogadget using uv. Note that we are using Python 3.10 instead of Python 3.12 that the other platforms are using. This is to ensure that all dependencies build correctly on ARM CPUs.
uv tool install gogadget --python 3.10 --upgrade
-
You can then run the tool by typing the following command into your terminal:
gogadget
-
[Optional] You can install all of the models required for your chosen language. Type the following to get the instructions:
gogadget install
-
[Optional] If you wish to use your GPU instead of your CPU and your system is configured for CUDA. AFTER you run:
uv tool install gogadget --python 3.10 --upgrade
You can THEN run:
uv tool install gogadget --python 3.10 --with 'torch==2.5.1+cu124' --with 'torchaudio==2.5.1+cu124' --index 'https://download.pytorch.org/whl/cu124'
Note that BOTH commands are required, in this order!
For more information on using your GPU, please see here.
To enable GPU powered transcription of subtitles, you will need:
- A CUDA enabled NVIDIA gpu with a decent amount of VRAM (>=8 GB)
- Windows or Linux
- Up to date GPU drivers installed
These requirements are the same for most Whisper based transcription tools. Therefore, there will be plenty of guides to help you if you get stuck!
If you are using Windows, you will need to make sure that you tick "CUDA" in the installer.
If you are running Linux or are manually configuring it on Windows, you will need to follow the final step of the Linux installation instructions.
You will need to specify --gpu
when running any transcription tasks e.g.:
gogadget transcribe -i "input file or folder" -l "code for your language" --gpu
Alternatively, you can change the value of whisper_use_gpu
in the settings file to "True"
. You can access the settings by running:
gogadget set-defaults --custom
Full documentation is available in the manual.
gogadget is Copyright © 2024 Jonathan Fox.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.
All materials in this repository are covered by the aforementioned license, unless specifically noted below:
- src/gogadget/ytdlp_cli_to_api.py has been directly reproduced from yt-dlp's github page (license) without modification.
- The Windows installer bundles the binaries for both FFMPEG (license) and uv (license).
- The Bootstrap framework javascript and CSS files stored within src/gogadget/resources/html/bootstrap have been directly reproduced without modification (license).
- Portions of src/gogadget/resources/html/anki/ have been based upon the formatting of Refold's excellent decks. These are APLGv3 licensed, based upon the included code from Ankitects (license). Please see the individual source files for specific licensing information.
LICENSE
files for each of the python dependencies will be included with the installation. For convenience, you can view an auto-generated table of each of the licenses and authors here.