Douyin Home Monitor
Required Preflight
Before running the monitor, confirm Edge remote debugging is available at http://127.0.0.1:9222/json/version.
Use this check:
try { Invoke-RestMethod http://127.0.0.1:9222/json/version -TimeoutSec 2 } catch { "Edge remote debugging is not available" }
If it is unavailable, close ordinary Edge windows and start Edge with remote debugging:
& 'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe' --remote-debugging-port=9222 --user-data-dir="$env:LOCALAPPDATA\Microsoft\Edge\User Data" --profile-directory=Default
Then open or log in to Douyin in that Edge profile if needed, and rerun the monitor. This preflight is mandatory because the script reads rendered logged-in homepage cards; it does not use Douyin's blocked background works-list API.
To reduce disruption, keep this Edge window minimized after login. The monitor script should close the temporary tabs it opens after each homepage check.
Logged-In Account Check
Before processing new works, try to identify the visible logged-in Douyin account from the rendered page, such as the nickname shown in the left navigation/user panel. Report the visible account nickname when available.
If the user has provided an expected logged-in account nickname, compare it before extraction:
- If it matches, continue.
- If it does not match or the account cannot be confirmed, stop before extraction and notify the user.
- Do not read or expose private credentials, cookies, phone numbers, passwords, or tokens. Only use visible page text such as the public nickname shown by Douyin.
For this user's current browser session, the visible logged-in nickname observed previously was Kin. Treat this only as a sanity-check hint, not as a credential.
Run
Use the bundled script for deterministic batch monitoring:
& '<extractor-python>' '<skill-dir>\scripts\douyin_batch_monitor.py' --home-file '<links.txt>' --state '<state.json>' --outputs '<output-dir>'
Prefer the Python runtime bundled with the local extractor app. If DOUYIN_EXTRACTOR_DIR is set:
$extractorPython = Join-Path $env:DOUYIN_EXTRACTOR_DIR 'feige\python.exe'
If DOUYIN_EXTRACTOR_DIR is not set, locate the extractor app directory first or ask the user for the path. The script can start/check the app's http://127.0.0.1:8080 service if DOUYIN_EXTRACTOR_DIR is set or the default local path exists.
Workflow
- Run the
Required Preflightcheck. Start Edge with remote debugging if needed. - Put the user's Douyin homepage/profile links into a UTF-8 text file, one URL per line. Short links such as
https://v.douyin.com/.../are allowed. - Run
scripts/douyin_batch_monitor.pywith:--home-file: file containing homepage links, or pass links as positional args.--state: persistent JSON state file. Default to the current workspacework/douyin_monitor_state.json.--outputs: docx output directory. Default to the current workspaceoutputs.
- On a first run for each home, initialize that home's baseline by default and do not process all old visible works.
- On later runs, process only unseen
aweme_ids per homepage. - When new works are processed, report each work URL, Word path, title/uploader/duration, transcript length, and SRT length.
- If login is invalid, the account cannot be confirmed when required, the page cannot load, Edge debugging is unavailable, or no latest works can be confirmed, follow
Login Or Verification Problemsand tell the user the exact blocking reason.
Browser Requirement
The script reads the rendered Douyin homepage through Edge remote debugging on 127.0.0.1:9222. It intentionally does not use Douyin's blocked background works-list API.
If the script reports that Edge remote debugging is unavailable, follow Required Preflight and rerun the monitor.
Login Or Verification Problems
If the rendered homepage shows login prompts, QR login, SMS verification, slider/captcha, security verification, or no visible works because the session is invalid:
- Do not retry Douyin's background works-list API.
- Do not mark any new works as seen or processed for that blocked homepage.
- Preserve the existing state file unchanged except for a run/block log if the script records one.
- Tell the user that manual browser login or verification is required.
- Ask the user to use the Edge window started by
Required Preflight, openhttps://www.douyin.com/, complete login/verification, then open one target homepage and confirm works cards are visible. - After the user confirms login is restored, rerun the monitor with the same state file and outputs directory.
Common blocker messages and meanings:
Edge remote debugging is unavailable: Edge was not started with--remote-debugging-port=9222, or ordinary Edge is already occupying the profile.requires login or verification: the rendered page is reachable but Douyin is asking for login, QR scan, captcha, slider, SMS, or security verification.No standard video links found: the page loaded but nodouyin.com/video/...card links were visible; possible causes include incomplete rendering, private/empty homepage, blocked content, or a tab that is not logged in.
When reporting a login blocker, include:
- the affected homepage URL,
- the blocker message,
- the Edge remote debugging preflight command,
- the instruction to log in manually in that Edge profile,
- confirmation that no extraction or duplicate-state update was performed for that homepage.
Useful Options
--process-current: process currently visible works even when there is no prior state.--max-new-per-home N: cap new works processed per home per run.--wait-seconds N: wait longer for slow Douyin homepage rendering.--service-dir PATH: override extractor app directory.--cdp-port PORT: override Edge remote debugging port.