前言
项目页面:https://github.com/dsoprea/GDriveFS
安装 GDriveFS
1 2 3 |
sudo apt-get install python-pip sudo apt-get install build-essential python-dev sudo pip install gdrivefs |
安装成功显示Successfully
1 2 3 |
Successfully installed gdrivefs fusepy gevent gipc google-api-python-client greenlet httplib2 python-dateutil six Cleaning up... @ubuntu:~$ |
使用 gdfstool auth -u 命令获取 Google Drive API 授权URL地址
1 2 3 4 |
@ubuntu:~$ gdfstool auth -u To authorize FUSE to use your Google Drive account, visit the following URL to produce an authorization code: https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.file&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&client_id=105681.apps.googleusercontent.com&access_type=offline |
将允许后获得的登录授权码保存为文件
gdfstool auth -a /var/cache/gdfs.creds "xxxxx"
1 2 3 4 5 6 |
@ubuntu:~$ pwd //获取当前目录 /home/用户 gdfstool auth -a /home/用户/gdfs.creds "4/nIpgBHM6ml8DbV02ZUOaXIGLsPO4HGl7NBxxxxx" Authorization code recorded.//授权码已记录 |
注意需要使用目录权限运行,不要保存在没有权限的目录,否则会出错:
1 2 3 4 5 6 7 8 9 10 11 |
@ubuntu:~$ gdfstool auth -a /var/cache/gdfs.creds "4/nIpgBHM6ml8DbV02ZUOaXIGLsPO4HGl7NBxxxxx" Traceback (most recent call last): File "/usr/local/bin/gdfstool", line 125, in <module> main() File "/usr/local/bin/gdfstool", line 118, in main _handle_auth(args) File "/usr/local/bin/gdfstool", line 56, in _handle_auth _handle_auth_store(*args.auth) File "/usr/local/bin/gdfstool", line 44, in _handle_auth_store with open(auth_storage_filepath, 'w'): IOError: [Errno 13] Permission denied: '/var/cache/gdfs.creds' //错误:无权限 |
挂载Google Drive:
1 2 |
mkdir /home/用户/gdrivefs gdfstool mount /home/用户/gdfs.creds /home/用户/gdrivefs |
查看是否成功:
1 2 3 4 5 6 7 8 9 10 |
@ubuntu:~/gdrive$ df -lh Filesystem Size Used Avail Use% Mounted on udev 486M 8.0K 486M 1% /dev tmpfs 100M 364K 99M 1% /run /dev/sda1 985G 4.6G 981G 1% / none 4.0K 0 4.0K 0% /sys/fs/cgroup none 5.0M 0 5.0M 0% /run/lock none 497M 0 497M 0% /run/shm none 100M 0 100M 0% /run/user gdfs(/home/用户/gdfs.creds) 12T 1.3T 10T 12% /home/用户/gdrive |
关于Rtorrent下载到GD盘的尝试:
添加本地硬盘没事,添加到gd盘则rtorrent超时,还是使用transmission配合使用GD会比rtorrent好点,其实windows最好:
辅助测试也会导致rTorrent超时: