-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
34 lines (29 loc) · 1.12 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
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# @Time: 2021/3/24 19:11
import time
from config import global_config
from logger import logger
from proxy import my_proxy
from query_xhs import query_dynamic
if __name__ == '__main__':
enable_dynamic_push = global_config.get_raw('config', 'enable_dynamic_push')
uid_list = global_config.get_raw('config', 'uid_list').split(',')
intervals_second = global_config.get_raw('config', 'intervals_second')
intervals_second = int(intervals_second)
begin_time = global_config.get_raw('config', 'begin_time')
end_time = global_config.get_raw('config', 'end_time')
if begin_time == '':
begin_time = '00:00'
if end_time == '':
end_time = '23:59'
logger.info('开始检测')
while True:
current_time = time.strftime("%H:%M", time.localtime(time.time()))
if begin_time <= current_time <= end_time:
my_proxy.current_proxy_ip = my_proxy.get_proxy()
for i in range(len(uid_list)):
if enable_dynamic_push == 'true':
query_dynamic(uid_list[i])
time.sleep(intervals_second)