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.7.0/aliyundrive-webdav_1.7.0-1_aarch64_generic.ipk
wget https://github.com/messense/aliyundrive-webdav/releases/download/v1.7.0/luci-app-aliyundrive-webdav_1.7.0_all.ipk
wget https://github.com/messense/aliyundrive-webdav/releases/download/v1.7.0/luci-i18n-aliyundrive-webdav-zh-cn_1.7.0-1_all.ipk
opkg install aliyundrive-webdav_1.7.0-1_aarch64_generic.ipk
opkg install luci-app-aliyundrive-webdav_1.7.0_all.ipk
opkg install luci-i18n-aliyundrive-webdav-zh-cn_1.7.0-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.7.0
WebDAV server for AliyunDrive
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-self-upgrade Disable self auto upgrade
--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.7.0-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8bce05c75745b13624caa9cb6658c009966293f0cce32c2eba135d29601c6ca |
|
MD5 | ea48899f75a220b3b9742a9baf6517cf |
|
BLAKE2b-256 | 6a63a827622f632b9a5eb6f1908fd6042bd95995b3482c2026e6f83520626fb7 |
Hashes for aliyundrive_webdav-1.7.0-py3-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7b8f6414f31f1ef83642355df749a63c7a269c633cdb9284b261f2401403bd0 |
|
MD5 | c6e73905cac29f916ade77866a5631f0 |
|
BLAKE2b-256 | e3aed8234e6cb2870c8335949dbcc6e82f935977b844298990c3c4aabef0dabe |
Hashes for aliyundrive_webdav-1.7.0-py3-none-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59a6faf2817a84c9613c702f9aa5e3f5cc934988e3606ce3b5a0464ac4c912cd |
|
MD5 | ca695f7e635027e099c3bc13a7c8d81b |
|
BLAKE2b-256 | 2142261e48cfca650aafe3b3ef94188a48cc01b2e4951b023428a279611e94b4 |
Hashes for aliyundrive_webdav-1.7.0-py3-none-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db4789015fb4ebf16b88dc5b7ed4104065e0991c13dcd1aaea984cb9b943590e |
|
MD5 | 316a090aad8cdf261a80643dbbd11c04 |
|
BLAKE2b-256 | e745bc3f26b0019ec556d851d347506c0dc36c99500705237abc068aaab43d36 |
Hashes for aliyundrive_webdav-1.7.0-py3-none-musllinux_1_1_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f973de2a4906f5b13ed57d6db9058efffe78ac5c90460c56d218f007d95381fa |
|
MD5 | 3d58ef506a4b1d238e26580963f24c47 |
|
BLAKE2b-256 | 01899c260893635a706362a5cf203b92dd182973d34d0c90feffad7508c17bdd |
Hashes for aliyundrive_webdav-1.7.0-py3-none-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b320e2a572373ebe9ca45162e016a79b76e8801fd3a5e05e957e1215e1b2a70 |
|
MD5 | b636c7cf96b1d42df381d3e04c3ec4b7 |
|
BLAKE2b-256 | 64614ed2ec21d71f37dc5e14d203c78ede9ef306613cce7ba36a7127a1717791 |
Hashes for aliyundrive_webdav-1.7.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fb8c2890f962ca5d7426d90c14014950a7cda41957f4d76bedf07ed36eecdbc |
|
MD5 | 1bee7bfac78871d59f6181a6fa0c1ff7 |
|
BLAKE2b-256 | b12d83eaa0a1f236a394068645edeec40deada8f9770249be0ffe52ae577f2de |
Hashes for aliyundrive_webdav-1.7.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 906f76a1c6c892a4ae6b4aad0f98df60d8bdd5a87e698f71c22251b7e91ef919 |
|
MD5 | 6f784880bdf9914db5acdf76c19789cc |
|
BLAKE2b-256 | 2fc71e2a57ec929d0756790290c7b818e69e946cca2b0411a7796911e347229f |
Hashes for aliyundrive_webdav-1.7.0-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fddac56593faadc90bb9baa2365a4e1545b3194f33816497a760fc8bf1aeca0 |
|
MD5 | 5cb11a9e3b39dbacc684f654afe9691b |
|
BLAKE2b-256 | c78faf5f21b79e25b9096ec2ebd662966a155305d7630eaa557334fbbf26d79b |
Hashes for aliyundrive_webdav-1.7.0-py3-none-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e34627cccb9cfadf3e3e5ff726c0fce620ce4ea288f04ba1c94d45fc5e644ff8 |
|
MD5 | 5330416443a916f5b0c8976d54d0104f |
|
BLAKE2b-256 | dee6b547be3ecc29273da046c729f1570874fed27d2e618ed7f734b8b4ba6d7f |
Hashes for aliyundrive_webdav-1.7.0-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4616d969a14001363789fe2422a0ed9b0b41ae3b362d870f783131451ce8589 |
|
MD5 | 1d61ab75ac41361d37d694b897c69864 |
|
BLAKE2b-256 | e8a63eb69b0859a4c72539e69794eb51eaa7191583befb1e8dc33fcacb526004 |
Hashes for aliyundrive_webdav-1.7.0-py3-none-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac4418c02f7da571ee568717ca627ad276659e220d782e5c0f3cc695af5a3c7d |
|
MD5 | 7e163a046dbc147e9f03df3bb3f6e105 |
|
BLAKE2b-256 | a1ed29bbac466962aa923f8de09d223d5873e9a00c16085c47563877babaf634 |