Giter Site home page Giter Site logo

aliyundrive-fuse's Introduction

aliyundrive-fuse

GitHub Actions PyPI Docker Image aliyundrive-fuse Crates.io

🚀 Help me to become a full-time open-source developer by sponsoring me on GitHub

阿里云盘 FUSE 磁盘挂载,主要用于配合 Emby 或者 Jellyfin 观看阿里云盘内容,功能特性:

  1. 目前只读,不支持写入
  2. 支持 Linux 和 macOS,暂不支持 Windows

aliyundrive-webdav 项目已经实现了通过 WebDAV 访问阿里云盘内容,但由于 Emby 和 Jellyfin 都不支持直接访问 WebDAV 资源, 需要配合 rclone 之类的软件将 WebDAV 挂载为本地磁盘,而本项目则直接通过 FUSE 实现将阿里云盘挂载为本地磁盘,省去使用 rclone 再做一层中转。

安装

  • macOS 需要先安装 macfuse
  • Linux 需要先安装 fuse
    • Debian 系如 Ubuntu: apt-get install -y fuse3
    • RedHat 系如 CentOS: yum install -y fuse3

可以从 GitHub Releases 页面下载预先构建的二进制包, 也可以使用 pip 从 PyPI 下载:

pip install aliyundrive-fuse

如果系统支持 Snapcraft 比如 Ubuntu、Debian 等,也可以使用 snap 安装:

sudo snap install aliyundrive-fuse

OpenWrt 路由器

GitHub Releases 中有预编译的 ipk 文件, 目前提供了 aarch64/arm/x86_64/i686 等架构的版本,可以下载后使用 opkg 安装,以 nanopi r4s 为例:

wget https://github.com/messense/aliyundrive-fuse/releases/download/v0.1.14/aliyundrive-fuse_0.1.14-1_aarch64_generic.ipk
wget https://github.com/messense/aliyundrive-fuse/releases/download/v0.1.14/luci-app-aliyundrive-fuse_0.1.14_all.ipk
wget https://github.com/messense/aliyundrive-fuse/releases/download/v0.1.14/luci-i18n-aliyundrive-fuse-zh-cn_0.1.14-1_all.ipk
opkg install aliyundrive-fuse_0.1.14-1_aarch64_generic.ipk
opkg install luci-app-aliyundrive-fuse_0.1.14_all.ipk
opkg install luci-i18n-aliyundrive-fuse-zh-cn_0.1.14-1_all.ipk

其它 CPU 架构的路由器可在 GitHub Releases 页面中查找对应的架构的主程序 ipk 文件下载安装。

Tips: 不清楚 CPU 架构类型可通过运行 opkg print-architecture 命令查询。

命令行用法

USAGE:
    aliyundrive-fuse [OPTIONS] --refresh-token <REFRESH_TOKEN> <PATH>

ARGS:
    <PATH>    Mount point

OPTIONS:
        --allow-other                            Allow other users to access the drive
    -h, --help                                   Print help information
    -r, --refresh-token <REFRESH_TOKEN>          Aliyun drive refresh token [env: REFRESH_TOKEN=]
    -S, --read-buffer-size <READ_BUFFER_SIZE>    Read/download buffer size in bytes, defaults to 10MB [default: 10485760]
    -V, --version                                Print version information
    -w, --workdir <WORKDIR>                      Working directory, refresh_token will be stored in there if specified

比如将磁盘挂载到 /mnt/aliyundrive 目录:

mkdir -p /mnt/aliyundrive /var/run/aliyundrive-fuse
aliyundrive-fuse -r your-refresh-token -w /var/run/aliyundrive-fuse /mnt/aliyundrive

Emby/Jellyfin

如果是直接运行在系统上的 Emby/Jellyfin,则可以直接在其控制台添加媒体库的时候选择阿里云盘对应的挂载路径中的文件夹即可; 如果是 Docker 运行的 Emby/Jellyfin,则需要将阿里云盘挂载路径也挂载到 Docker 容器中,假设阿里云盘挂载路径为 /mnt/aliyundrive, 以 Jellyfin 为例(假设 Jellyfin 工作路径为 /root/jellyfin)将云盘挂载到容器 /media 路径:

docker run -d --name jellyfin \
  -v /root/jellyfin/config:/config \
  -v /root/jellyfin/cache:/cache \
  -v /mnt/aliyundrive:/media \
  -p 8096:8096 \
  --device=/dev/dri/renderD128 \
  --device /dev/dri/card0:/dev/dri/card0 \
  --restart unless-stopped \
  jellyfin/jellyfin

