Skip to main content

Small Cloudreve V4 upload helpers for note_server-backed sessions.

Project description

cloudreve-tools

cloudreve-tools 是给自建 Cloudreve V4 用的小工具包,重点是从 note_server 读取 login_hub 保存的 Cloudreve 登录态,然后上传本地文件。

安装

pip install cloudreve-tools

本仓库开发态安装:

python3 -m pip install -e .

凭据

不要把 token、cookie、密码写进命令或文件。工具默认从环境变量读取:

export NOTE_SERVER_TOKEN='<note_server 普通 token>'
export NOTE_SERVER_URL='https://note.luke9012.cn'
export CLOUDREVE_BASE_URL='https://cloud.luke9012.cn'

NOTE_SERVER_URLCLOUDREVE_BASE_URL 可省略,默认就是上面两个地址。

上传文件

login_hubnote_server 里的完整 key 是:

login:{platform}:{account}:session

CLI 支持短 key:

  • cloudreve -> login:cloudreve:main:session
  • cloudreve:main -> login:cloudreve:main:session

上传命令:

cloudreve-tools upload cloudreve:main /我的软件/recon_reader/1.0.0 \
  "/Users/luke/Desktop/recon_reader/recon_reader 1.0.0.apk" \
  "/Users/luke/Desktop/recon_reader/recon_reader mac 1.0.0.zip"

输出 JSON:

cloudreve-tools upload --json cloudreve:main /我的软件/demo ./demo.zip

直链与自动更新域名

Cloudreve 直链、发布清单和 App 自动更新下载地址统一使用 https://cloud.luke9012.cn。不要把链接改写成 img.luke9012.cn

后续如果新增 release / direct-link 命令,默认也应保留 cloud.luke9012.cn 作为公开下载域名。

Python 用法

from cloudreve_tools import CloudreveClient, CloudreveSession, NoteServerClient

bundle = NoteServerClient().load_session_bundle("cloudreve:main")
client = CloudreveClient(CloudreveSession.from_bundle(bundle))
result = client.upload("./demo.zip", "/我的软件/demo")
print(result.uri)

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

cloudreve_tools-0.1.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

cloudreve_tools-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file cloudreve_tools-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for cloudreve_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0102bcc3374cc25856618b908247704fce9fb0fb3fb54b13542eea14e9fba604
MD5 0857217f3084b3b78b99cb7d7e5ae2de
BLAKE2b-256 7ff252f91d6571102dd7afb03691e4ab5657e6d4fa6056d6b66f86c4c15d84d8

See more details on using hashes here.

File details

Details for the file cloudreve_tools-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cloudreve_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92c0d59f67377845f41e59cce0e4b5bd925bfa3c0e948e7ad781610e11a5feef
MD5 f2521faca8d46d0048cb340640866403
BLAKE2b-256 b664a66ee218e50b97bc5f4de5888ea7effebe28b96d5db68f6e4a33de284100

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