bypy is an API opened by Baidu Netdisk, which stores files under /apps/bypy/ in Baidu Netdisk, enabling the use of Baidu Netdisk for uploading and downloading.
It is located in the "My Application Data/bypy" folder.
# Installation of bypy#
Execute the command
pip install bypy
# Login#
Execute the command
bypy info
This will return a URL. Open this URL to obtain the verification code.
Enter the verification code into the command line. This way, bypy will obtain the permission to use Baidu Netdisk API.
You can now use bypy to manage the uploading and downloading of files in Baidu Netdisk.
Authorization only needs to be done once. Once successful, there will be no more authorization prompts in the future.
The access_token and refresh_token are saved in /~/.bypy/bypy.json.
# Usage#
## View command list#
bypy help list
## View all files (i.e., the /My Application Data/bypy folder in Netdisk)#
bypy list
## Upload files#
bypy syncup XXX
or
bypy upload XXX
If XXX is not added as the file name, the entire directory will be uploaded by default.
## Download#
Download a single file
bypy downfile XXX
Specify the path to download
bypy syncdown
or
bypy downdir /
The path after downdir is the local path.