-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathapp.py
27 lines (20 loc) · 790 Bytes
/
app.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
"""Main module for the ZDF Downloader."""
import time
import schedule
import logging
from zdf_download import ZDFDownload
from configuration import Configuration, load_configuration_from_yaml
from history import History
def main() -> None:
config: Configuration = load_configuration_from_yaml("configuration/configuration.yaml")
history: History = History("configuration/history.yaml")
zdf_downloader: ZDFDownload = ZDFDownload(history=history, config=config)
log = logging.getLogger("zdf-download")
log.info("launching application")
schedule.every(config.interval).minutes.do(zdf_downloader.check_all_shows, shows=config.shows)
schedule.run_all()
while True:
schedule.run_pending()
time.sleep(1)
if __name__ == '__main__':
main()