WebDAV server for AliyunDrive
Project description
aliyundrive-webdav
阿里云盘 WebDAV 服务,主要使用场景为配合支持 WebDAV 协议的客户端 App 如 Infuse、nPlayer 等实现在电视上直接观看云盘视频内容, 支持上传文件,但受限于 WebDAV 协议不支持文件秒传。
安装
可以从 GitHub Releases 页面下载预先构建的二进制包, 也可以使用 pip 从 PyPI 下载:
pip 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/v0.4.7/aliyundrive-webdav_0.4.7-1_aarch64_generic.ipk
wget https://github.com/messense/aliyundrive-webdav/releases/download/v0.4.7/luci-app-aliyundrive-webdav_0.4.7_all.ipk
wget https://github.com/messense/aliyundrive-webdav/releases/download/v0.4.7/luci-i18n-aliyundrive-webdav-zh-cn_0.4.7-1_all.ipk
opkg install aliyundrive-webdav_0.4.7-1_aarch64_generic.ipk
opkg install luci-app-aliyundrive-webdav_0.4.7_all.ipk
opkg install luci-i18n-aliyundrive-webdav-zh-cn_0.4.7-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 |
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
管理员登陆 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 0.4.7
USAGE:
aliyundrive-webdav [FLAGS] [OPTIONS] --refresh-token <refresh-token>
FLAGS:
-I, --auto-index Automatically generate index.html
-h, --help Prints help information
--no-trash Delete file permanently instead of trashing it
-V, --version Prints version information
OPTIONS:
-W, --auth-password <auth-password> WebDAV authentication password [env: WEBDAV_AUTH_PASSWORD=]
-U, --auth-user <auth-user> WebDAV authentication username [env: WEBDAV_AUTH_USER=]
--cache-size <cache-size> Directory entries cache size [default: 1000]
--cache-ttl <cache-ttl> Directory entries cache expiration time in seconds [default: 600]
--host <host> Listen host [default: 0.0.0.0]
-p, --port <port> Listen port [default: 8080]
-S, --read-buffer-size <read-buffer-size>
Read/download buffer size in bytes, defaults to 10MB [default: 10485760]
-r, --refresh-token <refresh-token> Aliyun drive refresh token [env: REFRESH_TOKEN=]
--root <root> Root directory path [default: /]
-w, --workdir <workdir> Working directory, refresh_token will be stored in there if specified
获取 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-0.4.7-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23cc2db9221985461a8398bd45b5c56956b2840979904adfb9c7ff6911484e57 |
|
MD5 | 750c9695fe5ca2c900727c4064504178 |
|
BLAKE2b-256 | a2c76d58e75a2873191e5c176aca3f41c54b2d59462f3af378e87e9d535b6897 |
Hashes for aliyundrive_webdav-0.4.7-py3-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ea3da528c858070287d3612f0db515ecd447c10a131d4b431e210db33c7265b |
|
MD5 | 5e8ddcb9eb568585d2f985048ded98a6 |
|
BLAKE2b-256 | 207acb895b9c8a115ef7f375be1b68551d1dc0e3bb1b63bcc3f485f3e10f1f58 |
Hashes for aliyundrive_webdav-0.4.7-py3-none-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff3ad162015d46e2da2bc247930c91400632c68155daf8b904c49ef342604b9b |
|
MD5 | a05b6b542b87e9d761bafab6a430be71 |
|
BLAKE2b-256 | 0b389afa1c2624c5480357467f355d79c00b33be2e66993a37b41b01b6ee3f1f |
Hashes for aliyundrive_webdav-0.4.7-py3-none-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c5f1243d07b9f360d6f21f206f43c635c311f8565ac88c7a7dd13dded56875b |
|
MD5 | 571f3507c5f620f091c194f036f6405f |
|
BLAKE2b-256 | 8b753a0bad3c242fab61bb5c629ab4f1593590d3022890f42d08b54f50be7e6d |
Hashes for aliyundrive_webdav-0.4.7-py3-none-musllinux_1_1_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c754e67e424ad812b63bbcb3a38e28867bc19a6154d075f44d444d0166cdb740 |
|
MD5 | 7359e6d6e8b4adca89e4d3f0f4447db0 |
|
BLAKE2b-256 | 866585eea4934ef10eded0dcaab00e140a8fab4ed192820a743263db8b6013ab |
Hashes for aliyundrive_webdav-0.4.7-py3-none-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54b71c952c71e1e64a270c1f5ade7bbcec41dd6f5afd4f73469a49e4e78c0b69 |
|
MD5 | 172b10dccbdca3800f3dd843fc68e3be |
|
BLAKE2b-256 | 523bbb8f3818e28c0138295e03a17d2a9d0c6cfa00c3e7329349b7013322487d |
Hashes for aliyundrive_webdav-0.4.7-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 449530e43eb89cfce0d4d430d9fa98c7d81aff73f3eda2b3832f95cb85f09257 |
|
MD5 | 327f17a73c5b2fc2634cd3ecbb3f236b |
|
BLAKE2b-256 | 2a5bfc93ee7e2fb567a83dac665edc47ecd6cf6b5fa3e9c6f9046dd0a884f377 |
Hashes for aliyundrive_webdav-0.4.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d0301263de45034f4936a282c79f157ef2b39eb24e51cb151558e2b0be72a97 |
|
MD5 | d3e08aa440aee56298f0d8a2eac80fb1 |
|
BLAKE2b-256 | 30732a0108050368947ca0ecc4d8ec5012815c5766d29d148a15771b4b837507 |
Hashes for aliyundrive_webdav-0.4.7-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68f5f14ee3b61d81a76b4b5460aa575e8a538c4acd9f4060252270e163880316 |
|
MD5 | 116d9ee1e77aed53118661e349013025 |
|
BLAKE2b-256 | b52e0f906187abd61dd227fd4828081ae6ef3c939e8cabac09c8836041250ac6 |
Hashes for aliyundrive_webdav-0.4.7-py3-none-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77a3819def2a12905201b40e0a4ca8192a0eabb8ecf069c2dfffba9725137f28 |
|
MD5 | b30c5787d924c4bcf7ac369836871c43 |
|
BLAKE2b-256 | fab38b9bb4b68b0df185076e0c4cfe219b04c29eafdae0a735cf6f1fa90cf6cd |
Hashes for aliyundrive_webdav-0.4.7-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 532a0d89cb11ca4c00ea39d0225872f2987d4398dc8b1d577fa48babff5b0a13 |
|
MD5 | a42192ae69cc454847e5a5bc64fa1806 |
|
BLAKE2b-256 | eeb1ea7b37fc25906f0362139f83f18bf81c2bb21ae93deed749ee1865c288cc |
Hashes for aliyundrive_webdav-0.4.7-py3-none-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd5b56244c6383eb9e222e7ae337216f290b241a7c5af11946f54a1830b3dd00 |
|
MD5 | 0fd4708fe90841bb1899d6ca8f22b345 |
|
BLAKE2b-256 | 035f7b39bfd687dacc6c2388a41fec5ddfd1418d9ca5d5e1eec3f93c87fed51d |