Package: pyBaiduPan
PyBaiduPanA python client for Baidu Pan to download, upload, and sync files.  Mainly design to use on NAS.Featurerecurse download/uploadbypass 50M download limitation using app_idresume downloading from the breakpointrapid uploaddirectory syncretry on failuresuse a newer version ofbaidu pan APIRequirementspython3 (>=3.6)Installationpip install pyBaiduPanGet StartedBdPan [action] [pan_path] [local_path]actionavailable actions: list, download, upload, sync, logout. (default: "list")actiondescriptionlistlist files and directories in the pan_path.downloaddownload all files and directories in the pan_path to local_path.uploadupload all files and directories in the local_path to pan_path.synclocal_path and pan_path sync to each other.logoutdelete all credentials.pan_pathabsolute path in Baidu Pan, which can be file or directory.local_pathlocal path, which can be file or directory.First Time UseNeed to go to http://{host}:{port} (default:http://127.0.0.1:25000) to login your baidu account.BdPanSet host and port using -H and -P option.BdPan -H 0.0.0.0 -P 8080If your account require a security verification, please do it on pan.baidu.com and try again.This is a known issue, and will be fix later.Listlist files and directories in the path.BdPan list /testresult:D   0.0B folder_1
F 120.9K IMG_20151105_182551_1448110780674.jpg
F   1.2M 07-03-15 19.49.06.png
F   1.3M 07-03-15 19.49.00.png
F   1.2M 07-03-15 19.48.44.png
F   1.2M 07-03-15 19.48.24.pngDownloaddownload FileBdPan download "/test/07-03-15 19.48.24.png"download directoryBdPan download /testdownload to specify pathBdPan download /test <local-path>Uploadupload fileBdPan upload /test 1.txtupload file and renameBdPan upload /test/2.txt 1.txtupload directoryBdPan upload /test <local-directory>Syncsync two directoryBdPan sync /test test_foldersync action has the same effect as following commands:BdPan download /test test_folder
BdPan upload /test test_folderuse -o mtime option to overwrite old files:BdPan sync /test test_folder -o mtimesync upBdPan upload /test test_folder -o mtime -dthis command will make sure /test is same as test_folder.sync downBdPan download /test test_folder -o mtime -dthis command will make sure test_folder is same as /test.UsageOverwrite-o/--overwrite <mode>overwrite option can use with upload/download/sync.BdPan upload /test 1.txt -o mtimewarning: this option may lead topermanentfile loss. use it with caution.modeavailable mode: none, mtime, force. (default: "none")modedescriptionnonenever overwrite.mtimeoverwrite when a newer version of file(base on last modify time) is found.forcealways overwrite.Delete Extradelete all extra files and directories in dst_path(pan_path for upload, local_path for download).this option will make sure that dst_path is same as src_path.-d/--delete-extradelete extra option can use with upload/download.warning: this option may lead topermanentfile loss. use it with caution.Full Usageusage: BdPan.exe [-h] [-p LOCAL_PATH] [-b PAN_PATH] [-c CONF] [-s SESSION] [-H HOST] [-P PORT] [-a APP_ID]
                 [-o {none,mtime,force}] [-l LOG_FILE] [-d]
                 [action] [pan_path] [local_path]

 a Python client for Baidu Pan.

positional arguments:
  action                available actions: list, download, upload, sync, logout. (default: "list")
                        list            list files and directories in the pan_path.
                        download        download all files and directories in the pan_path to local_path.
                        upload          upload all files and directories in the local_path to pan_path.
                        sync            local_path and pan_path sync to each other.
                        logout          delete all credentials.
  pan_path              absolute path in Baidu Pan, which can be file or directory.
  local_path            local path, which can be file or directory.

optional arguments:
  -h, --help            show this help message and exit
  -p LOCAL_PATH, --local-path LOCAL_PATH
                        an alias of local_path. (default: ".")
  -b PAN_PATH, --pan-path PAN_PATH
                        an alias of pan_path. (default: "/")
  -c CONF, --conf CONF  the path of config file.
  -s SESSION, --session SESSION
                        the path to save session information.
  -H HOST, --host HOST  the host login server bind to. (default: "127.0.0.1")
  -P PORT, --port PORT  the port for login server. (default: 25000)
  -a APP_ID, --app-id APP_ID
                        baidu app id. recommended IDs: 498065, 309847, 778750, 250528(official), 265486, 266719. Some of them can bypass 50M download limitation.
  -o {none,mtime,force}, --overwrite {none,mtime,force}
                        none    never overwrite
                        mtime   overwrite when a newer version of file(base on last modify time) is found.
                        force   always overwrite.
  -l LOG_FILE, --log-file LOG_FILE
                        specify where to save log.
  -d, --delete-extra    delete all extra files and directories in dst_path. do NOT use this option unless you know exactly what you are doing.Use in other python programfrompyBaiduPanimportBdPanpan=BdPan()pan.config['app_id']=250528# change some configurationpan.login('your_username','your_password')# loginpan.download('/test/1.jpg','./download')# downloadpan.upload('./backup','/test',overwrite='mtime',delete_extra=True)# sync up# ... or other class methods of BdPanTODO Listuploadsyncbetter exception handlingmulti-thread downloadrobust requestproxytests