Collect and manage Bilibili personalization items: garb suits, digital card collections, and benefit sub-items.
All authentication credentials are read from environment variables or a config file. Create configs/bili-api-creds.json in your workspace:
json
{
"appkey": "27eb53fc9058f8c3",
"appsecret": "<obtain from Bilibili mobile client>",
"access_key": "<your access_key>",
"csrf": "<your bili_jct>",
"DedeUserID": "<your uid>",
"SESSDATA": "<your SESSDATA>"
}
Or export environment variables:
bash
export BILI_SESSDATA="<your SESSDATA>"
export BILI_ACCESS_KEY="<your access_key>"
export BILI_CSRF="<your bili_jct>"
export BILI_UID="<your uid>"
How to obtain credentials: Capture from Bilibili mobile app HTTP traffic (e.g., mitmproxy, Charles). The
access_keyexpires periodically and must be refreshed.
bash
bash scripts/bilibili-garb-search.sh "关键词"
Searches both the official API and a local gallery database. Outputs Markdown with:
biz_iditem_id[藏馆-绝版]bash
bash scripts/bilibili-garb-collection.sh -i <ID>
bash
python3 scripts/garb-benefit-scan.py [options]
Scans owned garb items from data/decorations-database.json, calls benefit API for each, and appends results to data/garb-benefit-results.ndjson.
Options:
--limit N — process only N items--dry-run — show what would be scanned without making API calls--force — rescan items that already have benefit data--debug — output full API responsesSupports resume (Ctrl+C safe) and deduplication.
See references/bilibili-garb-api-reference.md for full API documentation.
Critical points:
/x/garb/v2/user/suit/benefit) is the only way to get data for discontinued items. Requires sign authentication.item_id contains a hyphen (e.g., 1775103232001-0), pass biz_id as the item_id parameter instead — the original item_id returns -400.part parameter: Only one call with part=space_bg returns all 9 sub-item types. No need to iterate.item_list API's scarcity field as the primary source. When scarcity_rate=2 and rate2_count==1, default to small-hidden (30), do not auto-upgrade to large-hidden.lottery_home_detail, never from collection's own frame/ frame_image.See references/bilibili-garb-sop.md for step-by-step workflows.