在linux中安装BYPY来下载上传百度网盘文件

在linux下传文件是比较麻烦的一件事情,今天就利用python版的百度云盘/百度网盘在linux下玩耍

进行文件列表、下载、上传、比较、向上同步、向下同步,等操作

Github地址:https://github.com/houtianze/bypy

 

安装pip:

#CentOS 6.x 32位

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
yum install -y python-pip

#CentOS 6.x 64位

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install -y python-pip

#CentOS 7.x

yum install -y epel-release
yum install -y python-pip

#如果CentOS 7安装出现No package python-pip available,可以用以下命令进行安装

wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py

#Debian/Ubuntu系统

apt-get -y update
apt-get -y install python-pip

安装pip3:

#CentOS系统

wget –no-check-certificate https://www.moerats.com/usr/shell/Python3/CentOS_Python3.6.sh && sh CentOS_Python3.6.sh

#Debian系统

wget –no-check-certificate https://www.moerats.com/usr/shell/Python3/Debian_Python3.6.sh && sh Debian_Python3.6.sh

然后安装的时候还报错了ERROR: The certificate of `www.moerats.com’ is not trusted.”

不得不用另外一条命令

apt-get install ca-certificates -y #Debian/Ubuntu

yum install ca-certificates -y #CentOS

#查看是否安装成功

pip3 -V

安装bypy

#pip安装

pip install bypy

#pip3安装

pip3 install bypy

等安装好之后,我们开始授权

执行命令

bypy info

然后会给一个链接,用浏览器打开,将授权码复制过来回车

以下是执行结果

root@:~# bypy info

Baidu PCS currently gives totally WRONG MD5 hash for remote files, and I AM NOT GOING TO ADAPT TO IT!
So it if doesn’t work, install version ‘1.6.10’ using the following command:
pip install bypy==1.6.10
Version 1.6.10 has a workaround for this.
### Seeking maintainer fo this `bypy` project, if you are interested, please create an issue at github, thanks. ###
—————————————————————-

Please visit:
https://openapi.baidu.com/o1uth/2.0/a2thorize?client_id=q8WE4EpCsau1oS0MplgMKNBn&response_type=code&redirect_uri=oob&scope=basic+netdisk
And authorize this app
Paste the Authorization Code here within 10 minutes.
Press [Enter] when you are done
028b67251f30e649a29f9dd0acf6fbd4
Authorizing, please be patient, it may take upto 300 seconds…
Authorizing with the Heroku server …
Heroku server failed, authorizing with the Heroku1 server …
Successfully authorized
Quota: 5.007TB
Used: 1.215TB

—————————————————————-

常用命令
显示文件列表:

bypy list

比较当前目录和网站根目录文件:

bypy compare

上传单个文件的命令如下:

bypy upload 文件名

把当前目录上传到云盘:

bypy syncup 目录地址

bypy upload 目录地址

下载单个文件的命令如下:

bypy downfile 下载文件名

把云盘内容下载到本地来:

bypy syncdown 目录地址

bypy downdir 目录地址

详细解释请运行bypy命令

上一篇 百度网盘新神器KinhDown不限速下载加速永无止境
下一篇 windows10电脑访问共享资源提示错误信息,你可能没有权限使用网络资源……的解决办法

投稿邮箱:
ivpsr888@gmail.com (投稿详情)

TG订阅频道:
t.me/ivpsr_news 网站最新内容推送

TG交流群:
(点击加入) 用户交流

文章列表
1
斯洛伐克电信即将关闭3G网络
斯洛伐克电信即将关闭3G网络
2
TudCloud:2022情人节特惠折扣/全场8折终生/年付7折终生特惠!!!
TudCloud:2022情人节特惠折扣/全场8折终生/年付7折终生特惠!!!
3
RAKsmart:9月活动VPS全场5折,新注册送$10,RAK Cloud低至3折,更有特惠产品 $30秒杀 !!!
RAKsmart:9月活动VPS全场5折,新注册送$10,RAK Cloud低至3折,更有特惠产品 $30秒杀 !!!
4
摄影爱好者的读物《一本摄影书》(全彩)PDF分享 1.21G
摄影爱好者的读物《一本摄影书》(全彩)PDF分享 1.21G
5
ReliableSite美国独立服务器|$19/月起1~10Gbps不限流量,纽约/迈阿密/洛杉矶等多机房可选
ReliableSite美国独立服务器|$19/月起1~10Gbps不限流量,纽约/迈阿密/洛杉矶等多机房可选
6
教你刷新win系统DNS缓存加速访问新服务器
教你刷新win系统DNS缓存加速访问新服务器
7
datapasa德国VPS低至$1.61/月,搭载AMD Ryzen高性能平台
datapasa德国VPS低至$1.61/月,搭载AMD Ryzen高性能平台
8
IDCloudHost:#双12特别优惠#印度尼西亚VPS,75折优惠,充值送账号余额,原生IP解锁奈飞
IDCloudHost:#双12特别优惠#印度尼西亚VPS,75折优惠,充值送账号余额,原生IP解锁奈飞
9
justhost年中大促,最高 45% 折扣、美国、香港、日本等十五处机房、不限流量、免费一键更换IP
justhost年中大促,最高 45% 折扣、美国、香港、日本等十五处机房、不限流量、免费一键更换IP
10
hhost香港VPS特惠低至$25/年起,2核4G、30G SSD、200M带宽、500G流量
hhost香港VPS特惠低至$25/年起,2核4G、30G SSD、200M带宽、500G流量