From 5e99720328a9894274d3cb1d291950d30401801f Mon Sep 17 00:00:00 2001 From: Kumi Date: Fri, 16 Feb 2024 18:31:38 +0100 Subject: [PATCH] Fix image embed check in file processing Corrected the logic for identifying image files without an embedded type by fixing the misplaced quotation marks in the conditional. This change ensures that the correct files are appended with proxy URLs for step images. Additionally, removed unnecessary whitespace for cleaner code structure. --- main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.py b/main.py index 7c9604f..624661d 100644 --- a/main.py +++ b/main.py @@ -957,7 +957,7 @@ def route_article(article): for file in step["files"]: print(file) - if file["image"] and not "embedType" in file: + if file["image"] and not "embedType" in "file": step_imgs.append( {"src": proxy(file["downloadUrl"]), "alt": file["name"]} ) @@ -969,7 +969,6 @@ def route_article(article): else: # Leaves us with embeds embed_code = file["embedHtmlCode"] - soup = BeautifulSoup(embed_code, "html.parser") iframe = soup.select("iframe")[0]