Files
Ubuntu 32b43f85bd a
2026-07-03 16:58:28 +08:00

105 lines
2.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 📝 Public Domain Poetry Scraper
从 https://www.public-domain-poetry.com 抓取公共领域诗歌。
## 网站结构
```
name.php (按字母A-Z分页)
↓ 点击字母
name.php?l=A&s=author
↓ 点击诗人
/poet-slug (诗人页面,列出所有诗歌)
↓ 点击诗歌
/poet-slug/poem-slug (诗歌详情页)
```
## 存储结构
与 `libraryofshortstories` **不同**,诗歌直接放在诗人目录下:
```
/home/ubuntu/media/public-domain-poetry/
├── a-h-laidlaw/
│ ├── babylon-22309.txt
│ ├── betsie-brown-22302.txt
│ └── ...
├── abraham-cowley/
│ ├── poem1.txt
│ └── ...
└── ...
```
每个 `.txt` 文件包含:
- 诗歌标题
- 作者名
- 来源 URL
- 下载时间
- 诗歌正文
## 快速开始
### 1. 获取诗人列表(Phase 1)
```bash
./start.sh fetch
```
遍历 A-Z 26个字母页面,抓取所有诗人信息。
### 2. 下载诗歌(Phase 2)
**前台模式**:
```bash
./start.sh download
```
**后台模式**(推荐,诗歌数量多,耗时长):
```bash
./start.sh download-bg
```
### 3. 查看状态
```bash
./start.sh status
```
### 4. 查看日志
```bash
./start.sh log
tail -f logs/download.log
```
## 技术细节
- **下载间隔**: 7 秒
- **超时设置**: 30 秒
- **并发**: 单线程,避免被封
- **断点续传**: 支持,中断后从上次位置继续
## 与 Audiobook Player 集成
Audiobook Player 会自动扫描 `/home/ubuntu/media/` 目录:
```
/home/ubuntu/media/
├── libraryofshortstories/ # 故事(两级目录)
│ └── story-name/
│ └── content.txt
├── public-domain-poetry/ # 诗歌(一级目录)
│ └── poet-name/
│ ├── poem1.txt
│ └── poem2.txt
└── ...
```
播放器会识别两种不同的目录结构并正确显示。
## 注意事项
1. 诗歌数量巨大(数百位诗人 × 每位多首诗歌),下载可能需要 **数小时甚至数天**
2. 建议使用后台模式 `./start.sh download-bg`
3. 可以安全中断,进度会自动保存