License

This work is released under the MIT license. A copy of the license is provided in the LICENSE file.

aliyundrive-fuse's People

Contributors

beginner-go avatar chunfengyao avatar jjm2473 avatar messense avatar tominescu avatar wqyjh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aliyundrive-fuse's Issues

无法连接,试过多次退出登录,更新refresh token都不行

2022-02-23T09:35:11.285096Z WARN aliyundrive_fuse::drive: refresh token failed, will wait and retry error=error sending request for url (https://websv.aliyundrive.com/token/refresh): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
2022-02-23T09:35:12.285677Z WARN aliyundrive_fuse::drive: refresh token failed, will wait and retry error=error sending request for url (https://websv.aliyundrive.com/token/refresh): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
2022-02-23T09:35:13.285833Z ERROR aliyundrive_fuse::drive: refresh token failed: error sending request for url (https://websv.aliyundrive.com/token/refresh): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
Error: initialize aliyundrive client failed

挂载到OpenWRT的外接硬盘目录下文件不显示

下载OpenWRT相关的FUSE插件安装后,并根据文档方法及命令,将云盘挂载到了/mnt/sdb2(OpenWRT外接的硬盘的第二分区),刚开始看到是挂在成功了的,也要显示云盘里的目录和文件,但是再一刷新就只看得到挂载的云盘目录,而点击进去就再没有看到目录和文件啦。这是怎么回事呢?盼解答,谢谢!

有计划支持写入吗?

使用 emby 或 jellyfin 时有搜刮、下载字幕需求,希望回写网盘。
目前用 webdav + rclone 颇为麻烦,而且遇到重启还依赖启动顺序...得额外写脚本处理

求助:illegal hardware instruction aliyundrive-fuse -h

我家云armbian系统,docker中安装了openwrt,想在op中安装aliyundrive-fuse。
$ opkg print-architecture arch all 1 arch noarch 1 arch arm_cortex-a7_neon-vfpv4 10
$ opkg install aliyundrive-fuse_0.1.12-1_arm_cortex-a7_neon-vfpv4.ipk Package aliyundrive-fuse (0.1.12-1) installed in root is up to date.
$ aliyundrive-fuse -h
[1] 21028 illegal hardware instruction aliyundrive-fuse -h
``

NanoPi-NEO2 官方的FriendlyCore装不上 fuse3

官方的 FriendlyCore 应该是类似 UbuntuCore 16.04

NanoPi-NEO2 官方wiki

nanopi-neo2_sd_friendlycore-xenial_4.14_arm64_YYYYMMDD.img.zip
基于UbuntuCore构建的系统固件,使用Linux-4.14内核

root@NanoPi-NEO2:~# uname -a
Linux NanoPi-NEO2 4.14.111 #1 SMP Thu Dec 19 19:12:27 CST 2019 aarch64 aarch64 aarch64 GNU/Linux
root@NanoPi-NEO2:~# sudo apt-get install -y fuse3
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package fuse3 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'fuse3' has no installation candidate

关于macOS挂载后目录为空

Hi @messense ,感谢你的项目,我按照README操作后,终端输出如下:

(base) ➜  ~ sudo aliyundrive-fuse -r token -w /var/run/aliyundrive /mnt/aliyundrive
2022-01-10T01:29:19.838490Z  INFO aliyundrive_fuse::drive: refresh token succeed refresh_token=token nick_name=howie6879
2022-01-10T01:29:19.839350Z  INFO aliyundrive_fuse::drive: found default drive drive_id=87925441

但是aliyundrive下内容为空,是我使用方式不对吗?

image

系统版本:10.13.6

大佬这个问题怎么解决啊

所有都按照步骤弄,最后这个
-bash: aliyundrive-fuse: command not found

请求大佬解答下,我是小白已经研究一天了

docker方式运行挂载的云盘目录能不能映射给宿主机

使用docker方式运行挂载的云盘目录,进去容器里面也能查看到阿里云盘的内容。通过docker run -v方式映射目录,但是宿主机的目录下,里面为空。能不能把docker内已挂载的阿里云盘目录映射给宿主机目录?

使用上的问题

这就是一直卡在这的吗

image

这时候去看挂载目录下是有挂载上的

docker /mnt/aliyundrive 挂载问题

docker run -d --name=aliyundrive-fuse --privileged --device /dev/fuse:/dev/fuse --restart unless-stopped
-v aliyundrive:/mnt/aliyundrive
-v /etc/aliyundrive-fuse:/etc/aliyundrive-fuse
-e TZ=Asia/Shanghai -e REFRESH_TOKEN=f4cc8b4931ef4f3995d93e046e724fd6 messense/aliyundrive-fuse

正常启动,但是/mnt/aliyundrive 目录没挂载上
in docker:

~ # df
Filesystem           1K-blocks      Used Available Use% Mounted on
overlay              883186036   4497036 833755880   1% /
tmpfs                    65536         0     65536   0% /dev
tmpfs                  8128104         0   8128104   0% /sys/fs/cgroup
shm                      65536         0     65536   0% /dev/shm
/dev/nvme0n1p3        15416264   8444596   6168852  58% /etc/aliyundrive-fuse
/dev/nvme0n1p5       883186036   4497036 833755880   1% /etc/resolv.conf
/dev/nvme0n1p5       883186036   4497036 833755880   1% /etc/hostname
/dev/nvme0n1p5       883186036   4497036 833755880   1% /etc/hosts
~ # 

emby 无法访问文件夹

按教程在 vps 里设置加载好阿里云盘。能查看云盘里的东西,但 emby 没有权限读取/mnt/aliyundrive文件夹。还要怎样设置

initialize aliyundrive client failed

➜ ~ aliyundrive-fuse -r xxxxx -w /var/run/aliyundrive-fuse /mnt/aliyundrive
2022-01-19T09:36:21.652876Z ERROR aliyundrive_fuse::drive: refresh token failed: HTTP status client error (400 Bad Request) for url (https://websv.aliyundrive.com/token/refresh): {"code":"InvalidParameter.RefreshToken","message":"The input parameter refresh_token is not valid. Please refer to document.","requestId":null}
Error: initialize aliyundrive client failed
➜ ~ Description: Ubuntu 21.10
➜ ~ apt-get install -y fuse3
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
fuse3 is already the newest version (3.10.3-2).

路径,文件名的中文字符能否采用utf8

我在使用aliyundrive-fuse 映射文件时候在PLEX中文件名称为乱码,
该现象类似我在mount时候没有指定iocharset=utf8时候出现的现象。
想请问能否添加类似功能,使文件,路径的字符集支持UTF8,
感谢!

openwrt x86 无法使用

openwrt 安装完成, 并且配置成功后, 使用 Emby 或者 Jellyfin 都无法连接上.

openwrt 已经安装并且能够正常使用 aliyundrive-webdav .

jellyfin没法访问

openwrt通过ddocker搭的jellyfin,将aliyun挂载到media目录,进jellfin选文件的时候是空目录,是需要设置什么权限嘛

实际测定群晖Docker安装,挂载速度比rclone快

docker run -d --name=alifuse --restart=always
--cap-add SYS_ADMIN
--device /dev/fuse
--security-opt apparmor:unconfined
-e REFRESH_TOKEN="**************"
-e WORKDIR="tmp"
-v "/volume1/docker/rclone/config2":/tmp
-v "/volume1/245-2":/mnt/mediaefs:shared
messense/aliyundrive-fuse

然后终端机运行:
aliyundrive-fuse -r ************* -w /tmp /mnt/mediaefs

现在有一个问题

挂载点“/mnt/mediaefs”怎样可以通过Docker环境变量设置?

install error: cannot find dependency kernel for kmod-fuse

root@OpenWrt:~# opkg install aliyundrive-fuse_0.1.4_aarch64_generic.ipk
Multiple packages (libgcc1 and libgcc1) providing same name marked HOLD or PREFER. Using latest.
Multiple packages (libgcc1 and libgcc1) providing same name marked HOLD or PREFER. Using latest.
Multiple packages (libpthread and libpthread) providing same name marked HOLD or PREFER. Using latest.
Installing aliyundrive-fuse (0.1.4) to root...
Multiple packages (libpthread and libpthread) providing same name marked HOLD or PREFER. Using latest.
Collected errors:
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.10.90-1-d2e75f603f193d26fd405122d8616fcd) for kmod-fuse
 * pkg_hash_fetch_best_installation_candidate: Packages for kmod-fuse found, but incompatible with the architectures configured
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for aliyundrive-fuse:
 *      kernel (= 5.10.90-1-d2e75f603f193d26fd405122d8616fcd)
 * opkg_install_cmd: Cannot install package aliyundrive-fuse.

阿里云盘 FUSE,访问速度太慢

网络下载速度能达到50M/s,先使用的aliyundrive-webdav,用PotPlayer进行播放的话,速度稳定在20几M/s的样子,拖动进度条快进的话,基本不卡。但是,平时用Jellyfin,所以又转到aliyundrive-fuse。用fuse的话,播放速度最多只有10M/s出头的样子,拖动进度条观看的话,就会卡很长时间了。

希望fuse挂载阿里云盘,能增加写的功能,整理阿里云盘时,经常要用到批量重命名的功能,复制、移动、删除等操作,也很频繁。

报错 error sending request for url (https://websv.aliyundrive.com/token/refresh)

WARN aliyundrive_fuse::drive: refresh token failed, will wait and retry error=error sending request for url (https://websv.aliyundrive.com/token/refresh): error trying to connect: dns error: failed to lookup address information: Try again
但是实际DNS是没问题的
ping -a websv.aliyundrive.com
PING websv.aliyundrive.com (101.200.125.2) 56(84) bytes of data.
64 bytes from 101.200.125.2: icmp_seq=1 ttl=91 time=50.2 ms
64 bytes from 101.200.125.2: icmp_seq=2 ttl=91 time=58.3 ms
64 bytes from 101.200.125.2: icmp_seq=3 ttl=91 time=131 ms
64 bytes from 101.200.125.2: icmp_seq=4 ttl=91 time=59.2 ms
64 bytes from 101.200.125.2: icmp_seq=5 ttl=91 time=60.8 ms
64 bytes from 101.200.125.2: icmp_seq=6 ttl=91 time=52.6 ms
64 bytes from 101.200.125.2: icmp_seq=7 ttl=91 time=59.8 ms
^C
--- websv.aliyundrive.com ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6010ms
rtt min/avg/max/mdev = 50.228/67.470/131.130/26.250 ms

Docker安装方式

想问一下docker版需要怎么安装(messense/aliyundrive-fuse)?不清楚需要这么挂载路径。

docker安装

docker composs

-v /mnt/user/appdata/aliyun/ /var/run/aliyundrive-fuse
-e REFRESH_TOKEN *************


�[2m2022-05-25T02:09:53.679405Z�[0m �[32m INFO�[0m �[2maliyundrive_fuse::drive�[0m�[2m:�[0m found default drive �[3mdrive_id�[0m�[2m=�[0m1926120
Error: fusermount3: fuse device not found, try 'modprobe fuse' first

docker停止了

initialize aliyundrive client failed

aliyundrive-fuse -r xxxxxxxxxxx -w /etc/aliyundrive-fuse /mnt/aliyundrive
2022-04-12T12:06:50.516894Z ERROR aliyundrive_fuse::drive: refresh token failed: HTTP status client error (400 Bad Request) for url (https://websv.aliyundrive.com/token/refresh): {"code":"InvalidParameter.ClientId","message":"The input parameter client_id is not valid. ","requestId":null}
Error: initialize aliyundrive client failed

请问这是缺依赖吗?

root@aml-s812:~# pip install aliyundrive-fuse
Collecting aliyundrive-fuse
  Using cached https://files.pythonhosted.org/packages/89/36/67d3b64705ddfaba468a168d66f54c61e7bc154e434bbe40a1504edff6ae/aliyundrive_fuse-0.1.10.tar.gz
  Installing build dependencies ... error
  Complete output from command /usr/bin/python -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-U3cnfr --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- maturin>=0.12,<0.13:
  Collecting maturin<0.13,>=0.12
    Could not find a version that satisfies the requirement maturin<0.13,>=0.12 (from versions: 0.7.1b1, 0.7.1b2, 0.7.1, 0.7.2, 0.7.6, 0.11.0b1, 0.11.0b2, 0.11.0b3, 0.11.0b4, 0.11.0b5, 0.11.0, 0.11.2, 0.11.3b3, 0.11.4b4, 0.11.4)
  No matching distribution found for maturin<0.13,>=0.12
  
  ----------------------------------------
Command "/usr/bin/python -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-U3cnfr --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- maturin>=0.12,<0.13" failed with error code 1 in None
root@aml-s812:~# 

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.