最新资讯
computerworld.com Box 发布 Architect:用自然语言构建业务流程工作流 the-decoder.com METR 称 Anthropic 或已在 7 月越过自身 AI 加速预警阈值 towardsdatascience.com 用 Ollama 和 Python 构建你的第一个多工具 AI Agent the-decoder.com Thinking Machines 的 Inkling 2 Small 称霸西方开放权重模型 dev.to 为 CI/CD 构建 AI 质量门禁 dev.to Kakao 发布面向 AI Agent 的决策模型 Kanana-2-v-decide computerworld.com Microsoft 对 Copilot Chat 企业用户扩大未公开的使用限制 pub.towardsai.net Google 发布 Gemini 4 Carbon:主打网络安全能力的前沿模型 gradientflow.com METR 研究:AI 正在加速构建 AI 的团队本身 www.infoq.com GitLab 19.5 将 Agentic 开发纳入 DevOps 平台的治理体系 aiacceleratorinstitute.com 研究:AI Agent 的复杂流程编排可能反而是问题所在 pub.towardsai.net MongoDB 推出 Vercel AI SDK 集成:为 AI 应用提供持久记忆
多元动态
登录 注册
智能体 dev.to · @Programming with Jack Chew

从服务器端读取小红书笔记究竟需要什么

原文 我的收藏

作者介绍让 AI Agent 读取小红书、抖音、TikTok、YouTube、X 链接时遇到的障碍:返回的 HTML 只有应用下载壳或登录墙,正文(视频、图片、图内文字)不在其中,剥离标签后一条真实小红书笔记只剩 264 个字符的导航内容。文章给出具体工程细节:yt-dlp 的 XiaoHongShuIE 只解析 note.video.media.stream,即视频笔记,占平台多数的图文笔记需从页面 state blob 的 imageList 解析;同一笔记 URL 用移动 UA 返回 202KB 应用壳、用桌面 UA 返回 85KB 真实内容,两者均为 HTTP 200;冷请求会被拒绝,需先抓取 /explore 并保留 acw_tc、abRequestId 等 cookie。作者同时推广其托管读取服务 LinkDigest(MCP server、REST API、Web 控制台),并自述在一条 17 图笔记上完成 17 张图片描述、381 个屏上文本片段、13 个要点、耗时 119 秒;文中声明 Bilibili 返回 HTTP 412、Instagram 已接入但未验证、Facebook 不在范围内。

AI推荐理由 作者以第一人称披露了抓取小红书图文笔记的具体工程细节:yt-dlp 的 XiaoHongShuIE 只处理视频笔记,图文笔记需从页面 state blob 的 imageList 解析;同一 URL 对移动 UA 返回 202KB 应用下载壳、对桌面 UA 返回 85KB 真实内容,且两者都是 HTTP 200;冷请求会被拒,需先访问 /explore 保留 acw_tc、abRequestId 等 cookie。这些是可复现的技术观察,对做 Agent 网页读取的开发者有参考价值。但文章同时是 LinkDigest 的产品推广,17 图笔记 381 个屏上文本片段、119 秒等指标来自作者自述,无第三方验证;Bilibili 412、Instagram 未验证、Facebook 不在范围等局限由作者主动说明,属加分项。整体是经验分享+软文混合,非官方或独立评测。

72

正文

