Eight images for sku_l04, sku_l07 and sku_l09 from six source domains, scored through the shipped LocalLaneAdapter and DecisionPolicy against stock-lopia-clean: 4 correct accepts, 4 abstains, no false accepts. Leak-tested first: the highest template match of any image against add/image6.jpg is 0.675, so none is a crop of the evaluation photo. The result that matters is sku_l07. It has no enrolled image, and both its images accept through the text lane alone - one reads ラッキー フヨネーズ, the other the rear label's 製造者:丸和油脂株式会社 with 内容量:200g, which together name the row 丸和油脂 ラッキーマヨネーズ 200g. The text lane's coverage claim holds on data that was not used to build it. The four l04 abstentions are correct behaviour: l04 is also unenrolled and its reads are weak (one reads only コと旨 タ 味, another scores 0.379 against a 0.45 accept line). Also records the l12 reconciliation, the Kewpie 450 g research, and two reusable pan clips with 11 rejected candidates for a future Tier-3 replay. Nothing here is Tier 2 or Tier 3 and every manifest says so.
45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
"""PayPay Flea Market search/detail helper (customer photos, non-enrollment)."""
|
|
import json
|
|
import re
|
|
import sys
|
|
import urllib.parse
|
|
|
|
import _fetch
|
|
|
|
|
|
def search(query, limit=30):
|
|
"""Return [(item_id, title, price)] from a PayPay flea-market search."""
|
|
h = _fetch.text("https://paypayfleamarket.yahoo.co.jp/search/" + urllib.parse.quote(query))
|
|
m = re.search(r'"items":\[(.*?)\]\}', h, re.S)
|
|
if not m:
|
|
return []
|
|
out = []
|
|
for blob in re.findall(r'\{"productID".*?\}', m.group(1)):
|
|
try:
|
|
d = json.loads(blob)
|
|
except json.JSONDecodeError:
|
|
continue
|
|
out.append((d.get("productID"), d.get("productName"), d.get("price")))
|
|
if len(out) >= limit:
|
|
break
|
|
return out
|
|
|
|
|
|
def item_images(item_id):
|
|
"""Return full-size image URLs for one PayPay flea-market item."""
|
|
h = _fetch.text("https://paypayfleamarket.yahoo.co.jp/item/" + item_id)
|
|
urls = re.findall(r'https://auctions\.c\.yimg\.jp/images\.auctions\.yahoo\.co\.jp/image/[^"\\ ]+?\.jpg', h)
|
|
seen = []
|
|
for u in urls:
|
|
if u not in seen:
|
|
seen.append(u)
|
|
return seen
|
|
|
|
|
|
if __name__ == "__main__":
|
|
if sys.argv[1] == "search":
|
|
for row in search(sys.argv[2]):
|
|
print(row[0], "|", row[1], "|", row[2])
|
|
else:
|
|
for u in item_images(sys.argv[2]):
|
|
print(u)
|