File size: 957 Bytes
063b4bb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import time
import sys

from modules.sources.thichtruyen import ThichTruyen
from modules import untils
from modules.sources import system_status
from modules import g_config, logger


if __name__ == '__main__':
    while True:
        logger.info("Starting program")

        if g_config.USE_SELENIUM:
            untils.close_all_chrome_browsers()
            untils.tear_down_python_scripts()

        thich_truyen = ThichTruyen()

        try:
            thich_truyen.selenium_upload_custom_task()
            thich_truyen.get_list_manga_newest()
        except KeyboardInterrupt:
            logger.warning("Stop manual")

            if g_config.USE_SELENIUM:
                untils.close_all_chrome_browsers()
            sys.exit()
        except:
            if g_config.USE_SELENIUM:
                untils.close_all_chrome_browsers()
            sys.exit()

        if system_status["error"]:
            logger.error("System error - restarting")