forked from nfe-w/bili_dynamic_push
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
35 lines (31 loc) · 1.22 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
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# @Time: 2021/3/24 19:11
import time
from config import global_config
from query_bili import query_dynamic
from query_bili import query_live_status
from logger import logger
if __name__ == '__main__':
enable_dynamic_push = global_config.get_raw('config', 'enable_dynamic_push')
enable_living_push = global_config.get_raw('config', 'enable_living_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:
for _ in uid_list:
if enable_dynamic_push == 'true':
query_dynamic(_)
if enable_living_push == 'true':
query_live_status(_)
time.sleep(intervals_second)