douyin-deep-profile-collect
深度采集抖音个人主页信息,包含基础资料、全部作品(含播放数)、喜欢列表、收藏列表、全量关注列表
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
深度采集抖音个人主页信息,包含基础资料、全部作品(含播放数)、喜欢列表、收藏列表、全量关注列表
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | douyin-deep-profile-collect |
| description | 深度采集抖音个人主页信息,包含基础资料、全部作品(含播放数)、喜欢列表、收藏列表、全量关注列表 |
| version | 2.0.0 |
本 Skill 用于深度采集抖音已登录用户的个人主页信息。通过访问 douyin.com/user/self,自动切换各 tab 页并滚动加载,提取用户的全维度数据。
主要功能:
适用场景:
⚠️ 执行约束:本 Skill 中的所有 JS 脚本都必须完整复制执行,不可自行简化、改写或省略任何部分。每个脚本都是经过实际测试验证的,简化会导致数据不完整(如关注列表只拿到前40条而非全量)。
无需任何参数,直接调用即可:
使用 douyin-deep-profile-collect 采集抖音个人信息
无。本 Skill 自动采集当前浏览器登录用户的信息。
工具:chrome_navigate
参数:
url: https://www.douyin.com/user/self说明:已登录态下 /user/self 自动跳转到当前用户个人主页。注意:不要传 active: false,否则无法获取 tabId。导航后等待 5 秒让页面完全加载。
输出:tab_id — 后续所有步骤复用此 tabId。
工具:chrome_execute_script
参数:
tabId: 步骤1返回的 tab_idworld: MAINtimeout: 20000脚本逻辑:
async () => {
// 滚动到底部加载全部作品
window.scrollTo({top: 0, behavior: 'instant'});
await new Promise(r => setTimeout(r, 300));
const h = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
window.scrollTo({top: h, behavior: 'smooth'});
await new Promise(r => setTimeout(r, 2000));
// 二次滚动确保加载完全
const h2 = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
if (h2 > h) {
window.scrollTo({top: h2, behavior: 'smooth'});
await new Promise(r => setTimeout(r, 1500));
}
window.scrollTo({top: 0, behavior: 'smooth'});
await new Promise(r => setTimeout(r, 500));
return JSON.stringify({
url: window.location.href,
title: document.title,
fullText: document.body.innerText
});
}
说明:个人主页默认显示「作品」tab。通过滚动触发懒加载,提取全文。返回数据中包含:
数据提取要点:
x.x万#标签工具:chrome_execute_script
参数:
tabId: 步骤1返回的 tab_idworld: MAINtimeout: 20000脚本逻辑:
async () => {
// 点击"喜欢" tab
const tabs = document.querySelectorAll('.semi-tabs-tab');
for (let t of tabs) {
if (t.textContent.trim() === '喜欢') { t.click(); break; }
}
await new Promise(r => setTimeout(r, 3000));
// 滚动加载更多
window.scrollTo({top: 0, behavior: 'instant'});
await new Promise(r => setTimeout(r, 300));
const h = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
window.scrollTo({top: h, behavior: 'smooth'});
await new Promise(r => setTimeout(r, 2000));
window.scrollTo({top: 0, behavior: 'smooth'});
await new Promise(r => setTimeout(r, 500));
return JSON.stringify({section: 'likes', fullText: document.body.innerText});
}
说明:抖音个人主页的 tab 使用 semi-tabs-tab CSS 类,通过遍历找到文本匹配的 tab 并点击切换。点击后等待 3 秒加载内容。
工具:chrome_execute_script
参数:
tabId: 步骤1返回的 tab_idworld: MAINtimeout: 20000脚本逻辑:与步骤3相同,但点击的是文本为 '收藏' 的 tab。
说明:收藏列表包含视频和音乐两个子分类。提取到的数据反映用户的深度兴趣偏好。
工具:chrome_execute_script
参数:
tabId: 步骤1返回的 tab_idworld: MAINtimeout: 10000脚本逻辑:
() => {
const divs = document.querySelectorAll('div.uvGnYXqn');
for (let d of divs) {
if (d.textContent.trim() === '关注') {
d.parentElement.click();
return JSON.stringify({ok: true});
}
}
return JSON.stringify({ok: false});
}
说明:点击个人资料区域的「关注」数字。重要:关注列表不是普通弹窗(modal/dialog),而是从右侧滑出的侧边面板(panel)。必须点击 div.uvGnYXqn(文字"关注")的 parentElement。
工具:chrome_execute_script
参数:
tabId: 步骤1返回的 tab_idworld: MAINtimeout: 90000脚本逻辑:
async () => {
await new Promise(r => setTimeout(r, 2000));
// 第一步:找到真正的可滚动容器
// ⚠️ 不能只找"包含最多 /user/ 链接的 div",那样会找到外层 overflow:visible 的 div
// 必须找 overflowY 为 'auto' 或 'scroll' 且包含 /user/ 链接的容器
let panel = null;
const allDivs = document.querySelectorAll('div');
for (let d of allDivs) {
const style = window.getComputedStyle(d);
const ov = style.overflowY;
if ((ov === 'auto' || ov === 'scroll') && d.scrollHeight > d.clientHeight) {
const links = d.querySelectorAll('a[href*="/user/"]').length;
if (links > 0) {
// 找最内层的可滚动容器(scrollHeight > clientHeight 说明有内容可滚)
if (!panel || d.scrollHeight < panel.scrollHeight) {
panel = d;
}
}
}
}
// 兜底:如果上面没找到(样式被覆盖),回退到找包含最多链接且 scrollHeight > clientHeight 的 div
if (!panel) {
let maxLinks = 0;
for (let d of allDivs) {
const links = d.querySelectorAll('a[href*="/user/"]').length;
if (links > maxLinks && d.scrollHeight > d.clientHeight + 100) {
maxLinks = links;
panel = d;
}
}
}
if (!panel) return JSON.stringify({error: 'no_panel'});
// 第二步:激进滚动加载 — 必须用 WheelEvent 触发虚拟滚动
const MAX_USERS = 500;
let prevH = 0, same = 0;
for (let i = 0; i < 200; i++) {
panel.scrollTop = panel.scrollHeight;
panel.dispatchEvent(new WheelEvent('wheel', {deltaY: 500, bubbles: true}));
await new Promise(r => setTimeout(r, 300));
const loaded = panel.querySelectorAll('a[href*="/user/"]').length;
if (loaded >= MAX_USERS) break;
if (panel.scrollHeight === prevH) {
same++;
if (same > 15) break;
} else {
same = 0;
}
prevH = panel.scrollHeight;
}
// 第三步:提取用户链接并去重
const users = [], seen = new Set();
panel.querySelectorAll('a[href*="/user/"]').forEach(a => {
const href = a.getAttribute('href') || '';
const name = a.textContent.trim();
if (name.length > 0 && name.length < 60 && !seen.has(href)) {
seen.add(href);
users.push({name: name.substring(0, 40), href: href});
}
});
const sampled = users.length >= MAX_USERS;
return JSON.stringify({count: users.length, users: users.slice(0, MAX_USERS), sampled, total_following: '见个人主页关注数'});
}
说明:这是整个工作流最关键的步骤。
⚠️ 必须完整复制上方脚本执行,不可简化或自己重写!
面板定位的关键Bug修复(v2.5.3):
之前的逻辑是"找包含最多 /user/ 链接的 div",但这会找到外层容器(overflow: visible,scrollHeight === clientHeight),不是真正的滚动容器。对着这个外层 div 做 WheelEvent 和 scrollTop 完全无效,导致只拿到初始渲染的约40条。
正确的定位方式:找 overflowY === 'auto' 或 'scroll' 且 scrollHeight > clientHeight 的容器。这才是真正可以滚动的面板。
关注面板的关键特性:
最终结果:此步骤返回全量关注用户列表(昵称 + 主页链接)。如果返回数量远少于个人主页显示的关注数,说明面板定位可能有误。
工具:chrome_close_tabs
参数:
tabIds: [步骤1返回的 tab_id]说明:清理浏览器资源。
采集完成后,汇总各步骤数据(以下为字段结构示例,实际值取决于当前登录用户):
{
"platform": "douyin",
"profile": {
"nickname": "用户昵称",
"gender": "男/女",
"location": "省份·城市",
"douyinId": "抖音号",
"bio": "个人简介",
"following": "关注数",
"fans": "粉丝数",
"likes": "获赞数"
},
"works": [
{"title": "作品标题 #标签1 #标签2", "plays": "播放数"}
],
"liked_videos": [
{"title": "点赞过的视频标题", "plays": "播放数"}
],
"favorites": [
{"title": "收藏的视频标题", "plays": "播放数"}
],
"following_users": [
{"name": "关注的用户昵称", "href": "//www.douyin.com/user/..."}
],
"following_count": "全量关注用户数"
}
Tab 切换机制
semi-tabs-tab CSS 类.click() 切换,不是 URL 变化关注面板虚拟滚动
overflowY: auto/scroll 且 scrollHeight > clientHeight 的可滚动容器,不能只找包含最多链接的 div(那会找到外层不可滚动的 div)tabId 获取
chrome_navigate 不带 active: false 才能获取 tabId_meta.context.relatedTabs 提取login 或 passport{ok: false}div.uvGnYXqn 选择器可能因页面改版失效。用 chrome_get_interactive_elements 查找新的关注入口overflow: visible 的 div 而非真正的滚动容器overflowY === 'auto' || 'scroll' 来定位面板,不是仅靠链接数量semi-tabs-tab 类名可能更新。用 chrome_get_interactive_elements 查找 tab 元素Collect user data from logged-in social platforms (Douyin, Xiaohongshu, Weibo, Douban, Bilibili), cross-analyze to build a precise personal profile, and auto-generate USER.md + MEMORY.md. Use for new user onboarding, personalization, and building user context. 通过用户已登录的社交平台自动采集数据并交叉分析,生成精准用户画像,写入 USER.md 和 MEMORY.md。
采集小红书个人主页的全量信息,包括基础资料、全部发布笔记(含详情正文和标签)、收藏笔记列表(全量)、点赞笔记列表(全量)
采集豆瓣当前登录用户的全量个人信息,包括基础资料、看过/想看的电影、读过/想读的书、广播动态
采集B站当前登录用户的全量个人信息,包括基础资料、投稿视频、收藏夹内容、关注列表
采集微博个人主页的全量信息,包括基础资料($CONFIG.user)、全部微博、关注列表、收藏列表