docs/data_storage_guide.md
MediaCrawler 支持多种数据存储方式,您可以根据需求选择最适合的方案:
data/ 目录下)data/ 目录下)data/ 目录下)— 默认格式,每行一个 JSON 对象,追加写入性能好data/ 目录下)✨ 新功能
--init_db 进行数据库初始化(使用--init_db时不需要携带其他optional)--init_db sqlite--save_data_option sqlite--init_db mysql--save_data_option db(db 参数为兼容历史更新保留)--init_db postgres--save_data_option postgres# 使用 Excel 存储数据(推荐用于数据分析)✨ 新功能
uv run main.py --platform xhs --lt qrcode --type search --save_data_option excel
# 初始化 SQLite 数据库
uv run main.py --init_db sqlite
# 使用 SQLite 存储数据
uv run main.py --platform xhs --lt qrcode --type search --save_data_option sqlite
# 初始化 MySQL 数据库
uv run main.py --init_db mysql
# 使用 MySQL 存储数据(为适配历史更新,db参数进行沿用)
uv run main.py --platform xhs --lt qrcode --type search --save_data_option db
# 初始化 PostgreSQL 数据库
uv run main.py --init_db postgres
# 使用 PostgreSQL 存储数据
uv run main.py --platform xhs --lt qrcode --type search --save_data_option postgres
# 使用 CSV 存储数据
uv run main.py --platform xhs --lt qrcode --type search --save_data_option csv
# 使用 JSON 存储数据
uv run main.py --platform xhs --lt qrcode --type search --save_data_option json
# 使用 JSONL 存储数据(默认格式,无需指定)
uv run main.py --platform xhs --lt qrcode --type search --save_data_option jsonl