From ff2db35911e6ab3bbf78a622687d38537ea6c756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pol=20Mons=C3=B3=20Purt=C3=AD?= <56979418+polmonso@users.noreply.github.com> Date: Mon, 23 Dec 2024 12:10:57 +0100 Subject: [PATCH] fix: remove html entities from url given that now produce error 500 on omie.es (#18) --- datasources/omie/omie_operations.py | 8 ++++---- datasources/omie/omie_update_last_hour_price.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/datasources/omie/omie_operations.py b/datasources/omie/omie_operations.py index b5f7c1a..ad7ffb4 100644 --- a/datasources/omie/omie_operations.py +++ b/datasources/omie/omie_operations.py @@ -58,7 +58,7 @@ def get_historical_hour_price(engine, verbose=2, dry_run=False): filetype = 'marginalpdbc' hist_files = get_file_list(filetype) - file_base_url = f'https://www.omie.es/es/file-download?parents%5B0%5D={filetype}&filename=' + file_base_url = f'https://www.omie.es/es/file-download?parents={filetype}&filename=' total = len(hist_files['Nombre']) @@ -92,7 +92,7 @@ def update_latest_hour_price(engine, verbose=2, dry_run=False): filetype = 'marginalpdbc' hist_files = get_file_list(filetype) - file_base_url = f'https://www.omie.es/es/file-download?parents%5B0%5D={filetype}&filename=' + file_base_url = f'https://www.omie.es/es/file-download?parents={filetype}&filename=' file_name = hist_files['Nombre'][0] pathfile = file_base_url + file_name @@ -124,7 +124,7 @@ def update_historical_hour_price(engine, verbose=2, dry_run=False): filetype = 'marginalpdbc' hist_files = get_file_list(filetype) - file_base_url = f'https://www.omie.es/es/file-download?parents%5B0%5D={filetype}&filename=' + file_base_url = f'https://www.omie.es/es/file-download?parents={filetype}&filename=' file_name = hist_files['Nombre'][0] pathfile = file_base_url + file_name @@ -193,7 +193,7 @@ def update_energy_buy_fromweb(engine, verbose=2, dry_run=False): filetype = 'pdbc' hist_files = get_file_list(filetype) - file_base_url = f'https://www.omie.es/es/file-download?parents%5B0%5D={filetype}&filename=' + file_base_url = f'https://www.omie.es/es/file-download?parents={filetype}&filename=' file_name = hist_files['Nombre'][0] diff --git a/datasources/omie/omie_update_last_hour_price.py b/datasources/omie/omie_update_last_hour_price.py index ff42267..f1585b3 100644 --- a/datasources/omie/omie_update_last_hour_price.py +++ b/datasources/omie/omie_update_last_hour_price.py @@ -36,7 +36,7 @@ def get_files(engine, filetype, potential_missing): print(f'No {filetype} new files available.') exit() - base_url = f'https://www.omie.es/es/file-download?parents%5B0%5D={filetype}&filename=' + base_url = f'https://www.omie.es/es/file-download?parents={filetype}&filename=' try: dfs = [