Loading...
Loading...
Extract clean article text and metadata from URLs or HTML with trafilatura CLI. Use for single-page extraction, piped/local HTML, bounded discovery. NOT for research synthesis (research), PDFs (docling), raw fetch (fetch), video (yt-dlp).
npx skill4agent add wyattowalsh/agents trafilatura--listresearchdoclingfetchfetcheryt-dlp| Term | Meaning | NOT |
|---|---|---|
| extract | Single URL → clean text via CLI | full crawl harvest |
| metadata | JSON output with | bare URL probe only |
| pipe | Stdin or local | download from URL |
| discover | | bulk download |
| batch | | silent mass scrape |
| local | | live fetch |
| archived | | paywall bypass |
| precision | | default when content missing |
| recall | | default when noise high |
| doctor | Preflight JSON for binary and version | live URL smoke |
| Mode | Action |
|---|---|---|
| Doctor | Run |
| Extract | Stdout-first via |
| Metadata | |
| Pipe | |
| Discover | |
| Discover | |
| Discover | |
| Discover | |
| Batch | Approval gate → |
| Local | Approval gate → |
| Archived | |
| Natural language: "main text", "clean article", "extract from URL" | Auto | Map to extract (stdout-first) |
| (empty) | Help | Gallery + protocol + references |
--list.htmluv run python scripts/doctor.py --format jsonok: falsestatus: failtrafilaturauv run python scripts/extract_url.py --url 'https://…' --format jsonuv run python scripts/extract_url.py --url 'https://…' --output-format markdownurltitledatetext_lengthuv run python scripts/list_urls.py --mode sitemap --url 'https://…' --format jsonurl_count$HOME/Downloads/trafilatura/output/mkdir -p "$HOME/Downloads/trafilatura/output"
trafilatura -i list.txt -o "$HOME/Downloads/trafilatura/output/" --markdown --backup-dir "$HOME/Downloads/trafilatura/html-backup/"--recall--recallextract_url.pywget -qO- 'URL' | trafilaturacurl -sL 'URL' | trafilaturaextract_url.py --archivedtrafilatura --archived -u 'URL'trafilaturafetch_and_extractextract_url.pytrafilatura -uuv run python scripts/extract_url.py --url 'https://…' --output-format json --with-metadatatrafilatura --markdown < page.html
cat page.html | trafilatura --json --no-tablesfeedsitemapcrawlprobe--listlist_urls.py--url-filter--target-languagetrafilatura[all]-i--backup-dir--input-dir--keep-dirsfetch_urluv run python scripts/doctor.py --format json| # | Task | Example |
|---|---|---|
| 1 | Preflight | |
| 2 | Extract article | |
| 3 | Metadata JSON | |
| 4 | Discover sitemap | |
| 5 | Pipe local HTML | |
| 6 | Archived fallback | |
Pick a number, a mode from the dispatch table, or paste a URL and say whether you need extract, metadata, or URL discovery.
extract_url.py/research/yt-dlp| File | Use when |
|---|---|
| output-formats.md | Choosing txt/json/markdown/xml formats |
| discovery.md | Feed, sitemap, crawl, url-filter |
| troubleshooting.md | Missing content, blocked downloads |
| politeness-and-ethics.md | Robots, rate limits, refusals |
| mcp-fallback.md | Shell-less harness / MCPHub path |
| Script | Purpose |
|---|---|
| JSON preflight: trafilatura binary and version |
| Single-URL CLI wrapper with JSON envelope |
| Discovery |
| Validate skill manifest and evals |
# Preflight
uv run python scripts/doctor.py --format json
# Extract (stdout-first)
uv run python scripts/extract_url.py --url 'https://github.blog/2019-03-29-leader-spotlight-erin-spiceland/' --output-format markdown
# Metadata JSON
uv run python scripts/extract_url.py --url 'https://example.org' --output-format json --with-metadata
# Discover sitemap URLs (list only)
uv run python scripts/list_urls.py --mode sitemap --url 'https://www.sitemaps.org/' --format json
# Pipe local HTML
trafilatura --markdown < saved.html
# Batch (after user approval)
trafilatura -i urls.txt -o "$HOME/Downloads/trafilatura/output/" --markdown --backup-dir "$HOME/Downloads/trafilatura/html-backup/"