Search and download free novel TXT files from public sources. Works for Chinese and English novels.
Ask the user for the novel name. If they only give a partial name, search to find the exact title.
Use web_search to find free TXT download sources:
query: "小说名 txt 下载 免费"
Filter results: prefer .txt file links or sites known for free novel downloads. Avoid paid or DRM-protected sources.
For each candidate URL, use web_fetch with maxChars: 2000 to check:
When a direct .txt URL is found:
curl -L -o "/tmp/{novel-name}.txt" "URL"
Use the novel name (sanitized) as filename. Save to /tmp/ first.
file "/tmp/{novel-name}.txt"
wc -c "/tmp/{novel-name}.txt"
head -5 "/tmp/{novel-name}.txt"
Validate:
iconv -f GBK -t UTF-8 if garbled)Chinese novels often come in GBK/GB2312 encoding:
iconv -f GBK -t UTF-8 "/tmp/{novel-name}.txt" -o "/tmp/{novel-name}-utf8.txt" 2>/dev/null && mv "/tmp/{novel-name}-utf8.txt" "/tmp/{novel-name}.txt"
Ask user where to save, or default to ~/Downloads/{novel-name}.txt.
✅ 下载完成!
书名:《》
作者:未知
文件:/Users/mac/Downloads/.txt
大小:X MB
来源:URL
Known free novel sites:
Many Chinese novels are archived on GitHub:
query: "site:github.com "小说名" txt"
Look for raw content at raw.githubusercontent.com
For Chinese web novels:
query: "小说名 site:wenkub.com OR site:wenku8.net"
query: ""小说名" 下载 txt"
web_fetch.lynx -dump URL or search for a cleaner source.共 1 个版本