linux 使用 GDriveFS 挂载无限容量 GoogleDrive

本贴最后更新于 2400 天前,其中的信息可能已经斗转星移

准备:国外 vps(10 刀/year,1G-20g-kvm-centos7.3),edu 邮箱的 google 无限容量网盘
ceac81dad30b4166b280579fc48c5c7a-TIM20170907180342.png

注意事项:GDriveFS是Python 2.7开发的,需要你安装Python2.7以上版本

解决方案:
http://blog.csdn.net/jcjc918/article/details/11022345
https://blog.fazero.me/2016/10/13/centos-update-python

安装 fuse

64 位:sudo yum install fuse-devel.x86_64 fuse.x86_64
32 位:sudo yum install fuse-devel.i686 fuse.i686
486bd7bc665244d4a02ed13a620a5f0e-TIM20170907182910.png

安装 gdrivefs: pip install gdrivefs

pip 是 python 的包管理工具请先安装它

出现[pip: command not found]解决方案:

  1. 安装 epel 源:yum -y install epel-release
    fc261368a5e249108570a7b75b84a295-TIM20170907185815.png
  2. 安装 pip:yum -y install python-pip
    f0fcca1677cf4f9290bcba934a08abec-TIM20170907185945.png
  3. 清理一下缓存:yum clean all
    6288922bd4d64994b2af14792d5730ad-TIM20170907190022.png

出现提示【You should consider upgrading via the 'pip install --upgrade pip' command.】,解决方案、

升级 pip:pip install --upgrade pip

出现出现错误【error: command 'gcc' failed with exit status 1】,解决方案

0d747589beab42f9ac2ee15de74bfbda-TIM20170907190158.png

安装各种组件:
yum -y install gcc gcc-c++ kernel-devel
yum -y install python-devel libxslt-devel libffi-devel openssl-devel

安装完成

9631900b351b4e7b92d7168f375473ee-TIM20170907190644.png

运行得到认证接口

shell:gdfstool auth -u
83d76d2172874fb2b65f119cb21022b7-TIM20170907190901.png

拷贝你终端出现网址到浏览器,会出现授权页面

google 邮箱登录授权后,得到授权码:
ef8da672f8c643b4ae97f16f2870270c-TIM20170907191200.png

linux 认证

shell:gdfstool auth -a /var/cache/gdfs.creds "你的授权码"
423e6a0f52134641b0d509141ad218f0-TIM20170907191551.png

认证 ok,出现【Authorization code recorded.】

9034a0b46963491f910ae2cdb84cd544-TIM20170907191627.png

挂载网盘

新建目录:mkdir /mnt/gdrivefs
网盘挂载到目录:gdfstool mount /var/cache/gdfs.creds /mnt/gdrivefs

8e3c50d791e148d4914dda0f3910616d-TIM20170907191827.png

然后就可以把网盘当磁盘用了

3b84dbf57b914b27a646e853b92a77ee-TIM20170907192125.png

log

fuse: device not found, try 'modprobe fuse' first  
Traceback (most recent call last):  
File "/usr/local/bin/gdfstool", line 125, in  
main()  
File "/usr/local/bin/gdfstool", line 120, in main  
\_handle\_mountpoint(args)  
File "/usr/local/bin/gdfstool", line 72, in \_handle\_mountpoint  
option\_string=option\_string)  
File "/usr/local/lib/python2.7/dist-packages/gdrivefs/gdfs/gdfuse.py", line 872, in mount  
**fuse_opts)  
File "/usr/local/lib/python2.7/dist-packages/fuse.py", line 399, in **init**  
raise RuntimeError(err)  
RuntimeError: 1  

基本是内核和fuse版本冲突,升级内核即可,openvz不支持改内核

log

