From 9ad1d60a47b6829ab1a4f3e795d3dd1708650a53 Mon Sep 17 00:00:00 2001 From: Fabian Schilling Date: Tue, 2 Nov 2021 23:22:24 +0100 Subject: [PATCH] Improve URL parsing for full size images (#521) Skip URLs that are not two-element lists Fixes #520 --- app/filter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/filter.py b/app/filter.py index fa45136..65bc73b 100644 --- a/app/filter.py +++ b/app/filter.py @@ -381,6 +381,10 @@ class Filter: for item in results_all: urls = item.find('a')['href'].split('&imgrefurl=') + # Skip urls that are not two-element lists + if len(urls) != 2: + continue + img_url = urlparse.unquote(urls[0].replace('/imgres?imgurl=', '')) try: