URL → Markdown · baoyu-url-to-markdown

Paste any URL (X / YouTube / Hacker News / generic page). Chrome CDP fetches it through a site-specific adapter and emits clean markdown with YAML front matter. Login walls and CAPTCHAs are handled via interaction-wait modes.

What this tool does

  • Convert any URL to .md with YAML front matter (title / author / published / fetched-at)
  • Four built-in site adapters: X / YouTube / Hacker News / generic (Defuddle)
  • Login walls / CAPTCHAs: --wait-for-interaction opens a Chrome tab for manual resolution before scraping
  • Media: download to imgs/ / videos/, or keep remote URLs (config in EXTEND.md)
  • Output organised as <domain>/<slug>.md; re-fetches overwrite + keep a <slug>.prev.md

Supported sites

Site URL pattern Adapter Notes
X (Twitter) x.com / twitter.com x Tweets, threads, X Articles. Threads auto-expand to all entries.
YouTube youtube.com / youtu.be youtube Video transcript / subtitles (multi-language auto-detect), chapter markers, thumbnail. Transcript-only mode available.
Hacker News news.ycombinator.com hn Post + full comment tree (collapsed + expanded both kept), original score preserved.
Generic Any public page generic Body extracted via Defuddle → markdown. Code blocks, tables, image alt text preserved where possible.
▶ How to invoke
# Fetch a tweet / thread
bun ~/.claude/skills/baoyu-url-to-markdown/scripts/baoyu-fetch \
  "https://x.com/username/status/123" \
  --out ./url-to-markdown/x

# Fetch a YouTube transcript only (no full page scrape)
bun ~/.claude/skills/baoyu-url-to-markdown/scripts/baoyu-fetch \
  "https://youtube.com/watch?v=..." --mode transcript

# Fetch an HN post with all comments
bun ~/.claude/skills/baoyu-url-to-markdown/scripts/baoyu-fetch \
  "https://news.ycombinator.com/item?id=123" \
  --include-comments

# Fetch a paywalled article; wait for manual login
bun ~/.claude/skills/baoyu-url-to-markdown/scripts/baoyu-fetch \
  "https://example.com/private-article" \
  --wait-for-interaction

Requires bun. On first run, if ~/.baoyu-skills/baoyu-url-to-markdown/EXTEND.md is missing, the skill triggers first-time setup (media policy + output dir + config location — pick one each) before scraping.

Typical pipeline

  1. Parse URL → match an adapter (X / YouTube / HN / generic)
  2. Launch Chrome (headless, or headful when --wait-for-interaction)
  3. Adapter extraction: X via thread-loader, YouTube via transcript, HN walks the comment tree, generic via Defuddle
  4. Media handling follows EXTEND.md → download / ask / keep-remote
  5. Write <domain>/<slug>.md with YAML front matter. If the file exists, overwrite and keep <slug>.prev.md

Source code: ~/.claude/skills/baoyu-url-to-markdown/

CLI Pro · lifetime buyout

One-time payment, lifetime license. Bump the call quota from the 50-call / month trial up to 500 / 2,000 / unlimited — no subscription, no auto-renew. Email me to pay, and I'll send your key within 24h.

Plan Calls / month One-time price Best for
Pro 500 $30 Occasional X / YouTube / blog scraping
Studio 2,000 $80 High-frequency asset collection / content pipelines
Unlimit Unlimited $200 Team use / automation workflows

Want a license? Email me and I'll send the license within 24h — valid forever.

Once you have a key, you can verify it here (replace the key in the URL).

Just want to try it? Skip this section — trial mode gives you 50 calls / month, no key needed. Or sponsor me on GitHub to support maintenance.

键盘快捷键

先按 g 再按下面的键。? 打开这个面板。