-
Notifications
You must be signed in to change notification settings - Fork 1
/
web_down.py
82 lines (74 loc) · 1.7 KB
/
web_down.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
#-*- coding:utf-8 -*-
import os
import shutil
import time
from ugirl_1 import ugirl
from beauty3_1 import beauty3
from beauty5_1 import beauty5
from wechat_up import up_pub_try
from com_anti_800_1200 import com
from qn_up import up_pub
from cut_uped import cut_uped
def delete_uped():
file_name = os.listdir(os.getcwd())
for fn in file_name:
if os.path.isdir(fn):
shutil.rmtree(fn)
def alter_pub(num):
open('pub.txt','w').write(num)
def alter_next():
fr = open('next.txt','r')
num_str = fr.read()
fr.close()
next_num_str = str(int(num_str)+1)
fw = open('next.txt','w')
fw.write(next_num_str)
fw.close()
def down_test():
file_name = os.listdir(os.getcwd())
for fn in file_name:
if os.path.isdir(fn):
return 1
return 0
def pub_test():
return int(open('pub.txt','r').read())
def main():
#umei.cc
if pub_test() == 0:
try:
beauty3()
except:
f = open('error_log.txt','a')
f.write('beauty3 error ' + time.strftime('%Y.%m.%d %H:%M:%S',time.localtime(time.time())) + '\n')
f.close()
#测试是否下载成功
if down_test() == 1:
#下载成功后压缩
#com()
#压缩过后就可以调用qn_up上传
up_pub()
if up_pub_try() == 1:
alter_next()
alter_pub('1')
cut_uped('D:\\professor')
return 'S'
#beautylegmm.com
if pub_test() == 0:
try:
beauty5()
except:
f = open('error_log.txt','a')
f.write('beauty5 error ' + time.strftime('%Y.%m.%d %H:%M:%S',time.localtime(time.time())) + '\n')
f.close()
if down_test() == 1:
#下载成功后压缩
#com()
#压缩过后就可以调用qn_up上传
up_pub()
if up_pub_try() == 1:
alter_next()
alter_pub('1')
cut_uped('D:\\professor')
return 'S'
if __name__=='__main__':
main()