httplib2.SSLHandshakeError: \[SSL: CERTIFICATE\_VERIFY\_FAILED\] certificate verify failed (_ssl.c:579)```
`请pip升级httplib2`
==========================end======================







  • Linux

    Linux 是一套免费使用和自由传播的类 Unix 操作系统,是一个基于 POSIX 和 Unix 的多用户、多任务、支持多线程和多 CPU 的操作系统。它能运行主要的 Unix 工具软件、应用程序和网络协议,并支持 32 位和 64 位硬件。Linux 继承了 Unix 以网络为核心的设计思想,是一个性能稳定的多用户网络操作系统。

    944 引用 • 943 回帖
  • Google

    Google(Google Inc.,NASDAQ:GOOG)是一家美国上市公司(公有股份公司),于 1998 年 9 月 7 日以私有股份公司的形式创立,设计并管理一个互联网搜索引擎。Google 公司的总部称作“Googleplex”,它位于加利福尼亚山景城。Google 目前被公认为是全球规模最大的搜索引擎,它提供了简单易用的免费服务。不作恶(Don't be evil)是谷歌公司的一项非正式的公司口号。

    49 引用 • 192 回帖
  • edu
    1 引用 • 26 回帖
  • Python

    Python 是一种面向对象、直译式电脑编程语言,具有近二十年的发展历史,成熟且稳定。它包含了一组完善而且容易理解的标准库,能够轻松完成很多常见的任务。它的语法简捷和清晰,尽量使用无异义的英语单词,与其它大多数程序设计语言使用大括号不一样,它使用缩进来定义语句块。

    543 引用 • 672 回帖 • 1 关注

相关帖子

欢迎来到这里!

我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。

注册 关于
请输入回帖内容 ...
  • alanfans
    作者

    你确定是 google sb?

  • 其他回帖
  • kaylove

    Traceback (most recent call last):
    File "/usr/bin/gdfstool", line 125, in
    main()
    File "/usr/bin/gdfstool", line 120, in main
    _handle_mountpoint(args)
    File "/usr/bin/gdfstool", line 72, in _handle_mountpoint
    option_string=option_string)
    File "/usr/lib/python2.7/site-packages/gdrivefs/gdfs/gdfuse.py", line 863, in mount
    gdrivefs.gdtool.account_info.AccountInfo().get_data()
    File "/usr/lib/python2.7/site-packages/gdrivefs/gdtool/account_info.py", line 19, in get_data
    return gd.get_about_info()
    File "/usr/lib/python2.7/site-packages/gdrivefs/gdtool/drive.py", line 56, in wrapper
    return f(*args, **kwargs)
    File "/usr/lib/python2.7/site-packages/gdrivefs/gdtool/drive.py", line 190, in get_about_info
    client = self.__auth.get_client()
    File "/usr/lib/python2.7/site-packages/gdrivefs/gdtool/drive.py", line 152, in get_client
    discoveryServiceUrl=discoveryUrl)
    File "/usr/lib/python2.7/site-packages/oauth2client/util.py", line 132, in positional_wrapper
    return wrapped(*args, **kwargs)
    File "/usr/lib/python2.7/site-packages/apiclient/discovery.py", line 192, in build
    resp, content = http.request(requested_url)
    File "/usr/lib/python2.7/site-packages/oauth2client/util.py", line 132, in positional_wrapper
    return wrapped(*args, **kwargs)
    File "/usr/lib/python2.7/site-packages/oauth2client/client.py", line 490, in new_request

  • kaylove

    redirections, connection_type)
    File "/usr/lib/python2.7/site-packages/httplib2/init.py", line 1570, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
    File "/usr/lib/python2.7/site-packages/httplib2/init.py", line 1317, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
    File "/usr/lib/python2.7/site-packages/httplib2/init.py", line 1252, in _conn_request
    conn.connect()
    File "/usr/lib/python2.7/site-packages/httplib2/init.py", line 1044, in connect
    raise SSLHandshakeError(e)
    httplib2.SSLHandshakeError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)
    我也是卡到最后一步,内核老?

    1 回复
  • langshiwu

    ssl 的错误参考:

    Traceback (most recent call last):

    File "/usr/bin/gdfstool", line 125, in

    main()
    

    File "/usr/bin/gdfstool", line 118, in main
    _handle_auth(args)
    File "/usr/bin/gdfstool", line 56, in _handle_auth
    _handle_auth_store(*args.auth)
    File "/usr/bin/gdfstool", line 50, in _handle_auth_store
    authorize.step2_doexchange(authcode)
    File "/usr/local/python27/lib/python2.7/site-packages/gdrivefs/gdtool/oauth_authorize.py", line 143, in step2_doexchange
    raise AuthorizationFailureError(message)
    gdrivefs.errors.AuthorizationFailureError: Could not do auth-exchange (this was either a legitimate error, or the auth-exchange was attempted when not necessary): [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)

    错误时 httplib2 的版本

    [root@host bin]# pip install httplib2

    Requirement already satisfied: httplib2 in /usr/local/python27/lib/python2.7/site-packages (0.8)

    升级后
    imagepng

    最后完满解决了。

    1 回复
  • 查看全部回帖