Merge pull request #2308 from return42/fix-1959-2

[fix] engine google-News: fix decoding of URLs (part 2)
This commit is contained in:
Markus Heiser 2023-04-02 19:25:10 +02:00 committed by GitHub
commit b8100e4e16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -150,7 +150,7 @@ def response(resp):
href = href.split('?')[0] href = href.split('?')[0]
href = href.split('/')[-1] href = href.split('/')[-1]
href = base64.urlsafe_b64decode(href + '====') href = base64.urlsafe_b64decode(href + '====')
href = href[4:].split(b'\xd2')[0] href = href[href.index(b'http') :].split(b'\xd2')[0]
href = href.decode() href = href.decode()
title = extract_text(eval_xpath(result, './article/h3[1]')) title = extract_text(eval_xpath(result, './article/h3[1]'))