Install the Python client of Baidu cloud/Baidu Network Disk on CentOS
The centos 6.5python version is 2.6. We need to install python2.7 first.
1. Install sqlite-devel
#yuminstallsqlite-devel-y
2. Install Python2.7
#wgethttps://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz
#tarxfPython-2.7.8.tgz
#cdPython-2.7.8
#./configure--prefix=/usr/local
#make&&makeinstall
Pip2.7 install Python client on Baidu cloud/Baidu Network Disk
1. Install pip2.7
#wget
#/usr/local/bin/python2.7get-pip.py
2. Install the Python client of Baidu cloud/Baidu online Disk
#pip2.7installbypy
In this way, the Python client of Baidu cloud/Baidu online disk under linux is installed.
The first practical application will perform authentication and authorization, as shown below:
#bypyinfo
Pleasevisit:
https:
//openapi
.baidu.com
/oauth/2
.0
/authorize
?scope=basic+netdisk&redirect_uri=oob&response_type=code&client_id=q8WE4EpCsau1oS0MplgMKNBn
Andauthorizethisapp
PastetheAuthorizationCodeherewithin10minutes.
Press[Enter]whenyouare
done
Open the link in the browser, enter the verification code, and press enter to complete the authorization. The corresponding network disk directory
Baidu online storage --> my application data --> bypy
Other usage:
To learn more about a command:
#bypyhelp<command>
The file list is displayed in the root directory of the cloud disk (Program:
#bypylist
Synchronize the current directory to the cloud Disk:
#bypysyncup
Or
#bypyupload
Synchronize the cloud disk content to the local disk:
#bypysyncdown
Or
#bypydowndir/
Compare the current local directory and the root directory of the cloud disk (Program) (I think it is very useful ):
#bypycompare