Merge pull request #200 from unixfox/patch-1

Fix google images
This commit is contained in:
Markus Heiser 2021-07-10 16:17:21 +00:00 committed by GitHub
commit 438357a5b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ def scrap_img_by_id(script, data_id):
img_url = '' img_url = ''
_script = script.split('\n') _script = script.split('\n')
for i, line in enumerate(_script): for i, line in enumerate(_script):
if 'gstatic.com/images' in line and data_id in line: if 'gstatic.com/images' in line and data_id in line and i + 1 < len(_script):
url_line = _script[i + 1] url_line = _script[i + 1]
img_url = url_line.split('"')[1] img_url = url_line.split('"')[1]
img_url = unquote(img_url.replace(r'\u00', r'%')) img_url = unquote(img_url.replace(r'\u00', r'%'))