Web Fetcher
Smart web content fetcher for Claude Code. Automatically detects platform and uses the best strategy to fetch articles or download videos.
Quick Start
# Fetch an article
python3 {SKILL_DIR}/fetcher.py "URL" -o ~/docs/
# Download a video
python3 {SKILL_DIR}/fetcher.py "https://b23.tv/xxx" -o ~/videos/
# Batch fetch from file
python3 {SKILL_DIR}/fetcher.py --urls-file urls.txt -o ~/docs/
Install Dependencies
Install only what you need — dependencies are checked at runtime:
| Dependency |
Purpose |
Install |
| scrapling |
Article fetching (HTTP + browser) |
pip install scrapling |
| yt-dlp |
Video download |
pip install yt-dlp |
| camoufox |
Anti-detection browser (Xiaohongshu, Weibo) |
pip install camoufox && python3 -m camoufox fetch |
| html2text |
HTML to Markdown conversion |
pip install html2text |
Smart Routing
The fetcher automatically detects the platform from the URL:
| Platform |
Method |
Notes |
| mp.weixin.qq.com |
scrapling |
Extracts data-src images, handles SVG placeholders |
| *.feishu.cn |
Virtual scroll |
Collects all blocks via scrolling, downloads images with cookies |
| zhuanlan.zhihu.com |
scrapling |
.Post-RichText selector |
| www.zhihu.com |
scrapling |
.RichContent selector |
| www.toutiao.com |
scrapling |
Handles toutiaoimg.com base64 placeholders |
| www.xiaohongshu.com |
camoufox |
Anti-bot protection requires stealth browser |
| www.weibo.com |
camoufox |
Anti-bot protection requires stealth browser |
| bilibili.com / b23.tv |
yt-dlp |
Video download, supports quality selection |
| youtube.com / youtu.be |
yt-dlp |
Video download |
| douyin.com |
yt-dlp |
Video download |
| Unknown URLs |
scrapling |
Generic fetch with fallback tiers |
CLI Reference
python3 {SKILL_DIR}/fetcher.py [URL] [OPTIONS]
Arguments:
url URL to fetch
Options:
-o, --output DIR Output directory (default: current)
-q, --quality N Video quality, e.g. 1080, 720 (default: 1080)
--method METHOD Force method: scrapling, camoufox, ytdlp, feishu
--selector CSS Force CSS selector for content extraction
--urls-file FILE File with URLs (one per line, # for comments)
--audio-only Extract audio only (video downloads)
--no-images Skip image download (articles)
--cookies-browser NAME Browser for cookies (e.g., chrome, firefox)
Platform Notes
WeChat (mp.weixin.qq.com)
- Images use
data-src attribute with mmbiz.qpic.cn URLs
- Visible
<img> tags contain SVG placeholders (lazy loading)
- Image download requires
Referer: https://mp.weixin.qq.com/ header
- Scrapling GET usually works; no browser needed
Feishu (*.feishu.cn)
- Uses virtual scroll — content blocks are rendered on-demand
- The fetcher scrolls through the entire document, collecting
[data-block-id] elements
- Images require authenticated fetch (cookies), downloaded via browser's fetch API
- May show "Unable to print" artifacts which are auto-cleaned
Bilibili
- Short links (b23.tv) are auto-resolved
- For premium/member content, use
--cookies-browser chrome
- Default quality is 1080p, adjustable with
-q
Troubleshooting
| Problem |
Solution |
scrapling not found |
pip install scrapling |
yt-dlp not found |
pip install yt-dlp |
| Article content too short |
Try --method camoufox for JS-heavy pages |
| Feishu returns login page |
The doc may require authentication |
| Bilibili 403 |
Use --cookies-browser chrome |
| Image download fails |
Check network; WeChat images need Referer header (auto-handled) |
Manual Usage
When the CLI doesn't fit your needs, use the modules directly:
from lib.router import route, check_dependency
from lib.article import fetch_article
from lib.video import fetch_video
from lib.feishu import fetch_feishu
# Route a URL
r = route("https://mp.weixin.qq.com/s/xxx")
# {'type': 'article', 'method': 'scrapling', 'selector': '#js_content', 'post': 'wx_images'}
# Fetch article
fetch_article(url, output_dir="/tmp/out", route_config=r)
# Download video
fetch_video(url, output_dir="/tmp/out", quality="720")
# Fetch Feishu doc
fetch_feishu(url, output_dir="/tmp/out")
1---2name: web-fetcher3description: Smart web content fetcher - articles and videos from WeChat, Feishu, Bilibili, Zhihu, Toutiao, YouTube, etc. Triggers: '抓取文章', '下载网页', '保存文章', 'fetch URL', '下载视频', '抓取飞书文档', '抓取微信文章', '把这个链接内容保存下来', '下载B站视频', 'download video', 'scrape article'.4license: MIT5---67# Web Fetcher89Smart web content fetcher for Claude Code. Automatically detects platform and uses the best strategy to fetch articles or download videos.1011## Quick Start1213```bash14# Fetch an article15python3 {SKILL_DIR}/fetcher.py "URL" -o ~/docs/1617# Download a video18python3 {SKILL_DIR}/fetcher.py "https://b23.tv/xxx" -o ~/videos/1920# Batch fetch from file21python3 {SKILL_DIR}/fetcher.py --urls-file urls.txt -o ~/docs/22```2324## Install Dependencies2526Install only what you need — dependencies are checked at runtime:2728| Dependency | Purpose | Install |29|-----------|---------|---------|30| scrapling | Article fetching (HTTP + browser) | `pip install scrapling` |31| yt-dlp | Video download | `pip install yt-dlp` |32| camoufox | Anti-detection browser (Xiaohongshu, Weibo) | `pip install camoufox && python3 -m camoufox fetch` |33| html2text | HTML to Markdown conversion | `pip install html2text` |3435## Smart Routing3637The fetcher automatically detects the platform from the URL:3839| Platform | Method | Notes |40|----------|--------|-------|41| mp.weixin.qq.com | scrapling | Extracts `data-src` images, handles SVG placeholders |42| *.feishu.cn | Virtual scroll | Collects all blocks via scrolling, downloads images with cookies |43| zhuanlan.zhihu.com | scrapling | `.Post-RichText` selector |44| www.zhihu.com | scrapling | `.RichContent` selector |45| www.toutiao.com | scrapling | Handles `toutiaoimg.com` base64 placeholders |46| www.xiaohongshu.com | camoufox | Anti-bot protection requires stealth browser |47| www.weibo.com | camoufox | Anti-bot protection requires stealth browser |48| bilibili.com / b23.tv | yt-dlp | Video download, supports quality selection |49| youtube.com / youtu.be | yt-dlp | Video download |50| douyin.com | yt-dlp | Video download |51| Unknown URLs | scrapling | Generic fetch with fallback tiers |5253## CLI Reference5455```56python3 {SKILL_DIR}/fetcher.py [URL] [OPTIONS]5758Arguments:59 url URL to fetch6061Options:62 -o, --output DIR Output directory (default: current)63 -q, --quality N Video quality, e.g. 1080, 720 (default: 1080)64 --method METHOD Force method: scrapling, camoufox, ytdlp, feishu65 --selector CSS Force CSS selector for content extraction66 --urls-file FILE File with URLs (one per line, # for comments)67 --audio-only Extract audio only (video downloads)68 --no-images Skip image download (articles)69 --cookies-browser NAME Browser for cookies (e.g., chrome, firefox)70```7172## Platform Notes7374### WeChat (mp.weixin.qq.com)75- Images use `data-src` attribute with `mmbiz.qpic.cn` URLs76- Visible `<img>` tags contain SVG placeholders (lazy loading)77- Image download requires `Referer: https://mp.weixin.qq.com/` header78- Scrapling GET usually works; no browser needed7980### Feishu (*.feishu.cn)81- Uses virtual scroll — content blocks are rendered on-demand82- The fetcher scrolls through the entire document, collecting `[data-block-id]` elements83- Images require authenticated fetch (cookies), downloaded via browser's fetch API84- May show "Unable to print" artifacts which are auto-cleaned8586### Bilibili87- Short links (b23.tv) are auto-resolved88- For premium/member content, use `--cookies-browser chrome`89- Default quality is 1080p, adjustable with `-q`9091## Troubleshooting9293| Problem | Solution |94|---------|----------|95| `scrapling not found` | `pip install scrapling` |96| `yt-dlp not found` | `pip install yt-dlp` |97| Article content too short | Try `--method camoufox` for JS-heavy pages |98| Feishu returns login page | The doc may require authentication |99| Bilibili 403 | Use `--cookies-browser chrome` |100| Image download fails | Check network; WeChat images need Referer header (auto-handled) |101102## Manual Usage103104When the CLI doesn't fit your needs, use the modules directly:105106```python107from lib.router import route, check_dependency108from lib.article import fetch_article109from lib.video import fetch_video110from lib.feishu import fetch_feishu111112# Route a URL113r = route("https://mp.weixin.qq.com/s/xxx")114# {'type': 'article', 'method': 'scrapling', 'selector': '#js_content', 'post': 'wx_images'}115116# Fetch article117fetch_article(url, output_dir="/tmp/out", route_config=r)118119# Download video120fetch_video(url, output_dir="/tmp/out", quality="720")121122# Fetch Feishu doc123fetch_feishu(url, output_dir="/tmp/out")124```