/
island_collection.py
49 lines (39 loc) · 1.08 KB
/
island_collection.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
import time
__author__ = 'zz'
from core.engine import Engine
def shell_main():
print("""
输入 url, 响应数, 最大搜索页数, 空格隔开, 回车结束一次输入
比如\n
http://h.nimingban.com/f/%E7%BB%BC%E5%90%88%E7%89%881 20 10\n
连续两次回车开始程序
""")
tasks = []
while True:
ip = input()
if not ip:
break
url, response_gt, max_page = ip.split()
tasks.append({
'url': url,
'response_gt': int(response_gt),
'max_page': int(max_page),
})
engine = Engine()
engine.set_init_tasks(tasks)
engine.start()
print('-----------Engine Start----------')
while engine.is_running:
rs = engine.get_one_result()
if not rs:
time.sleep(0.5)
continue
print(rs.link, 'image', rs.image_url or 'None')
print(rs.text)
print('-'*40)
print('------------Engine Stop---------------')
def main():
from gui.main import root
root.mainloop()
if __name__ == '__main__':
main()