def get_results(self, input):
try:
results = audiojack.get_results(input)[:8]
images = []
for i, result in enumerate(results):
if run:
image_data = Image.open(StringIO(audiojack.get_cover_art_as_data(results[i][3]).decode('base64')))
image_data = image_data.resize((200, 200), Image.ANTIALIAS)
images.append(ImageTk.PhotoImage(image=image_data))
else:
break
if run:
self.q.put([results, images])
else:
self.q.put(0)
except (ExtractorError, DownloadError): # If the URL is invalid,
self.q.put(-1) # put -1 into the queue to indicate that the URL is invalid.
except NetworkError:
self.q.put(-2)
评论列表
文章目录