35 lines
906 B
Python
35 lines
906 B
Python
"""
|
|
小红书数据采集器 - 程序入口
|
|
"""
|
|
import uvicorn
|
|
from app import config
|
|
from app.web import app
|
|
|
|
|
|
def main():
|
|
"""启动 Web 服务"""
|
|
print("=" * 60)
|
|
print("小红书数据采集器")
|
|
print("=" * 60)
|
|
print(f"版本: 1.0.0")
|
|
print(f"访问地址: http://{config.WEB_HOST}:{config.WEB_PORT}")
|
|
print(f"数据目录: {config.DATA_DIR}")
|
|
print("=" * 60)
|
|
print("\n请在浏览器中打开上述地址,然后:")
|
|
print("1. 在 data/users.txt 中添加要采集的用户 ID(每行一个)")
|
|
print("2. 选择采集模式(单线程/多线程)")
|
|
print("3. 点击「启动采集」")
|
|
print("4. 在弹出的浏览器窗口中扫码登录")
|
|
print("5. 实时监控采集进度\n")
|
|
|
|
uvicorn.run(
|
|
app,
|
|
host=config.WEB_HOST,
|
|
port=config.WEB_PORT,
|
|
log_level="info"
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|