jackwener/OpenCLI · error · ArgumentError
douyin delete aweme_id must be a numeric id
Error message
douyin delete aweme_id must be a numeric id
What it means
Thrown by readAwemeId when the aweme_id argument contains characters other than digits. Douyin aweme ids are long numeric strings, so the library rejects anything else early. Thrown as an ArgumentError for invalid user input.
Source
Thrown at clis/douyin/delete.js:15
import { cli, Strategy } from '@jackwener/opencli/registry';
import { ArgumentError, CommandExecutionError } from '@jackwener/opencli/errors';
import { browserFetch } from './_shared/browser-fetch.js';
import { requireObjectEvaluateResult } from './_shared/evaluate-result.js';
const CREATOR_MANAGE_URL = 'https://creator.douyin.com/creator-micro/content/manage';
const WORK_LIST_URL = '/janus/douyin/creator/pc/work_list?status=0&count=20&max_cursor=0&scene=star_atlas&device_platform=android&aid=1128';
function readAwemeId(raw) {
const value = String(raw ?? '').trim();
if (!value) {
throw new ArgumentError('douyin delete aweme_id cannot be empty');
}
if (!/^\d+$/.test(value)) {
throw new ArgumentError('douyin delete aweme_id must be a numeric id');
}
return value;
}
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
async function deleteViaCreatorManage(page, workId) {
await page.goto(CREATOR_MANAGE_URL);
await sleep(3000);
await sleep(3000);
const result = requireObjectEvaluateResult(await page.evaluate(`
(async () => {
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const targetId = ${JSON.stringify(String(workId))};
const textOf = (node) => (node && (node.innerText || node.textContent) || '').trim();
const normalize = (value) => String(value || '').replace(/\\s+/g, ' ').trim();View on GitHub (pinned to 49907e53dc)
Solutions
- Extract the numeric id (from the work list or the share URL's aweme_id query param) and pass only digits
- Trim surrounding quotes/whitespace from the argument
- Validate locally with /^\d+$/ before invoking the CLI
Example fix
// before
cli delete 'https://v.douyin.com/iAbCdE/'
// after
const id = new URL(link).searchParams.get('aweme_id'); // or extract digits
cli delete(id); Defensive patterns
Strategy: validation
Validate before calling
const id = String(raw ?? '').trim();
if (!/^\d+$/.test(id)) throw new Error(`aweme_id must be numeric, got: ${raw}`); Type guard
function isNumericId(raw) {
return /^\d+$/.test(String(raw ?? '').trim());
} Try / catch
try {
await cli.delete(awemeId);
} catch (e) {
if (/must be a numeric id/.test(e.message)) {
const digits = String(awemeId).match(/\d{10,}/); // try extracting from pasted URL
if (digits) return cli.delete(digits[0]);
} throw e;
} Prevention
- Strip share URLs down to the numeric aweme_id query param before calling
- Trim quotes/whitespace when copying ids from logs
- Validate with /^\d+$/ before invoking
When it happens
Trigger: Passing a full share URL or 'https://v.douyin.com/xxx' instead of the numeric id; passing an id with stray quotes, commas, or trailing characters; using an item_id/short_id that is non-numeric.
Common situations: Pasting a share link copied from the Douyin app instead of the numeric work id; whitespace or hidden characters from copy-paste; mixing up short video ids with aweme ids.
Related errors
- douyin delete aweme_id cannot be empty
- eastmoney convertible --limit must be an integer between 1 a
- INVALID_ARGUMENT
- limit must be a positive integer ≤ ${max}
- Novel download format must be txt or md
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/69a85297999d4773.
Report an issue: GitHub.