From 2e88a0cd03635a1f9e0da9a7dad17657f67fc54b Mon Sep 17 00:00:00 2001 From: kitUIN Date: Wed, 29 Dec 2021 21:51:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E9=94=99=E8=AF=AF=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PicImageSearch/Utils/iqdb.py | 11 ++++++----- setup.py | 2 +- test/test4.py | 3 +-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PicImageSearch/Utils/iqdb.py b/PicImageSearch/Utils/iqdb.py index c667d3fc..4eddb510 100644 --- a/PicImageSearch/Utils/iqdb.py +++ b/PicImageSearch/Utils/iqdb.py @@ -14,7 +14,7 @@ def __init__(self, data: Tag, isnot_more: bool = True): self.content: str = "None" self.url: str = "None" self.source: str = "None" - self.other_source: dict = {} + self.other_source: list = list() self.thumbnail: str = "None" self.size: str = "None" self.similarity: str = "None" @@ -26,7 +26,7 @@ def _arrange(self, data: Tag): self.content = data.tr.th.string if self.content == "No relevant matches": return - #logger.info(self.content) + # logger.info(self.content) tbody = data.tr.next_sibling else: tbody = data.tr @@ -35,9 +35,10 @@ def _arrange(self, data: Tag): tbody = tbody.next_sibling source = [stt for stt in tbody.td.strings] if len(source) > 1: - self.other_source = {"source": source[1], - "url": tbody.td.a['href'] if tbody.td.a['href'][:4] == "http" else "https:" + - tbody.td.a['href']} + self.other_source.append({"source": source[1], + "url": tbody.td.a['href'] if tbody.td.a['href'][:4] == "http" else "https:" + + tbody.td.a[ + 'href']}) tbody = tbody.next_sibling self.size = tbody.td.string similarity_raw = REGEXIQ.search(tbody.next_sibling.td.string) diff --git a/setup.py b/setup.py index 625eea19..baca6618 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="PicImageSearch", - version='2.2.0', + version='2.2.1', author="kitUIN", author_email="kulujun@gmail.com", description="PicImageSearch APIs for Python 3.x 适用于 Python 3 以图搜源整合API", diff --git a/test/test4.py b/test/test4.py index 8e60d985..1e6297e7 100644 --- a/test/test4.py +++ b/test/test4.py @@ -23,8 +23,7 @@ logger.info("Ascii2d搜图链接: " + res.ascii2d) logger.info("TinEye搜图链接: " + res.tineye) logger.info("Google搜图链接: " + res.google) -logger.info("相似度低的结果: " + res.more) -# 列表中存放了相似度低的结果 +logger.info("相似度低的结果: " + str(res.more))