Originally published at linkdigest.dev, where I build this. The problem, in one paragraph Paste a Xiaohongshu, Douyin, TikTok, YouTube or X link into an AI agent and it fetches the URL, gets an app-download shell or a login wall, and tells you there is nothing there. It is not wrong. The content of those posts is video, images, and text printed inside images, behind tokenised share links — none of it is in the HTML a fetch returns. Strip the tags from a real Xiaohongshu note and 264 characters of navigation are left. What LinkDigest does about it LinkDigest is a hosted reader: one call turns the link into text an LLM can use — a transcript with timecodes, the on-screen text, a description and OCR of every image, the caption and metadata — as Markdown or JSON. It is an MCP server (claude mcp add --transport http linkdigest https://linkdigest.dev/mcp --header "Authorization: Bearer $KEY"), a REST API, and a web console. Measured on a 17-image Xiaohongshu note: 17 images described and read, 381 on-screen text fragments, 13 key points, 119 seconds. Three digests are free, no card. What it does not do, stated up front: Bilibili refuses our server's address (HTTP 412), Instagram is wired but not verified, Facebook is out of scope. A digest that could not read part of a post says so in a degraded field instead of returning a thin result quietly — and a digest that read nothing costs nothing. Every claim here was checked against a live link. Where something doesn't work, it says so. Paste a Xiaohongshu link into an AI coding agent and it sees nothing. Same for Douyin. The usual answer — "just use yt-dlp" — is half true in a way that wastes an afternoon, so here is the whole picture. yt-dlp only reads half of Xiaohongshu XiaoHongShuIE reads note.video.media.stream. That is a video note. Image notes — 图文, a caption plus a stack of photos — are the majority of the platform and usually the ones worth reading, and the extractor has nothing to say about them. Getting those means parsing the note payload out of the page itself: the state blob the page ships, and the imageList inside it. Reusing yt-dlp's own js_to_json and traverse_obj for that keeps you aligned with upstream when the page shape shifts, which it does. The page is different depending on who you say you are This one cost me an embarrassing amount of time. Request a note with a mobile user agent and you get 202KB of app-download shell whose is just the site name. Request the same URL with a desktop user agent and you get 85KB containing the real note. Both are HTTP 200. Nothing tells you that you got the wrong one except that the content isn't there. [Diagram: The same note URL returns 202KB of app shell to a mobile user agent, and 85KB containing the note to a desktop one.] Cold requests are rejected Fetching a note URL directly, with no prior session, does not work. Fetch the /explore feed first, keep the cookie jar it gives you — acw_tc, abRequestId — and then the note loads. No account, no credentials, no API key. Just the same two-step a browser performs without you noticing. Douyin does not negotiate Coverage and output for Douyin: platforms/douyin. Douyin refuses anonymous requests outright: captcha on the web page, 403 from the APIs. There is no user-agent trick here. That path needs cookies from a logged-in session, and yt-dlp does not support the platform at all. YouTube blocks your server, not your laptop Coverage and output for YouTube: platforms/youtube. The single most common "it worked locally and broke in production" report. YouTube blocks datacenter IP ranges, so a yt-dlp fetch that is perfect on your machine fails from EC2, App Runner, Lambda or anywhere else you deploy — and no amount of configuration fixes an IP-range block. The workable fallback is a model that watches the video and returns a transcript, which costs meaningfully more than parsing captions and is worth measuring separately. Where it stops Being honest about this saves everyone time: Bilibili returns HTTP 412 to a datacenter address. Needs a residential proxy. Instagram and Facebook need a logged-in session for most posts. TikTok resolves fine but rate-limits under load; a frame fetch can come back 403 mid-job. The part nobody mentions: failure has to be loud The bug that taught me the most had nothing to do with extraction. A note was digested during a provider rate-limit storm. Every vision batch failed, the per-batch error handler swallowed each one, and the job returned images: 0, ocr: 0 — a perfectly well-formed, completely empty result. It was then written to a shared cache with a 30-day TTL. Long after the underlying problem was fixed, that link still returned nothing, because a cached answer is cheaper to serve than to recompute. The pipeline was healthy. The cache was serving a fossil, and nothing downstream could tell the difference between an empty result and an easy one. Two things came out of that: A step that loses content has to say so. The result now carries what failed, so a thin answer is distinguishable from a genuinely short post. Thin results get a short TTL, not the full one. Not "don't cache" — a link that fails every time would then re-run the full paid pipeline on every request forever. An hour bounds the staleness and the spend together. If you are building anything that caches derived content, that second one is the trap. The obvious fix is the expensive one. The findings are the same whether you use a hosted service or write your own. For how this fits into an agent's workflow end to end — the MCP tool, the job id for long media, what the output looks like — see Reading links your agent can't open.

来源报道 · 1 篇 · 以下链接均前往原始媒体

Programming with Jack Chew 从服务器端读取小红书笔记究竟需要什么 09-12 · 原文发布
← 返回精选动态 原文

更多内容