From 5f6ef0e78dfdda005576f4de6ad081361d0aa9f9 Mon Sep 17 00:00:00 2001
From: Midgard <2885-Midgard@users.noreply.framagit.org>
Date: Mon, 18 Nov 2019 14:41:18 +0100
Subject: [PATCH] Un-HTML-escape data
---
showtify.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/showtify.py b/showtify.py
index e6ddcac..44f7d00 100755
--- a/showtify.py
+++ b/showtify.py
@@ -17,6 +17,7 @@
import requests
import re
+from html import unescape
MY_COUNTRY_CODE = "BE"
@@ -24,12 +25,15 @@ MY_COUNTRY_NAME = "Belgium"
def search_all_meta(prop, value, page_content):
- return re.findall(r''.format(prop, value), page_content)
+ return map(
+ unescape,
+ re.findall(r''.format(prop, value), page_content)
+ )
def search_meta(prop, value, page_content):
match = re.search(r''.format(prop, value), page_content)
- return match.group(1) if match else None
+ return unescape(match.group(1)) if match else None
def str_exact_len(s, length, align="<"):