From aad064d220e9cd4a0d3a579ae27c0d12f4031bf0 Mon Sep 17 00:00:00 2001 From: "fatih.bulut" Date: Thu, 25 Jun 2026 02:09:33 +0300 Subject: [PATCH] feat(clone-app): scrape screenshots, feature graphic, description from Play --- .../clone-app/scripts/scrape-play-store.py | 18 +++++++++++++++++- .../clone-app/tests/fixtures/play-sample.html | 5 ++++- .../clone-app/tests/test-scrape-play-store.py | 6 +++++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/plugins/clone-app/skills/clone-app/scripts/scrape-play-store.py b/plugins/clone-app/skills/clone-app/scripts/scrape-play-store.py index 0f8c5ba..de61435 100644 --- a/plugins/clone-app/skills/clone-app/scripts/scrape-play-store.py +++ b/plugins/clone-app/skills/clone-app/scripts/scrape-play-store.py @@ -7,7 +7,8 @@ Falls back to light regex for installs/updated which aren't always in ld+json. import sys, json, re, argparse, urllib.request, ssl, subprocess, shutil KEYS = ["package", "title", "rating", "rating_count", "installs", - "category", "developer", "updated", "source"] + "category", "developer", "updated", "source", + "screenshot_urls", "feature_graphic", "description"] UA = "Mozilla/5.0" @@ -61,6 +62,21 @@ def parse(html, package): if ar.get("ratingCount") is not None: try: out["rating_count"] = int(ar["ratingCount"]) except Exception: pass + out["description"] = data.get("description") + img = data.get("image") + if isinstance(img, list): + img = img[0] if img else None + out["feature_graphic"] = img + shots = data.get("screenshot") or [] + if isinstance(shots, dict): + shots = [shots] + urls = [] + for s in shots: + if isinstance(s, str): + urls.append(s) + elif isinstance(s, dict) and s.get("url"): + urls.append(s["url"]) + out["screenshot_urls"] = urls break # installs (e.g. "1,000,000+"). Play wraps the count and the "Downloads" diff --git a/plugins/clone-app/tests/fixtures/play-sample.html b/plugins/clone-app/tests/fixtures/play-sample.html index 48dc41c..882e460 100644 --- a/plugins/clone-app/tests/fixtures/play-sample.html +++ b/plugins/clone-app/tests/fixtures/play-sample.html @@ -3,7 +3,10 @@
Updated on
Jun 1, 2026
diff --git a/plugins/clone-app/tests/test-scrape-play-store.py b/plugins/clone-app/tests/test-scrape-play-store.py index 33bc010..b6e6214 100644 --- a/plugins/clone-app/tests/test-scrape-play-store.py +++ b/plugins/clone-app/tests/test-scrape-play-store.py @@ -25,8 +25,12 @@ def main(): check("installs", d["installs"] == "1,000,000+") check("updated", d["updated"] == "Jun 1, 2026") check("source", d["source"] == "google-play") + check("description", d["description"] == "An example puzzle app.") + check("feature_graphic", d["feature_graphic"] == "https://play-lh.googleusercontent.com/feature.png") + check("screenshot count", len(d["screenshot_urls"]) == 2) + check("screenshot url", d["screenshot_urls"][0] == "https://play-lh.googleusercontent.com/shot1.png") # all expected keys present even if null - for k in ["package","title","rating","rating_count","installs","category","developer","updated","source"]: + for k in ["package","title","rating","rating_count","installs","category","developer","updated","source","screenshot_urls","feature_graphic","description"]: check(f"key present: {k}", k in d) sys.exit(1 if fails else 0)