ÁÂÁ¦U¦ìªº¤j¤OÀ°¦£¡A²×©ó¸Ñ¨M¤F¡C
root@bananas /baidu # python bypy.py
Token file: '/root/.bypy.json'
Hash Cache file: '/root/.bypy.pickle'
App root path at Baidu Yun '/apps/bypy'
sys.stdin.encoding = UTF-8
sys.stdout.encoding = UTF-8
----
usage: bypy.py [-h] [--TESTRUN] [--PROFILE] [-V] [-d] [-v] [-r RETRY]
[-q QUIT] [-t TIMEOUT] [-s SLICE] [--chunk CHUNK] [-e] [-f]
[-l LISTFILE] [--resume-download RESUMEDL]
[--include-regex INCREGEX] [--on-dup ONDUP] [--no-symlink] [-c]
[command [command ...]]
bypy -- Python client for Baidu Yun
Copyright 2013 Hou Tianze (GitHub: houtianze, Twitter: @ibic, G+: +TianzeHou)
Licensed under the GPLv3
https://www.gnu.org/licenses/gpl-3.0.txt
bypy is a Baidu Yun client written in Python (2.7).
(NOTE: You need to install the 'requests' library by running 'pip install requests')
It offers some file operations like: list, download, upload, syncup, syncdown, etc.
The main purpose is to utilize Baidu Yun in Linux environment (e.g. Raspberry Pi)
It uses a server for OAuth authorization, to conceal the Application's Secret Key.
Alternatively, you can create your own App at Baidu and replace the 'ApiKey' and 'SecretKey' with your copies,
and then, change 'ServerAuth' to 'False'
positional arguments:
command operations (quota / list)
optional arguments:
-h, --help show this help message and exit
--TESTRUN Perform python doctest [default: False]
--PROFILE Profile the code [default: False]
-V, --version show program's version number and exit
-d, --debug enable debugging & logging [default: 0]
-v, --verbose set verbosity level [default: 0]
-r RETRY, --retry RETRY
number of retry attempts on network error [default: 5
times]
-q QUIT, --quit-when-fail QUIT
quit when maximum number of retry failed [default:
False]
-t TIMEOUT, --timeout TIMEOUT
network timeout in seconds [default: 60]
-s SLICE, --slice SLICE
size of file upload slice (can use '1024', '2k',
'3MB', etc) [default: 20 MB]
--chunk CHUNK size of file download chunk (can use '1024', '2k',
'3MB', etc) [default: 20 MB]
-e, --verify Verify upload / download [default : False]
-f, --force-hash force file MD5 / CRC32 calculation instead of using
cached values [default: False]
-l LISTFILE, --list-file LISTFILE
input list file (used by some of the commands only
[default: None]
--resume-download RESUMEDL
resume instead of restarting when downloading if local
file already exists [default: True]
--include-regex INCREGEX
regular expression of files to include. if not
specified (default), everything is included. for
download, the regex applies to the remote files; for
upload, the regex applies to the local files. to
exclude files, think about your regex, some tips here:
https://stackoverflow.com/questions/406230/regular-
expression-to-match-string-not-containing-a-word
[default: ]
--on-dup ONDUP what to do when the same file / folder exists in the
destination: 'overwrite', 'skip', 'prompt' [default:
overwrite]
--no-symlink DON'T follow symbol links when uploading / syncing up
[default: True]
-c, --clean 1: clean settings (remove the token file) 2: clean
settings and hash cache [default: 0]
Commands:
help command - provide some information for the command
cleancache - remove invalid entries from hash cache file
combine <remotefile> [md5s] [localfile] - try to create a file at PCS by combining slices, having MD5s specified
compare [remotedir] [localdir] - compare the remote direcotry with the local directory
copy/cp <from> <to> - copy a file / dir remotely at Baidu Yun
delete/remove/rm <remotepath> - delete a file / dir remotely at Baidu Yun
downdir <remotedir> [localdir] - download a remote directory (recursively)
downfile <remotefile> [localpath] - download a remote file.
dumpcache - display file hash cache
list/ls [remotepath] [format] [sort] [order] - list the 'remotepath' directory at Baidu PCS
listrecycle [start] [limit] - list the recycle contents
meta <remotepath> [format] - get information of the given path (dir / file) at Baidu Yun.
mkdir <remotedir> - create a directory at Baidu Yun
move/mv/rename/ren <from> <to> - move a file / dir remotely at Baidu Yun
quota/info - displays the quota information
refreshtoken - refresh the access token
restore <remotepath> - restore a file from the recycle bin
search <keyword> [remotepath] [recursive] - search for a file using keyword at Baidu Yun
stream <remotefile> <localpipe> [format] [chunk] - stream a video / audio file converted to M3U format at cloud side, to a pipe.
syncdown [remotedir] [localdir] [deletelocal] - sync down from the remote direcotry to the local directory
syncup [localdir] [remotedir] [deleteremote] - sync up from the local direcotry to the remote directory
upload [localpath] [remotepath] [ondup] - upload a file or directory (recursively)
¥t¥~«e± /etc/hosts.deny ªº°ÝÃD¡A¬dªºµ²ªG¬O§Ṳ́½¥q¥Î¤G½uªºt¸ü¥¿Å¾¹ªºÃö«Y¡A©Ò¥H·|¦³¤GÓIP¡A¦Ó§Ú¥u³]¤@Ó¡A¥Ø«e¤GÓ³£³]ªºµ²ªG´N¨S°ÝÃD¤F¡A¤£¹Lùرªº»yªk¤£¯à¥Î 10.10.10.1/24¡A¥u¯à¥Î 10.10.10.* ¨Ó¨ú¥N¡C