From 028ee4a861f40a48e5d01fc2ab2c983b73d7e604 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sun, 27 Feb 2022 11:37:12 +0100 Subject: [PATCH] fixed file filter regex for importers --- cookbook/integration/cheftap.py | 2 +- cookbook/integration/chowdown.py | 2 +- cookbook/integration/mealie.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cookbook/integration/cheftap.py b/cookbook/integration/cheftap.py index 24b29df4d..cf462d9a3 100644 --- a/cookbook/integration/cheftap.py +++ b/cookbook/integration/cheftap.py @@ -9,7 +9,7 @@ class ChefTap(Integration): def import_file_name_filter(self, zip_info_object): print("testing", zip_info_object.filename) - return re.match(r'^cheftap_export/([A-Za-z\d\w\s-])+.txt$', zip_info_object.filename) or re.match(r'^([A-Za-z\d\w\s-])+.txt$', zip_info_object.filename) + return re.match(r'^cheftap_export/([A-Za-z\d\s\-_()\[\]\u00C0-\u017F])+.txt$', zip_info_object.filename) or re.match(r'^([A-Za-z\d\s\-_()\[\]\u00C0-\u017F])+.txt$', zip_info_object.filename) def get_recipe_from_file(self, file): source_url = '' diff --git a/cookbook/integration/chowdown.py b/cookbook/integration/chowdown.py index 61295bb18..2f635436d 100644 --- a/cookbook/integration/chowdown.py +++ b/cookbook/integration/chowdown.py @@ -12,7 +12,7 @@ class Chowdown(Integration): def import_file_name_filter(self, zip_info_object): print("testing", zip_info_object.filename) - return re.match(r'^(_)*recipes/([A-Za-z\d\s-])+.md$', zip_info_object.filename) + return re.match(r'^(_)*recipes/([A-Za-z\d\s\-_()\[\]\u00C0-\u017F])+.md$', zip_info_object.filename) def get_recipe_from_file(self, file): ingredient_mode = False diff --git a/cookbook/integration/mealie.py b/cookbook/integration/mealie.py index 742f96d99..803cc6382 100644 --- a/cookbook/integration/mealie.py +++ b/cookbook/integration/mealie.py @@ -12,7 +12,7 @@ from cookbook.models import Ingredient, Recipe, Step class Mealie(Integration): def import_file_name_filter(self, zip_info_object): - return re.match(r'^recipes/([A-Za-z\d-])+/([A-Za-z\d-])+.json$', zip_info_object.filename) + return re.match(r'^recipes/([A-Za-z\d\s\-_()\[\]\u00C0-\u017F])+/([A-Za-z\d\s\-_()\[\]\u00C0-\u017F])+.json$', zip_info_object.filename) def get_recipe_from_file(self, file): recipe_json = json.loads(file.getvalue().decode("utf-8"))