A tool to convert YouTube videos to Markdown format.
Project description
🎬 yt2md
🚀 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
ytInitialPlayerResponseJSON blob - Handles ISO 8601 dates and view count formatting
- Fallback values for missing fields
Subtitle System
- Language priority:
specified → lang-US → en → en-US → first available - XML parsing with error handling
- 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yt2md-1.0.0.tar.gz.
File metadata
- Download URL: yt2md-1.0.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efecdb735ef903dde57b768286419ca1a7a42d5aa9f0fe339e8af8771a95545b
|
|
| MD5 |
88daedea4d330598da8cebb481c80224
|
|
| BLAKE2b-256 |
9fa444752e3e8f9dd19347a6f33920c4b0471e607e0bdc3c948974276e375c7f
|
Provenance
The following attestation bundles were made for yt2md-1.0.0.tar.gz:
Publisher:
release.yaml on Xpos587/yt2md
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yt2md-1.0.0.tar.gz -
Subject digest:
efecdb735ef903dde57b768286419ca1a7a42d5aa9f0fe339e8af8771a95545b - Sigstore transparency entry: 212886204
- Sigstore integration time:
-
Permalink:
Xpos587/yt2md@c7d5ab70bd09b554b1fd41d655f71ba252029cde -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/Xpos587
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@c7d5ab70bd09b554b1fd41d655f71ba252029cde -
Trigger Event:
push
-
Statement type:
File details
Details for the file yt2md-1.0.0-py3-none-any.whl.
File metadata
- Download URL: yt2md-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cc58200986a65e993fde00d1a59a465a81b053bc37a983f86c702cd07c55709
|
|
| MD5 |
86b70261c67f1bf14e010cd9d9ddf5db
|
|
| BLAKE2b-256 |
784276a15bb0621533a2dc7b9301a0f2ced5b71ef52b67bcd71903bff13ba9e2
|
Provenance
The following attestation bundles were made for yt2md-1.0.0-py3-none-any.whl:
Publisher:
release.yaml on Xpos587/yt2md
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yt2md-1.0.0-py3-none-any.whl -
Subject digest:
2cc58200986a65e993fde00d1a59a465a81b053bc37a983f86c702cd07c55709 - Sigstore transparency entry: 212886210
- Sigstore integration time:
-
Permalink:
Xpos587/yt2md@c7d5ab70bd09b554b1fd41d655f71ba252029cde -
Branch / Tag:
refs/tags/1.0.0 - Owner: https://github.com/Xpos587
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@c7d5ab70bd09b554b1fd41d655f71ba252029cde -
Trigger Event:
push
-
Statement type: