@@ -75,15 +75,17 @@ def response(resp):
76 # get thumbnails
76 # get thumbnails
77 script = str(dom.xpath('//script[contains(., "_setImagesSrc")]')[0].text)
77 script = str(dom.xpath('//script[contains(., "_setImagesSrc")]')[0].text)
78− id = result.xpath('.//div[@class="s"]//img/@id')[0]
78+ ids = result.xpath('.//div[@class="s"]//img/@id')
79− thumbnails_data = re.findall('s=\'(.*?)(?:\\\\[a-z,1-9,\\\\]+\'|\')\;var ii=\[(?:|[\'vidthumb\d+\',]+)\'' + id,
81+ re.findall('s=\'(.*?)(?:\\\\[a-z,1-9,\\\\]+\'|\')\;var ii=\[(?:|[\'vidthumb\d+\',]+)\'' + ids[0],
82− if len(thumbnails_data) != 0:
84+ if len(thumbnails_data) != 0:
83− tmp = re.findall('(data:image/jpeg;base64,[a-z,A-Z,0-9,/,\+]+)', thumbnails_data[0])
85+ tmp = re.findall('(data:image/jpeg;base64,[a-z,A-Z,0-9,/,\+]+)', thumbnails_data[0])
84− thumbnail = ''
86+ thumbnail = ''
85− if len(tmp) != 0:
87+ if len(tmp) != 0:
86− thumbnail = tmp[-1]
88+ thumbnail = tmp[-1]
88 # append result
90 # append result
89 results.append({'url': url,
91 results.append({'url': url,