55 lines
1.0 KiB
Python
55 lines
1.0 KiB
Python
#!/usr/bin/env python3
|
|
|
|
"""
|
|
Author: Clemens Schwaighofer
|
|
Date: 2023/9/6
|
|
Description: download pgn files from pgnmentor.com
|
|
"""
|
|
|
|
# MARK:TOP
|
|
|
|
import requests
|
|
import configparser
|
|
|
|
|
|
class Config:
|
|
"""
|
|
folder locations and settings
|
|
"""
|
|
|
|
def __init__(self):
|
|
self.base_folder: str = ""
|
|
self.temp: str = "temp"
|
|
self.data: str = "data"
|
|
self.download: str = "download"
|
|
self.last_download: str = "last_download.txt"
|
|
self.last_update: str = "last_update.txt"
|
|
|
|
self.url_base_file: str = "https://www.pgnmentor.com/files.html"
|
|
|
|
self.download_target_file: str = "[download][curent_date]/msater/files.html"
|
|
self.download_target_pgn: str = "[download][current_date]/pgn/"
|
|
|
|
|
|
class Init:
|
|
"""
|
|
init on run
|
|
- donwload file to temp
|
|
- check update diff
|
|
- run download and diff flow
|
|
"""
|
|
|
|
def __init__(self, config: Config):
|
|
self.conf = config
|
|
|
|
|
|
def main():
|
|
conf = Config()
|
|
|
|
print(f"BASE: {conf.base_folder}")
|
|
|
|
|
|
main()
|
|
|
|
# __END__
|