Skip to main content

Yongle local data collection CLI

Project description

yongle-worker

yongle-worker 是永乐数据平台的本地采集 CLI。采集任务在你的电脑上执行,平台账号用于登录、余额校验和任务结算。

安装

pip install yongle-worker

建议使用 Python 3.10 或更高版本。

快速开始

启动交互模式:

yongle-worker

登录账号:

/login YOUR_API_KEY

公网服务地址已内置,正常使用不需要额外配置。

查看可用模型:

yongle-worker run --list-models

运行携程采集:

yongle-worker run --model 携程 --city 杭州 --pages 3 --items 20 --comments 5

运行 BOSS 采集:

yongle-worker auth boss import-browser --browser auto
yongle-worker run --model Boss直聘 --keyword 爬虫工程师 --city 上海 --pages 2

常用命令

yongle-worker
yongle-worker run --list-models
yongle-worker run --interactive
yongle-worker doctor
yongle-worker auth boss import-browser --browser auto

说明:

  • run:正式任务入口,执行前会展示任务预览和预计点数。
  • run --interactive:按步骤填写任务参数。
  • doctor:检查本机运行环境和账号状态。
  • auth boss import-browser:从本机浏览器导入 BOSS 登录态,用于本机采集。

登录与本地数据

  • CLI 默认连接永乐数据公网服务,不需要额外配置服务地址。
  • API Key 只用于当前设备登录和任务结算,请不要发给他人。
  • 登录态默认保存在本机,并尽量使用本机加密能力保护。
  • BOSS Cookie 只用于本机采集,不需要手动粘贴到平台页面。
  • 如不想保存本机登录态,可设置 YONGLE_PERSIST_LOGIN_SESSION=0

常见问题

401 或 API Key 无效

确认 API Key 是否复制完整,并重新执行:

/login YOUR_API_KEY

余额不足

减少任务页数、条数或评论数,或先完成充值后重试。

BOSS 任务提示未登录

先在本机浏览器登录 BOSS,再执行:

yongle-worker auth boss import-browser --browser auto

网络连接失败

执行:

yongle-worker doctor

如果只是临时网络问题,稍后重试即可。

隐私边界

  • 采集过程在用户本机执行。
  • 请只在你有合法授权的场景下使用本工具。
  • 不要在公开聊天、截图或工单中暴露 API Key、浏览器 Cookie、验证码、支付订单号等敏感信息。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yongle_worker-0.1.3.tar.gz (104.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yongle_worker-0.1.3-py3-none-any.whl (108.0 kB view details)

Uploaded Python 3

File details

Details for the file yongle_worker-0.1.3.tar.gz.

File metadata

  • Download URL: yongle_worker-0.1.3.tar.gz
  • Upload date:
  • Size: 104.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for yongle_worker-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ef62d70da3aa26912d764a93fcbe45badd383d2d6805c67c140b761956963894
MD5 929d5619a77a6e18327f90fd77d8e47b
BLAKE2b-256 786bec31238d961ff27c42631f8909ea8901fcd730d4aa733c385257a41b1a97

See more details on using hashes here.

File details

Details for the file yongle_worker-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: yongle_worker-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 108.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for yongle_worker-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 be2cdf2b61bfbaa89cd601e546cbdd80dc1e7ca48ccde620bc24bd75c84df366
MD5 2152108f981e69e7fbc67be853312770
BLAKE2b-256 e3911e718b756a74ac409d33fe7eb760ad3eb9d1bad2365e056dbafbac30a8b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page