SauceNAO
Classes
SauceNAOItem
Bases: BaseSearchItem
Represents a single SauceNAO search result item.
This class processes and structures individual search results from SauceNAO, providing easy access to various metadata about the found image.
Attributes:
Name | Type | Description |
---|---|---|
origin |
dict
|
The raw JSON data of the search result. |
similarity |
float
|
Similarity percentage between the query and result image. |
thumbnail |
str
|
URL of the result's thumbnail image. |
index_id |
int
|
Numerical identifier of the source database index. |
index_name |
str
|
Human-readable name of the source database. |
hidden |
int
|
NSFW content flag (0 for safe, non-zero for NSFW). |
title |
str
|
Title of the artwork or content. |
url |
str
|
Direct URL to the source content. |
ext_urls |
list[str]
|
List of related URLs for the content. |
author |
str
|
Creator or uploader of the content. |
author_url |
str
|
URL to the author's profile page. |
source |
str
|
Original source platform or website. |
Source code in PicImageSearch/model/saucenao.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
|
Functions
__init__(data, **kwargs)
Initializes a SauceNAOItem with data from a search result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
dict[str, Any]
|
A dictionary containing the search result data. |
required |
Source code in PicImageSearch/model/saucenao.py
27 28 29 30 31 32 33 |
|
SauceNAOResponse
Bases: BaseSearchResponse[SauceNAOItem]
Encapsulates a complete SauceNAO API response.
This class processes and structures the full response from a SauceNAO search, including rate limit information and search results.
Attributes:
Name | Type | Description |
---|---|---|
status_code |
int
|
HTTP status code of the response. |
raw |
list[SauceNAOItem]
|
List of processed search result items. |
origin |
dict
|
The raw JSON response data. |
short_remaining |
Optional[int]
|
Remaining queries in 30-second window. |
long_remaining |
Optional[int]
|
Remaining queries for the day. |
user_id |
Optional[int]
|
SauceNAO API user identifier. |
account_type |
Optional[int]
|
Type of SauceNAO account used. |
short_limit |
Optional[str]
|
Maximum queries allowed per 30 seconds. |
long_limit |
Optional[str]
|
Maximum queries allowed per day. |
status |
Optional[int]
|
API response status code. |
results_requested |
Optional[int]
|
Number of results requested. |
search_depth |
Optional[int]
|
Number of databases searched. |
minimum_similarity |
Optional[float]
|
Minimum similarity threshold. |
results_returned |
Optional[int]
|
Actual number of results returned. |
url |
str
|
URL to view the search results on SauceNAO website. |
Source code in PicImageSearch/model/saucenao.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
|
Functions
__init__(resp_data, resp_url, **kwargs)
Initializes with the response data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
resp_data
|
dict[str, Any]
|
A dictionary containing the parsed response data from SauceNAO. |
required |
resp_url
|
str
|
URL to the search result page. |
required |
Source code in PicImageSearch/model/saucenao.py
206 207 208 209 210 211 212 213 |
|