-
Notifications
You must be signed in to change notification settings - Fork 38
/
main.py
50 lines (43 loc) · 1.15 KB
/
main.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
# -*- coding: utf8 -*-
"""
main.py
360yunpan - 360YunPan Command-line tools, support: Linux Mac Windows
Licensed under the MIT license:
http://www.opensource.org/licenses/mit-license.php
Project home:
https://github.com/logbird/360yunpan
Version: 1.0.0
@Author [email protected]
"""
import sys
import urllib
import urllib2
import cookielib
import time
import random
import hashlib
import json
import re
import os
reload(sys)
sys.setdefaultencoding("utf-8")
import utilsYunPan
from loginYunPan import loginYunPan
from dirYunPan import dirYunPan
from downloadYunPan import downloadYunPan
from downloadYunPan import downloadManager
if __name__ == '__main__':
login = loginYunPan()
userinfo = login.run('username', 'password')
# 本地文件目录
pathYunPan = '/data/local/'
dir = dirYunPan(pathYunPan)
# 需要下载的云盘路径
tree = dir.downloadDirTree('/app/', True)
downloadManager.pushQueue(tree)
# 设置线程数
downloadManager.start(dir, 10)
# 离线下载
#result = dir.offlineDownload("http://todeer.sinaapp.com/include/lib/js/common_tpl.js");
# 获取离线下载列表
#result = dir.offlineList();