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.5.1/aliyundrive-webdav_1.5.1-1_aarch64_generic.ipk
wget https://github.com/messense/aliyundrive-webdav/releases/download/v1.5.1/luci-app-aliyundrive-webdav_1.5.1_all.ipk
wget https://github.com/messense/aliyundrive-webdav/releases/download/v1.5.1/luci-i18n-aliyundrive-webdav-zh-cn_1.5.1-1_all.ipk
opkg install aliyundrive-webdav_1.5.1-1_aarch64_generic.ipk
opkg install luci-app-aliyundrive-webdav_1.5.1_all.ipk
opkg install luci-i18n-aliyundrive-webdav-zh-cn_1.5.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.5.1
USAGE:
aliyundrive-webdav [OPTIONS]
OPTIONS:
--cache-size <CACHE_SIZE> Directory entries cache size [default: 1000]
--cache-ttl <CACHE_TTL> Directory entries cache expiration time in seconds [default: 600]
--debug Enable debug log
--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]
--strip-prefix <STRIP_PREFIX> Prefix to be stripped off when handling request [env: WEBDAV_STRIP_PREFIX=]
--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
字段的值,如下图所示红色部分: -
使用移动端 App refresh token: 需要在其前增加
app:
前缀,如 refresh token 为abcd
则填入app:abcd
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.5.1-py3-none-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ba01621864d66c5668095f855fceb2af97817cac8eb25e5e613c14d349e87b3 |
|
MD5 | eab390babb1e0e68283475d70408eeaa |
|
BLAKE2b-256 | f0984b1afc64690c5a0ee879846a41a9d5cb4ca6b309ee3bd2e063a3c65764ee |
Hashes for aliyundrive_webdav-1.5.1-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6175466561afa91808d5729e563e82d8a3bfbec379e8171d4ec4e3244b0a1896 |
|
MD5 | 4bdce27374eaab501dad76848eb1e527 |
|
BLAKE2b-256 | 7760a75f55ccea09e9f9831806189486963ab0971e2fcf3cf05445bfad452d73 |
Hashes for aliyundrive_webdav-1.5.1-py3-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bd4d898fb9dd20491948540a33e396c78a6453d64f24eed50db6fdecdc6a314 |
|
MD5 | 3f308cf5fa9c6a4897ac0ee1b7c1b24e |
|
BLAKE2b-256 | 4f2b7e0e771c2df7e99014ac912dd7ecfc9e0cba7da35283353b28909c1e783c |
Hashes for aliyundrive_webdav-1.5.1-py3-none-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20804a8f18faabe63ad76401607a3d97cb1db59a7ffd860a62d7299455d191d7 |
|
MD5 | 3e30c86204b6278e4b16c4b04c0dbaed |
|
BLAKE2b-256 | 90c22ca6ebf2e08e0ac209d945cc75ca0ec7a75c20ca2776411626a5520958f0 |
Hashes for aliyundrive_webdav-1.5.1-py3-none-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 343a681dd6f24dc88182c9e606ac3ebaab1792faa8ba397c4b89e9fe490f2ce1 |
|
MD5 | 90b945d4066fbb2585e6bf4a0247f7a7 |
|
BLAKE2b-256 | 2a03512fad38e8e17356ba732ea31561bddff941d8d16d780d8489f7566c2cda |
Hashes for aliyundrive_webdav-1.5.1-py3-none-musllinux_1_1_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9244190a0f08ad9829a707d7ae108f31efca452ca615bc9d00a5a56208666e99 |
|
MD5 | 1120e7c2f3191b8d856992e7f2d49876 |
|
BLAKE2b-256 | bc57842f3bcfed94e2a796e4037b9cb9fbcb805727a485bb3c295e51866bc175 |
Hashes for aliyundrive_webdav-1.5.1-py3-none-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff75ada9c17730f21e8ad2c88eb10469e470bd3ac682988c2432ae1fbc152d51 |
|
MD5 | cb52fc8edd89f53ac8219e80c74f3672 |
|
BLAKE2b-256 | 5e212701aa579ea26485684e55ac7153187aa89e4c5a07dbf3d3fc388842b2e5 |
Hashes for aliyundrive_webdav-1.5.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de894572fe0e0fbc377bdaac406c885bb8141147fc57253051191892aa9c0b79 |
|
MD5 | 48d1f4cc3a212f6d64373a7f3d17ebd7 |
|
BLAKE2b-256 | 3c92d7615d34f43b93680c18c333c78de6ec3df2f38d102b690121ace2d85cf7 |
Hashes for aliyundrive_webdav-1.5.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d15cddd6a88a86244cde64bddff6dfccd9624e815c1736fe3bd702223f2ed6c2 |
|
MD5 | 4c66c45fbdd92348dbd7566b8bf3c25b |
|
BLAKE2b-256 | 23f0ae8ec37fb959e0fe3c3de11b97266718b3f994577f30ea96f11615ee07e8 |
Hashes for aliyundrive_webdav-1.5.1-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9eb1f235dd221af75ed2c01b6f82a73f3ff502380930a9f34cd878e4b3a926aa |
|
MD5 | da7cb645407f32d59b76ba0b4d6c3c6f |
|
BLAKE2b-256 | d8ce3ebffe9d8723c3cc1417091b832b61367540d5535f4247c3bded2a7daaf5 |
Hashes for aliyundrive_webdav-1.5.1-py3-none-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c83a97e3a0c407d2fcb747ca0384d1e4c8a949ba24dcd58e0f112b0974046f2 |
|
MD5 | cbae7ff5371330543e11b342b9a8c182 |
|
BLAKE2b-256 | dcae89d13e902c8b172c94b55a38eb131272f5b36f44d54ed3dba0d14a9b722b |
Hashes for aliyundrive_webdav-1.5.1-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8ea967b7234504098c56da7e0ab60798ee65e01c4c2398692779de869841798 |
|
MD5 | 05e4b0a5d6d58725c8ab6fef6aa433bf |
|
BLAKE2b-256 | 4920dea1972c49f11cc67c21102c01dd363f98452c3a1efb96fca7294b839326 |
Hashes for aliyundrive_webdav-1.5.1-py3-none-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 715f769f3199961103fea62bf04d9251c92897c823cf96fb886ac500634ace4d |
|
MD5 | 8f90745b9375477ac26e16e2dbb87bc6 |
|
BLAKE2b-256 | 4fcbc83f4446c089e7903d7a1be3546e6b289ddbd13e230000fd6e099e2c5221 |