Skip to content

nick-s-b/mpv-transcript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

📜 YouTube and Rumble Transcript Downloader for mpv - Recall for videos!

This mpv Lua script automatically downloads and cleans up YouTube and Rumble video transcripts and saves them as plain text (.txt) files. It uses yt-dlp to download transcripts, removes unnecessary formatting, and saves a clean version for easier reading or recall.

Introduction

Have you ever watched a YouTube or Rumble video and, weeks or months later, wanted to refer to it but couldn't remember the title or find it again? Well, this script can help!

It simplifies the process of extracting and saving YouTube and Rumble transcripts as text files. Once saved, you can use grep or your file manager's text search function to easily find words or phrases from videos you've watched.

Installation

To install and set up the script:

  1. Dependencies:

  2. Download the script:

    • Clone or download this repository and copy the Lua script to your ~/.config/mpv/scripts/ directory. For example, you can clone the repository and create a symbolic link to the script with the following commands:

      mkdir -p ~/sources/
      cd ~/sources/
      git clone https://github.com/nick-s-b/mpv-transcript.git
      mkdir -p ~/.config/mpv/scripts/
      ln -sr mpv-transcript/scripts/transcript.lua ~/.config/mpv/scripts/transcript.lua

Configuration

You can configure the script by copying the default configuration file:

cp script-opts/transcript.conf ~/.config/mpv/script-opts/

and by editing the file:

nano ~/.config/mpv/script-opts/transcript.conf

transcript.conf options:

  • transcript_folder: Defines the folder where the cleaned transcripts will be saved. By default, it saves the transcripts in ~/transcripts/. You can change this path as needed.

  • subtitle_lang: Specifies the language for YouTube subtitles. The default value is "en" (English), but you can set it to any supported YouTube subtitle language code.

Limitations:

mpv-transcript does not perform speech recognition or translation on its own; it relies on YouTube and Rumble to provide these services. Some new videos may not have transcripts available immediately, and the language specified in your configuration might not be available. In such cases, mpv-transcript will fail to download the transcript.

The solution is to try again later. In some instances, simply requesting a transcript or translation that isn't ready yet can prompt YouTube to generate it.

Usage

Once everything is set up, simply play a YouTube video with mpv, and the script will automatically save the transcript.

Contributing

If you have a suggestion, leave an issue or just create a pull request.

License

This project is licensed under the GPLv3. See the LICENSE file for more details.

About

mpv script that automatically saves the transcript of every YouTube and Rumble video that you watch.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages