container, podman pod

This commit is contained in:
2024-01-28 01:20:50 +01:00
parent bfca1d2e1f
commit fb968853b5
6 changed files with 43 additions and 5 deletions

View File

@ -34,7 +34,7 @@ def check_items(settings_items):
magnifier_image_regex = re.compile(r'<meta property=\"og:image\" content=\"(https:[0-9a-zA-Z\/\-\_.]*)\"\/>')
session = requests.Session()
cookies_file_path = './cookies.json'
cookies_file_path = os.path.dirname(os.path.realpath(__file__))+'/cookies.json'
cookies = load_cookies_from_file(cookies_file_path)
session.cookies.update(cookies)

View File

@ -11,8 +11,18 @@ def get_conf():
settings = yaml.safe_load(conf_file)
return settings
@app.route('/')
def hello_world():
@app.route('/init')
def init_db():
print("init")
settings = get_conf()
initialize(settings["db"])
return 'Hello, World!'
@app.route('/update')
def update_hist():
print("update")
settings = get_conf()
fill_db(settings["db"], check_items(settings["item"]))
return 'Hello, World!'
@app.route('/datahistory',methods = ['POST', 'GET'])

View File

@ -17,5 +17,5 @@ if __name__ == '__main__':
# initialize(settings["db"])
fill_db(settings["db"], check_items(settings["item"]))
export_csv(settings["db"])
# export_csv(settings["db"])