feat: bumped version to 0.0.34

This commit is contained in:
DESKTOP-RTLN3BA\$punk 2026-07-17 19:42:10 -07:00
parent 726d3f784e
commit 87b0ba86e4
11 changed files with 383 additions and 155 deletions

View file

@ -9,10 +9,10 @@ This is NOT a pytest test (it needs live network + a residential/custom proxy).
It:
Step 0 go/no-go probe (folds in the old scripts/reddit_probe.py): open a
proxy session, warm a ``loid`` (svc/shreddit first, old.reddit fallback),
then do sequential ``.json`` fetches on the SAME sticky IP and assert each
returns a Reddit Listing. If this fails the whole approach is invalid
later steps are skipped.
proxy session, browser-warm a ``loid`` cookie jar on the sticky exit IP,
then do sequential plain-HTTP ``.json`` fetches on the SAME sticky IP
(replaying the jar) and assert each returns a Reddit Listing. If this fails
the whole approach is invalid later steps are skipped.
Step 1 scrape a discovered post URL (post + a few comments).
Step 2 scrape a subreddit listing.
Step 3 run a search query.
@ -96,8 +96,11 @@ async def step0_probe() -> bool:
return _check(
"proxy configured", False, "no proxy -> set PROXY_PROVIDER + creds"
)
minted = await warm_session(holder.session)
jar = await warm_session(holder.proxy)
if jar:
holder.cookies = jar
holder.warmed = True # don't let fetch_json re-warm; we just warmed it
minted = bool(jar)
_check("loid warm-up minted a session", minted)
oks: list[bool] = []
for path in (f"r/{_SUBREDDIT}/hot", "r/programming/new", f"r/{_SUBREDDIT}/hot"):

View file

@ -39,6 +39,12 @@ from urllib.parse import urlsplit
from dotenv import load_dotenv
# --- bootstrap: load .env and put the backend root on sys.path before app.* ---
# Scraped captions carry arbitrary Unicode (emoji, CJK, decorative glyphs); the
# Windows cp1252 console can't encode it and would abort the whole run on a single
# character. Emit UTF-8 and replace anything un-encodable instead of crashing.
if hasattr(sys.stdout, "reconfigure"):
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
_BACKEND_ROOT = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(_BACKEND_ROOT))
for _candidate in (_BACKEND_ROOT / ".env", _BACKEND_ROOT.parent / ".env"):
@ -50,7 +56,7 @@ _FIXTURES = _BACKEND_ROOT / "tests" / "fixtures" / "tiktok"
# Evergreen public targets: a regular high-volume creator, a broad hashtag, and
# a common search term.
_PROFILE = "nasa"
_PROFILE = "tiktok"
_HASHTAG = "food"
_SEARCH = "meal prep"
_COUNT = 5