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.
This commit is contained in:
Kumi 2024-02-16 18:31:38 +01:00
parent dfe7882b12
commit 5e99720328
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -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]