Skip to main content

🎬 yt2md

PyPI Python Version License

🚀 YouTube to Obsidian Markdown converter with metadata extraction and timestamped subtitles.


✨ Features

  • Smart Metadata Extraction: Title, author, views, publish date, duration, tags
  • Multi-language Subtitles: Automatic fallback (en/US → user-specified → first available)
  • Obsidian Integration: Frontmatter with video details and wiki-style links
  • Async Architecture: Parallel processing of multiple videos
  • Proxy Support: SOCKS/HTTP proxies via environment variables
  • Subtitle Processing: XML parsing with HTML entity decoding
  • Timecode Links: Clickable timestamps linking to exact video moments

📦 Installation

pipx install yt2md

🚀 Usage

Basic Conversion

yt2md VIDEO_URL or VIDEO_ID -O output.md

Multiple Videos + Russian Subtitles

yt2md ID1 ID2 ID3 -L ru -O vault/notes.md

Clipboard Integration

# Linux (Wayland)
yt2md ID | wl-copy

# Linux (X11)
yt2md ID | xclip -selection clipboard

# macOS
yt2md ID | pbcopy

# Windows
yt2md ID | idk?

🔧 Proxy Configuration

Set Environment Variables

export HTTP_PROXY="socks5://localhost:9050"
export HTTPS_PROXY="$HTTP_PROXY"

Usage with Proxy

yt2md VIDEO_ID --language en --output research.md

📝 Example Output

---
url: https://youtu.be/abc123
title: "Advanced Python Techniques"
channel: PyMaster
views: 123,456
duration: 15m 30s
published: 2024-03-15T09:30:00Z
tags: [python, programming, tutorial]
---

# Advanced Python Techniques

**Channel:** [[PyMaster]]
**Published:** `2024-03-15T09:30:00Z`
**Duration:** 15m 30s
**Views:** 123,456

## Description
Explore advanced Python features...

## Subtitles
[00:01:23] Welcome to the tutorial
[00:05:45] Context managers deep dive
[00:10:12] Metaclass examples

⚙️ Technical Details

Metadata Extraction

  • Parses ytInitialPlayerResponse JSON blob
  • Handles ISO 8601 dates and view count formatting
  • Fallback values for missing fields

Subtitle System

  1. Language priority: specified → lang-US → en → en-US → first available
  2. XML parsing with error handling
  3. Automatic text cleaning (HTML entities, newlines)

Performance

  • Async HTTP client with 3 retry attempts
  • Parallel video processing
  • Lightweight XML parser (lxml)

📄 License

MIT License. See LICENSE for details.


👤 Author: Michael (@xpos587)
📧 Contact: x30827pos@gmail.com 🐛 Issues: https://github.com/xpos587/yt2md/issues

Metadata

Release files for yt2md 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 yt2md 1.0.0
File Size Uploaded Provenance
yt2md-1.0.0.tar.gz 6.2 kB With provenance Details

Built distribution (wheel)

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

Total release size: 12.6 kB

Release files / yt2md-1.0.0.tar.gz

Download URL yt2md-1.0.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
efecdb735ef903dde57b768286419ca1a7a42d5aa9f0fe339e8af8771a95545b
BLAKE2b-256 checksum
How to use checksums
9fa444752e3e8f9dd19347a6f33920c4b0471e607e0bdc3c948974276e375c7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 14, 2025.

Transparency log

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

Download URL yt2md-1.0.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2cc58200986a65e993fde00d1a59a465a81b053bc37a983f86c702cd07c55709
BLAKE2b-256 checksum
How to use checksums
784276a15bb0621533a2dc7b9301a0f2ced5b71ef52b67bcd71903bff13ba9e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 14, 2025.

Transparency log

Security for yt2md 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for yt2md-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 14, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

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