From 0222eb175be26f7ec141a2b32ce52bf336a50a36 Mon Sep 17 00:00:00 2001 From: jeancf Date: Fri, 11 Oct 2019 14:28:24 +0200 Subject: [PATCH] Remove HTML-safe encoding from URL if any --- twoot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/twoot.py b/twoot.py index 3e7ff4d..21209be 100755 --- a/twoot.py +++ b/twoot.py @@ -221,7 +221,8 @@ def main(argv): # Matches the first instance of either twitter:image or twitter:image:src meta tag match = re.search(r'', r.text) if match is not None: - photos.append(match.group(1)) + url = match.group(1).replace('&', '&') # Remove HTML-safe encoding from URL if any + photos.append(url) except (requests.exceptions.ConnectionError, requests.exceptions.Timeout): pass