Repository navigation
Releases
v0.2.0
Behaviour changes. Output files (JSON, CSV and the
.meta.json
sidecar) are now created with the mode your umask gives (0644under
the usual022) instead of always0600, and an existing file keeps its
mode. CSV cells that begin with=,+,-,@, tab, CR or LF get a
leading'(JSON is unchanged; the count iscsv_cells_escapedin the
sidecar). Negative--retries,--retry-delay,--delayand
--proxy-block-retries, and--pages/--concurrencybelow 1, are now
refused with exit 2 naming the flag (--retries 0is still one attempt).
An--allow-emptyrun that finished and found nothing is recorded
status: completeinstead offailed.
Fixed
- Every output was readable by its owner only: the atomic writer's
temporary file is created0600and the rename kept that mode. - Creator-written text (bio, display name, link) could be read as a
spreadsheet formula when the CSV was opened. --retries -1was accepted and silently behaved as 0; a negative delay
reachedtime.sleepmid-run. Now usage errors in all three engines and
inscraper_api_client.py.- The Selenium browser path handed the classifier no HTTP status at all;
it now reads the navigation's status from Navigation Timing where the
browser provides it. - Log masking now covers
http(s)://user:pass@in engine errors and a
JSON-quoted"apiKey": "..."in the Scraper API'sx-debugheader. - The paid
scraper-apicanary job could never fail: its exit code was
written to a step output nothing read. It now asserts the exit code and a
real row, and fails with an error namingTWOCAPTCHA_KEYwhen that secret
is absent instead of skipping green. - Comments, help text and workflows referred to private notes by section
number; the rules are now stated in this repository's own words, and the
offline suite fails if such a reference reappears.
v0.1.2
Behaviour changes. A page that was refused once and then served is
no longer reported as blocked — such runs were exit 6 /partial, now 0.
Browser--concurrencyworks (it crashed every worker), and a run whose
workers all fail is exit 5, not exit 4.
Fixed
- A recovered page is not a blocked one.
_fetch_with_policykept a
"refusal seen" flag that a later successful attempt never cleared, so a
retry that got the page still reported it blocked. Measured live on
2026-09-29 (pyppeteer, @nasa): one empty HTTP 200, then the profile,
thenpartial/stop_reason: blockedwithpages_failed: []. And the
HTTP -> browser switch spent a--retriesattempt, so with--retries 0
a browser started and was never asked for the page. Both fixed in all
three engines, with a check that drives the real function. - Browser
--concurrencycrashed every worker. The workers were handed
the Playwright driver the main thread created, and Playwright's sync
driver belongs to its thread:greenlet.error: Cannot switch to a different thread, then exit 4 with no rows. Each worker now starts its
own driver, on first use, in its own thread. And a target no worker
could fetch now ends as a counted failure (exit 5 when nothing was
gathered) instead of vanishing into "0 results". Live: 3 of 3, exit 0.
source_changednever fired.diff_runs.py's source-split tuple was
empty, so a count read from the roundedstatsfallback diffed against
an exactstatsV2count was reported as the account having changed —
the opposite of whatoutput_writer.pyand the README say. The count
columns now go tosource_changedwhenstats_sourcediffers, and
smoke_test.pychecks it.
-
Donor prose removed from the shared core.
output_writer.py,
diff_runs.py, the engines,page_flow.py,smoke_test.py,
.github/ci_checks.pyand theDockerfilecarried text from the repos
this core was copied from — YouTube comment threads,--sort top,
reply threads, job listings, "the business",--mode comments --out software-engineer— describing those sites as if they were this one.
Rewritten from this repo's own README, code and fixtures, or deleted
where there was no measured equivalent. Explicit sibling provenance
("measured on tiktok-profile-scraper's route", "a sibling repo
(youtube-scraper) had…") is kept and now says whose it is. -
diff_runs.py's summary printed@ company_nameand "pay not stated"
for every added or removed row; it now prints the handle and the
follower count. -
The engines'
_prime_sessiondocstring no longer describes the YouTube
repo this core came from. -
captcha_solver.py's docstring pointed at a "No DataDome solver" section
that does not exist in this repo (it came with the copied core). Removed. -
The Scraper API engine failed on every
--wait-text/--wait-element/
--wait-statecall, and was billed for it. It sentwaitForas a
JSON-encoded string; measured 2026-09-23 the live API answers that with
HTTP 422 "params.waitFor must be an object" and still charges $0.0005,
while the same request with an object is answered 200. It is now sent as
an object. (The target status was already read fromhttp_code; the new
regression check pins that too, driving the realfetch_htmlwith
requests.poststubbed.) -
--wait-state networkidleis refused by the Scraper API (HTTP 422
"params.waitFor.state must be one of: load, domcontentloaded", still
billed — measured 2026-09-23 on a sibling repo with the object-shaped
waitFor). The choice is removed.
v0.1.1
Correction to v0.1.0. Its
captcha_solver.pydocstring described a
2Captcha captcha-solving method for TikTok as available. That method is
deprecated, and the text no longer offers it. The challenge policy for
TikTok's slide puzzle now sayssolve: False, which matches what the
code does: no solver for it is implemented.
v0.1.0
First release. Reads a TikTok account's public statistics from the profile
page TikTok server-renders to anyone.
The measurement this release exists to get right
TikTok publishes every account statistic twice, and the two objects
disagree. Measured across eighteen accounts on 2026-09-22:
| account | stats.followerCount |
statsV2.followerCount |
error |
|---|---|---|---|
| @tiktok | 95,900,000 | 95,856,713 | +43,287 |
| @khaby.lame | 163,000,000 | 162,986,107 | +13,893 |
| @nasa | 1,800,000 | 1,785,290 | +14,710 |
| @charlidamelio | 160,200,000 | 160,206,612 | -6,612 |
| @ZachKing | 86,900,000 | 86,900,407 | -407 |
stats is rounded to three significant figures and rounds both ways, so
it cannot be corrected for. Every row here is read from statsV2 and records
which object it came from in stats_source.
Added
--mode profile, over four interchangeable paths: Playwright, Selenium,
Puppeteer, and the 2Captcha Scraper API. Verified to produce identical rows.--transport auto|http|browser. The default is plain HTTPS, because the
page is server-rendered: measured 1.54 s against 3.38 s for three accounts
end to end, for identical rows. The browser is the fallback for a challenge.--urltakes a comma-separated list of handles,@handlesor profile URLs,
and--concurrencyis genuinely usable because every account has its own
address.- 41 columns, including
avatar_idandavatar_expires_at— TikTok serves
avatars from a signed CDN URL whose signature is re-minted per request, so
without a stable id every account would read as changed on every run.
(Measured: the signed URL answers 200 with a 77 KB JPEG and expires 47.7 h
out; with the query string stripped it answers 403.) is_seller/commerce_user, which is the link totiktok-shop-scraper.
Deliberately not here
- Videos. The profile page's own video grid is loaded by an XHR that
answersHTTP 200withcontent-length: 0to every client tried —
headless and headful Chromium, a Windows user agent, after accepting the EU
cookie consent, and through a residential exit in Peru — with a correctly
signed request. That refusal has its own run state (empty_success) and
exits 3 rather than reporting an account with no videos. The open routes
for video data are/embed/@handleand/@handle/video/{id}, and they are
tiktok-video-scraper's. - A distinction between a banned account and a handle that never existed.
TikTok answers both withstatusCode: 10221and the message
"user banned". This repo reports the state and does not claim to tell
them apart. username_modified_at. TikTok publishesuniqueIdModifyTimeon every
account and reported 0 — "never" — on all eighteen measured, so the column
was removed rather than shipped null on every row. The measurement is recorded in
output_writer.pyso it can be added back with a better one.
Known limitations
- The challenge-marker set is not verified against a page fetched over
--cdp-endpoint. The 2Captcha Scraping Browser injects its own captcha
hunters into every page it loads, and every profile available while this
repo was built had expired (401 deny_no_user). The offline suite records
this as a SKIP rather than passing silently. --localechanges the page's chrome and not its data:?lang=jaand
?lang=arreturned byte-identical nickname, bio, id and counts.