Python DlerCloud API
这是什么
这是一个可用于调用 DlerCloud API 的非官方 Python 模块。
你可以用它实现自动节点筛选和配置更新等操作。
支持 Python 3.x,尚未验证 Python 2.x 中的兼容性。
怎么安装
使用 pip 安装:
pip3 install -U dlercloud
如何使用
DlerCloud 在其 Telegram 频道 中提供了 API 的简要说明。
本 Python 模块按照该说明进行构建。
| API | URL | DlerCloudAPI() |
|---|---|---|
| 登陆 | /api/v1/login | .login(email, password) |
| SS 节点列表 | /api/v1/nodes/ss | .nodes.ss() |
| V2ray 节点列表 | /api/v1/nodes/v2ray | .nodes.v2ray() |
| Clash SS 托管配置 | /api/v1/managed/clash_ss | .managed.clash_ss() |
| Clash V2ray 托管配置 | /api/v1/managed/clash_v2 | .managed.clash_v2() |
| SS 订阅地址 | /api/v1/subscribe/ss | .subscribe.ss() |
| SSD 订阅地址 | /api/v1/subscribe/ssd | .subscribe.ssd() |
| SSR 订阅地址 | /api/v1/subscribe/ssr | .subscribe.ssr() |
| V2RayN 的订阅地址 | /api/v1/subscribe/av2 | .subscribe.av2() |
| Quantumult V2ray 订阅地址 | /api/v1/subscribe/qv2 | .subscribe.qv2() |
| 使当前 access token 失效 | /api/v1/logout | .logout() |
示例代码
这些示例代码可以帮助你更好的理解:
from dlercloud import DlerCloudAPI
api = DlerCloudAPI()
# 使用邮箱和密码登录
api.login('your@email.com', 'YoUr*PasSwoRD')
# 若不想每次重复登陆,可将获得的 access_token 保存下来,
# 并在下次创建 DlerCloudAPI 实例时作为初始化参数传入,如:
# api = DlerCloudAPI('mYtOkEnAbCdEf0123456789')
# 目前 access_token 的有效期为 24 小时
# 例: 使用 SSNode 节点信息,创建一条 Surge 节点配置
# 获得 ss 节点列表
nodes = api.nodes.ss()
# [<SSNode: 节点 1>, <SSNode: 节点 2>, <SSNode: 节点 3>, ...]
node = nodes[0]
# <SSNode: 节点 1>
surge_node_conf = '''
{n.name} = ss, {n.server}, {n.port}, encrypt-method={n.cipher}, password={n.password}{o}{u}
'''.format(
n=node,
o=', obfs={}'.format(node.advanced['obfs'][12:])
if node.advanced.get('obfs') not in ('plain', None) else '',
u=', udp-relay=true' if node.udp else ''
).strip()
print(surge_node_conf)
# 节点 1 = ss, 1.2.3.4, 1234, encrypt-method=aes-256-gcm, password=abc123, obfs=tls, udp-relay=true
免责声明
本 Python 模块的作者并非 DlerCloud 网站或公司的人员,不参与 DlerCloud 的经营和建设,也并非其投资者。
Metadata
Release files for dlercloud 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dlercloud-0.0.8.tar.gz | 5.4 kB | Without provenance | Details for dlercloud-0.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dlercloud-0.0.8-py3-none-any.whl | Python 3 | none | any | Details for dlercloud-0.0.8-py3-none-any.whl |
Total release size: 12.4 kB
Release files / dlercloud-0.0.8.tar.gz
| Download URL | dlercloud-0.0.8.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ded5a8dff63f32ee31ccbb6556a4e34b34ad157e40c0a08467b8fca5af262c97
|
|
BLAKE2b-256 checksum How to use checksums |
9048e3b014ce745793ccd8202b23645a9a01df3c67106bdd9aace6727cda0236
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.25.0 CPython/3.7.4
|
Release files / dlercloud-0.0.8-py3-none-any.whl
| Download URL | dlercloud-0.0.8-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5180483a22a940bb297814d40fdfbf7d11aedfcab90fa25434c7807e5c63bddd
|
|
BLAKE2b-256 checksum How to use checksums |
c05ec9ed007ec5952f754182b419a6342483325c199377c709b156704162e825
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.25.0 CPython/3.7.4
|
Security for dlercloud 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.