summaryrefslogtreecommitdiff
path: root/searx/engines/ina.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2020-12-17 09:57:03 +0100
committerAlexandre Flament <alex@al-f.net>2020-12-20 09:46:53 +0100
commiteb33ae6893ef9d5081b1ddd1119e7047642a40af (patch)
tree978d7a9044dcb3f259db84f657015ac757e9fbfb /searx/engines/ina.py
parent6402fb0b9a725f8f2c78874e537f21144c44f0e4 (diff)
downloadsearxng-eb33ae6893ef9d5081b1ddd1119e7047642a40af.tar.gz
searxng-eb33ae6893ef9d5081b1ddd1119e7047642a40af.zip
[fix] Python 3.9: use html.unescape instead of HTMLParser.unescape
Diffstat (limited to 'searx/engines/ina.py')
-rw-r--r--searx/engines/ina.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/searx/engines/ina.py b/searx/engines/ina.py
index 52c939498..ce241d409 100644
--- a/searx/engines/ina.py
+++ b/searx/engines/ina.py
@@ -12,10 +12,10 @@
# @todo embedded (needs some md5 from video page)
from json import loads
+from html import unescape
from urllib.parse import urlencode
from lxml import html
from dateutil import parser
-from html.parser import HTMLParser
from searx.utils import extract_text
@@ -55,13 +55,12 @@ def response(resp):
if "content" not in response:
return []
dom = html.fromstring(response["content"])
- p = HTMLParser()
# parse results
for result in dom.xpath(results_xpath):
videoid = result.xpath(url_xpath)[0]
url = base_url + videoid
- title = p.unescape(extract_text(result.xpath(title_xpath)))
+ title = unescape(extract_text(result.xpath(title_xpath)))
try:
thumbnail = extract_text(result.xpath(thumbnail_xpath)[0])
except: