forked from sdvcrx/pan-baidu-download
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bddown_help.py
92 lines (65 loc) · 2.34 KB
/
bddown_help.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env python2
# coding=utf-8
basic_command = [
('help', 'Show this help'),
('login', 'Login using Baidu account'),
('download', 'Download file from the Baidu netdisk link'),
('show', 'Show the Baidu netdisk real link and filename'),
('export', 'export link to aria2 json-rpc'),
('config', 'save configuration to file')
]
extended_usage = ''
def join_commands(command):
n = max(len(x[0]) for x in command)
n = max(n, 10)
return ''.join(' %%-%ds %%s\n' % n % (h, k) for (h, k) in basic_command)
basic_usage = '''python bddown_cli.py <command> [<args>]
Basic commands:
''' + join_commands(basic_command)
def usage():
return basic_usage + '''
Use 'python bddown_cli.py help' for details
Use 'python bddown_cli.py help <command>' for more information on a specific command.
Check https://github.com/banbanchs/pan-baidu-download for details'''
def show_help():
return ''' Python script for Baidu netdisk
Basic usage:
''' + basic_usage + extended_usage + '\n'
login = '''python bddown_cli.py login [username] [password]
Baidu login.
Example:
python bddown_cli.py login XXXXX 123456
python bddown_cli.py login [email protected] 123456
'''
download = '''python bddown_cli.py download [options] [Baidupan-url]...
Download file from the Baidu netdisk link
Options:
--limit=[speed] Max download speed limit.
--dir=[dir] Download task to dir.
--secret=[string] Retrieval password'''
show = '''python bddown_cli.py show [Baidupan-url]...
Show the real download link and filename
Example:
python bddown_cli.py show http://pan.baidu.com/s/15lliC
'''
export = '''python bddown_cli.py export [Baidupan-url]...
export link to aria2 json-rpc
Example:
python bddown_cli.py show http://pan.baidu.com/s/15lliC
'''
config = '''python bddown_cli.py config key [value]
save configuration to config.ini
Examples:
python bddown_cli.py config
python bddown_cli.py config username XXXXX
python bddown_cli.py config password 123456
python bddown_cli.py config limit 500k
python bddown_cli.py config dir /home/john/Downloads
python bddown_cli.py config delete dir
'''
help_help = '''Get helps:
python bddown_cli.py help help
python bddown_cli.py help download
python bddown_cli.py help show
python bddown_cli.py help <command>'''
help = help_help