Skip to content

Commit

Permalink
类型错误修复
Browse files Browse the repository at this point in the history
  • Loading branch information
kitUIN committed Dec 29, 2021
1 parent eda32d5 commit 2e88a0c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
11 changes: 6 additions & 5 deletions PicImageSearch/Utils/iqdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setuptools.setup(
name="PicImageSearch",
version='2.2.0',
version='2.2.1',
author="kitUIN",
author_email="[email protected]",
description="PicImageSearch APIs for Python 3.x 适用于 Python 3 以图搜源整合API",
Expand Down
3 changes: 1 addition & 2 deletions test/test4.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))



0 comments on commit 2e88a0c

Please sign in to comment.