Skip to content

Commit

Permalink
style: split long lines into multiple shorter lines
Browse files Browse the repository at this point in the history
  • Loading branch information
NekoAria committed Mar 27, 2023
1 parent d96aee8 commit 7bf96f6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
3 changes: 2 additions & 1 deletion PicImageSearch/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ async def search(
-----------
• .origin = Raw data from scrapper\n
• .raw = Simplified data from scrapper\n
• .raw[2] = Third index of simplified data that was found <Should start from index 2, because from there is matching image>\n
• .raw[2] = Third index of simplified data that was found <Should start from index 2,
because from there is matching image>\n
• .raw[2].title = Third index of title that was found\n
• .raw[2].url = Third index of url source that was found\n
• .raw[2].thumbnail = Third index of base64 string image that was found
Expand Down
5 changes: 4 additions & 1 deletion PicImageSearch/model/saucenao.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,7 @@ def __init__(self, data: Dict[str, Any]):
self.minimum_similarity: Optional[float] = res_header.get("minimum_similarity")
# 数据返回值数量
self.results_returned: Optional[int] = res_header.get("results_returned")
self.url: str = f'https://saucenao.com/search.php?url=https://saucenao.com{res_header.get("query_image_display")}'
self.url: str = (
f"https://saucenao.com/search.php?url="
f'https://saucenao.com{res_header.get("query_image_display")}'
)
6 changes: 5 additions & 1 deletion PicImageSearch/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
from multidict import MultiDict

DEFAULT_HEADERS = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36"
"User-Agent": (
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
"AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/99.0.4844.82 Safari/537.36"
)
}


Expand Down
9 changes: 6 additions & 3 deletions PicImageSearch/saucenao.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ def __init__(
:param numres: (int) output number (default=5)
:param dbmask: (int) The mask used to select the specific index to be enabled (default=None)
:param dbmaski: (int) is used to select the mask of the specific index to be disabled (default=None)
:param db: (int) Search for a specific index number or all indexes (default=999), see https://saucenao.com/tools/examples/api/index_details.txt
:param dbs: (list) Search for specific indexes number or all indexes (default=None), see https://saucenao.com/tools/examples/api/index_details.txt
:param db: (int) Search for a specific index number or all indexes (default=999),
see https://saucenao.com/tools/examples/api/index_details.txt
:param dbs: (list) Search for specific indexes number or all indexes (default=None),
see https://saucenao.com/tools/examples/api/index_details.txt
:param minsim: (int) Control the minimum similarity (default=30)
:param hide: (int) result hiding control, 0=show all, 1=hide expected explicit, 2=hide expected and suspected explicit, 3=hide all but expected safe. Default is 0.
:param hide: (int) result hiding control, 0=show all, 1=hide expected explicit,
2=hide expected and suspected explicit, 3=hide all but expected safe. Default is 0.
:param **request_kwargs: proxies and bypass settings.
"""
# minsim 控制最小相似度
Expand Down

0 comments on commit 7bf96f6

Please sign in to comment.