Skip to main content

123 WebDAV

Project description

123 WebDAV

安装

你可以通过 pypi 安装

pip install -U p123dav

用法

作为模块

from p123client import P123Client
from p123dav import P123FileSystemProvider
from wsgidav.wsgidav_app import WsgiDAVApp
from wsgidav.server.server_cli import SUPPORTED_SERVERS

config = {
    "server": "cheroot", 
    "host": "0.0.0.0", 
    "port": 8123, 
    "mount_path": "", 
    "simple_dc": {"user_mapping": {"*": True}}, 
    "provider_mapping": {"/": P123FileSystemProvider(
        username="", 
        password="", 
        ttl=10, 
        refresh=False, 
    )}, 
}
app = WsgiDAVApp(config)
server = config["server"]
handler = SUPPORTED_SERVERS.get(server)
if not handler:
    raise RuntimeError(
        "Unsupported server type {!r} (expected {!r})".format(
            server, "', '".join(SUPPORTED_SERVERS.keys())
        )
    )
handler(app, config, server)

作为命令

usage: p123dav [-h] [-u USERNAME] [-p PASSWORD] [-t TOKEN] [--ttl TTL] [-r]
               [-H HOST] [-P PORT] [-v] [-l]

  📺 123 WebDav 🎬

options:
  -h, --help            show this help message and exit
  -u USERNAME, --username USERNAME
                        登录账号,手机号或邮箱,或者 client_id
  -p PASSWORD, --password PASSWORD
                        登录密码,或者 client_secret
  -t TOKEN, --token TOKEN
                        123 网盘的 access_token
  --ttl TTL             文件列表缓存时间,默认值:10,单位:秒
  -r, --refresh         更新文件列表缓存时,强制更新全部,如果不指定此参数,则会用一种预写的算法,尽量少地拉取数据以更新缓存(但可能出错)
  -H HOST, --host HOST  ip 或 hostname,默认值:'0.0.0.0'
  -P PORT, --port PORT  端口号,默认值:8123
  -v, --version         输出版本号
  -l, --license         输出授权信息

✈️ 关于登录

登录时,可以选择其一:
    1. 账号和密码,或 client_id 和 client_secret(-u/--user 和 -p/--password)
    2. 访问令牌(-t/--token)

🔨 关于使用

当你访问首页时,会罗列你的网盘入口(路径为 /0)和所有分享入口(路径为 /分享码 或 /分享码:密码)

    http://localhost:8123/

当你访问这个链接路径之下,就是你自己网盘的文件

    http://localhost:8123/0/网盘下的路径

当你访问这个路径之下,则是这个分享下的文件

    http://localhost:8123/分享码/分享下的路径
    http://localhost:8123/分享码:密码/分享下的路径

你可以随意指定一个有效的分享码和路径,而不用管这个分享是不是你自己创建的

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

p123dav-0.0.3.1.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

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

p123dav-0.0.3.1-py3-none-any.whl (44.6 kB view details)

Uploaded Python 3

File details

Details for the file p123dav-0.0.3.1.tar.gz.

File metadata

  • Download URL: p123dav-0.0.3.1.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.4 Darwin/23.5.0

File hashes

Hashes for p123dav-0.0.3.1.tar.gz
Algorithm Hash digest
SHA256 ff2b31fff2f63f0218147e6f47a62dcb424d272a1f49af3cb887c309eec94920
MD5 c6f88e28c14c5330d035ac1a354fba5a
BLAKE2b-256 8a50cc631589269c538fca845a217f0f16393e1d69406c7dff56469360113d23

See more details on using hashes here.

File details

Details for the file p123dav-0.0.3.1-py3-none-any.whl.

File metadata

  • Download URL: p123dav-0.0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 44.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.4 Darwin/23.5.0

File hashes

Hashes for p123dav-0.0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eeb734d749d8546b7b39a8e7d46085d6e5a3cf4d46ebac7f02c99ea7c8cb28be
MD5 029f0ed2ac5b89713f35e342edc400d7
BLAKE2b-256 36474d065f26d9b767dbbc18c0099a91190437f4d936a5caaacffb9e2a8287b1

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