WebDAV server for AliyunDrive
Project description
aliyundrive-webdav
🚀 Help me to become a full-time open-source developer by sponsoring me on GitHub
阿里云盘 WebDAV 服务,主要使用场景为配合支持 WebDAV 协议的客户端 App 如 Infuse、nPlayer 等实现在电视上直接观看云盘视频内容, 支持上传文件,但受限于 WebDAV 协议不支持文件秒传。
如果你使用 Emby 或者 Jellyfin,也可以试试 aliyundrive-fuse 项目。
如果项目对你有帮助,请考虑捐赠支持项目持续维护。
安装
可以从 GitHub Releases 页面下载预先构建的二进制包, 也可以使用 pip 从 PyPI 下载:
pip install aliyundrive-webdav
如果系统支持 Snapcraft 比如 Ubuntu、Debian 等,也可以使用 snap 安装:
sudo snap install aliyundrive-webdav
OpenWrt 路由器
GitHub Releases 中有预编译的 ipk 文件, 目前提供了 aarch64/arm/mipsel/x86_64/i686 等架构的版本,可以下载后使用 opkg 安装,以 nanopi r4s 为例:
wget https://github.com/messense/aliyundrive-webdav/releases/download/v1.2.1/aliyundrive-webdav_1.2.1_aarch64_generic.ipk
wget https://github.com/messense/aliyundrive-webdav/releases/download/v1.2.1/luci-app-aliyundrive-webdav_1.2.1_all.ipk
wget https://github.com/messense/aliyundrive-webdav/releases/download/v1.2.1/luci-i18n-aliyundrive-webdav-zh-cn_1.2.1-1_all.ipk
opkg install aliyundrive-webdav_1.2.1_aarch64_generic.ipk
opkg install luci-app-aliyundrive-webdav_1.2.1_all.ipk
opkg install luci-i18n-aliyundrive-webdav-zh-cn_1.2.1-1_all.ipk
其它 CPU 架构的路由器可在 GitHub Releases 页面中查找对应的架构的主程序 ipk 文件下载安装, 常见 OpenWrt 路由器 CPU 架构如下表(欢迎补充):
路由器 | CPU 架构 |
---|---|
nanopi r4s | aarch64_generic |
小米 AX3600 | aarch64_cortex-a53 |
斐讯 N1 盒子 | aarch64_cortex-a53 |
Newifi D2 | mipsel_24kc |
Pogoplug | arm_mpcore |
Tips: 不清楚 CPU 架构类型可通过运行
opkg print-architecture
命令查询。
Koolshare 梅林固件
GitHub Releases 中有预编译包 aliyundrivewebdav-merlin-arm*.tar.gz
, 目前提供了旧的 arm380 和兼容 arm384/386 固件的版本,可在下载后在软件中心离线安装。
Docker 运行
docker run -d --name=aliyundrive-webdav --restart=unless-stopped -p 8080:8080 \
-v /etc/aliyundrive-webdav/:/etc/aliyundrive-webdav/ \
-e REFRESH_TOKEN='your refresh token' \
-e WEBDAV_AUTH_USER=admin \
-e WEBDAV_AUTH_PASSWORD=admin \
messense/aliyundrive-webdav
其中,REFRESH_TOKEN
环境变量为你的阿里云盘 refresh_token
,WEBDAV_AUTH_USER
和 WEBDAV_AUTH_PASSWORD
为连接 WebDAV 服务的用户名和密码。
QNAP 威联通 NAS
QNAP 插件
qnap-aliyunpan-webdav by @iranee.
ContainerStation (Docker)
管理员登陆 NAS 后安装 ContainerStation 并启动服务,在 Management (管理) 标签中 Create Application (新建应用),配置如下
version: '3.3'
services:
aliyundrive-webdav:
container_name: aliyundrive-webdav
restart: unless-stopped
ports:
- '8080:8080'
environment:
- 'REFRESH_TOKEN=mytoken...'
image: messense/aliyundrive-webdav
其中 REFRESH_TOKEN
文档最下面说明;:8080
网盘访问映射端口,可以按需改为其他的。
点击 Create (创建)后启动,访问 http://nas地址:8080/ 即可看到你网盘的自动生成索引网页文件。
参考文档
命令行用法
$ aliyundrive-webdav --help
aliyundrive-webdav 1.2.1
USAGE:
aliyundrive-webdav [OPTIONS] --refresh-token <REFRESH_TOKEN>
OPTIONS:
--cache-size <CACHE_SIZE> Directory entries cache size [default: 1000]
--cache-ttl <CACHE_TTL> Directory entries cache expiration time in seconds [default: 600]
--domain-id <DOMAIN_ID> Aliyun PDS domain id
-h, --help Print help information
--host <HOST> Listen host [env: HOST=] [default: 0.0.0.0]
-I, --auto-index Automatically generate index.html
--no-trash Delete file permanently instead of trashing it
-p, --port <PORT> Listen port [env: PORT=] [default: 8080]
-r, --refresh-token <REFRESH_TOKEN> Aliyun drive refresh token [env: REFRESH_TOKEN=]
--read-only Enable read only mode
--root <ROOT> Root directory path [default: /]
-S, --read-buffer-size <READ_BUFFER_SIZE> Read/download buffer size in bytes, defaults to 10MB [default: 10485760]
--tls-cert <TLS_CERT> TLS certificate file path [env: TLS_CERT=]
--tls-key <TLS_KEY> TLS private key file path [env: TLS_KEY=]
-U, --auth-user <AUTH_USER> WebDAV authentication username [env: WEBDAV_AUTH_USER=]
-V, --version Print version information
-w, --workdir <WORKDIR> Working directory, refresh_token will be stored in there if specified
-W, --auth-password <AUTH_PASSWORD> WebDAV authentication password [env: WEBDAV_AUTH_PASSWORD=]
注意:TLS/HTTPS 暂不支持 MIPS 架构。
获取 refresh_token
-
自动获取: 登录阿里云盘后,控制台粘贴
JSON.parse(localStorage.token).refresh_token
-
手动获取: 登录阿里云盘后,可以在开发者工具 -> Application -> Local Storage 中的
token
字段中找到。
注意:不是复制整段 JSON 值,而是 JSON 里refresh_token
字段的值,如下图所示红色部分:
License
This work is released under the MIT license. A copy of the license is provided in the LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for aliyundrive_webdav-1.2.1-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b5eae79e4619e0a7a6d6759c1c45098ed4049746151193e251629e1eac98c2d |
|
MD5 | 33942cbbaeaa0fc570a654a065f1bcec |
|
BLAKE2b-256 | e44a661c6a69e344345a694fdacad61b1d1876da8928e978c67fae5b90c72cba |
Hashes for aliyundrive_webdav-1.2.1-py3-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6addce9fec7c44fe265f939e28e765cf2295e1c27e8f1df2bf932528380562b1 |
|
MD5 | c61724c9b48377b4cf765934aeaf1266 |
|
BLAKE2b-256 | 1de407fce9920e6b6eeda3d00f3139fc99fe0bf7b6967cec70a7f2531b19950a |
Hashes for aliyundrive_webdav-1.2.1-py3-none-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f44e4c98eb092ec5d43bd43d38af63c96fc16802299edd0d574d8e3aabe60209 |
|
MD5 | 68dc428d610a49ea11a1d45e3f230b73 |
|
BLAKE2b-256 | 30ba867da6548f29c5e6836c0e336417e6b199c95eba178647aea585194e3062 |
Hashes for aliyundrive_webdav-1.2.1-py3-none-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17b6330a4af2f12e927de140d9bf2e06ddf34f37251b50618b09d55e4c39e0b9 |
|
MD5 | e6a511fe69eb4717f7b2c9562bfad4d7 |
|
BLAKE2b-256 | 130929e705929bceaaef739d2791c7a7f8a903c6e791a141fe76b4d47e1d3078 |
Hashes for aliyundrive_webdav-1.2.1-py3-none-musllinux_1_1_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d1c1ff9772fd965455086003fe458978fc3177d373291586a8e49b0de24703d |
|
MD5 | e176437f57c56e13164f85f38c0d51a5 |
|
BLAKE2b-256 | 65249f1df7a3e1b8cb35504d50272e5eb81542a2a142a1f2240e5abfeab1b377 |
Hashes for aliyundrive_webdav-1.2.1-py3-none-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d423f69e311104442556fa5316455202eb3c69b4df0360bee47f0f0c23e4d55 |
|
MD5 | 19482c0eb5cd4092147b3b0b055fe7d6 |
|
BLAKE2b-256 | 33defd74796f866f51401c418ae1339dd3e216286a0c5e06e26540969229ffb1 |
Hashes for aliyundrive_webdav-1.2.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13da151a8fbed06abc9e9f01e6f11aba0361f06cef853c13972a18e31c4db576 |
|
MD5 | f78a53172c7a0749f58e137d27bf9faa |
|
BLAKE2b-256 | 3b1a35a6a01032129b10184fc0e464eb9839ab5ca183e7b54e1146c9d1f1553f |
Hashes for aliyundrive_webdav-1.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acfc3a3e64451d386eef9022d0af91e5410e9e251368e37fb8e024359e7a4a32 |
|
MD5 | 9110673aabecebbd52ff6683f1548141 |
|
BLAKE2b-256 | b3e833d782899dc82ada2cae030b9bf8f94ef05a8755839eb97a54f7580ee81b |
Hashes for aliyundrive_webdav-1.2.1-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 652fa65338ad0147b732ff53741921f5d9d38a31d1db57697bd2f1c055a2dded |
|
MD5 | 905fa834dde0817e0e3f2e8902494758 |
|
BLAKE2b-256 | 0ed4a2021ca116025a1708d01344ca79145fa478a6fa1838bbcfdaa04f96ad59 |
Hashes for aliyundrive_webdav-1.2.1-py3-none-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b13f7ab2f31bd2f6b0efaf9bc66bb1342c9588d2d068936612fccbf13c8fea7 |
|
MD5 | 22a9997a74a2179430fbc81fc9b20ee0 |
|
BLAKE2b-256 | a7315406afffd108bb36b6b17321fc5945141d4d85f96099b591ed55b1a0a2a0 |
Hashes for aliyundrive_webdav-1.2.1-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30b0de36f26a2b85a2a17911f71d1e1f762bb952bf3e7d95960f7d6f059c4816 |
|
MD5 | ba7f1b01b543b505c06ea03329bb88d1 |
|
BLAKE2b-256 | ee76bd502b1a5ebc80d5c2160092089ac45934cf091f3878c8d14ccb56f6b50a |
Hashes for aliyundrive_webdav-1.2.1-py3-none-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2a919dcd0eef56fd2b7e87291d1c83f3a3282dec41048aeffbf006deac45318 |
|
MD5 | df6633ee776409cbea58159f6a7dd204 |
|
BLAKE2b-256 | 8cb35d992aa0218ab8322ca7906dd490adf0c285f6ab8582bfbfaf3a21c6a3db |