Thanks to visit codestin.com
Credit goes to github.com

Skip to content

rusteddaemond/RD-Markdown-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RD-Markdown-tools

A CLI tool to batch download YouTube subtitles and convert them into Obsidian-compatible Markdown notes with YAML frontmatter. The tool processes YouTube video URLs, downloads metadata and subtitles, enriches content with LLM-based corrections and theme analysis, and organizes output files into a structured directory hierarchy.

Version: v0.8.5

Features

  • Batch Processing: Process multiple YouTube videos in parallel
  • LLM-Enhanced Content:
    • Automatic subtitle correction using LLM
    • Language detection from metadata
    • Theme and tag extraction
    • Contextual focus analysis
  • Smart Chunking: Pause-based chunking strategy that splits subtitles at natural speech pauses
  • SponsorBlock Integration: Automatically filters sponsor segments from subtitles before processing
  • Structured Output: Organized directory structure by channel with metadata, subtitles, corrections, and notes
  • Flexible Input: Accept single links, comma-separated lists, or file inputs
  • Dual Interface: Interactive menu and command-line modes
  • Configurable: Extensive YAML-based configuration system

Prerequisites

Install Python and Git using Windows Package Manager (winget):

# Install Python
winget install Python.Python.3.12

# Install Git
winget install Git.Git

After installation, restart your terminal or add Python to PATH manually.

Installation

  1. Clone the repository:
git clone https://github.com/rusteddaemond/RD-Markdown-tools.git
cd RD-Markdown-tools
  1. Install dependencies:
cd data
pip install -r requirements.txt
  1. Set up environment variables:
    • Create a .env file in the data directory
    • Add your LLM API key: LLM_API_KEY=your_api_key_here

Configuration

All configuration is managed through YAML files in the data/config/ directory. See codebase.md for a complete list of all configuration files and their purposes.

Usage

Batch Processing (Recommended)

Place .txt files containing YouTube links in the input directory, then run:

python input/run.py

The script will:

  • Process all .txt files in the input directory
  • Read YouTube links from each file (supports comma-separated or line-separated links)
  • Process videos and save output to the output directory
  • Delete processed files after successful processing

Example input file (input/videos.txt):

https://youtu.be/VIDEO_ID1
https://youtu.be/VIDEO_ID2, https://youtu.be/VIDEO_ID3
https://youtu.be/VIDEO_ID4

Interactive Mode

cd data
python cli/main.py

Presents a menu with options:

  1. Change working directory
  2. Input YouTube links
  3. Exit

Command-Line Mode

cd data

# Process a single video
python cli/main.py --links "https://youtu.be/VIDEO_ID"

# Process multiple videos
python cli/main.py --links "https://youtu.be/VIDEO1,https://youtu.be/VIDEO2"

# Process from file
python cli/main.py --links links.txt

# Set output directory
python cli/main.py --cwd /path/to/output --links "https://youtu.be/VIDEO_ID"

# Exit immediately after processing (for scripting)
python cli/main.py --links "https://youtu.be/VIDEO_ID" --exit

Project Structure

See codebase.md for detailed project structure, architecture documentation, and testing information.

License

Copyright (C) 2024 RD-Markdown-tools contributors

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages