Fix RuntimeError due to dict changing

This commit is contained in:
Nexus 2024-02-22 18:13:20 +00:00
parent ab3dd09251
commit 438c5d36b6
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -268,7 +268,7 @@ def preview_url(
if tag_name in (*VALID_OG_TAGS, *TWITTER_MAPPING.keys()):
og_tags[tag_name] = tag.get("content")
for tag in og_tags.keys():
for tag in og_tags.copy().keys():
if tag.startswith("twitter:"):
if tag in TWITTER_MAPPING:
og_tags[TWITTER_MAPPING[tag]] = og_tags.pop(tag)