Peach: Local-first video metadata scraper and media manager.
fix(follow): resolve F95 links and gate Mix by videos
longmeidaobaa6c8179c90
diff --git a/docs/HANDOFF.md b/docs/HANDOFF.mdindex e957d6ed1..0e4ac29d7 100644--- a/docs/HANDOFF.md+++ b/docs/HANDOFF.md@@ -73,6 +73,8 @@ Claude 的 `.claude/settings.json` 已配置 Stop、StopFailure、SessionEnd hoo具体快照、URL、版本、SHA 与 Peach 差异统一登记在 `docs/reference-sources.json` 和`docs/reference-snapshots/`;获取、失效复核与接受更新的流程见`.claude/skills/peach-reference-evidence/SKILL.md`。本文件不再复制会随上游变化的测量值。+F95 masked 链接与 Gofile 文件列表的凭据边界见 `f95-masked-gofile-media`;Mix 只按已解析且+可播放的视频计数,不按回复数或网盘页数计数。## 批处理边界diff --git a/docs/REUSE.md b/docs/REUSE.mdindex fa1f61e8d..9be4ebe6d 100644--- a/docs/REUSE.md+++ b/docs/REUSE.md@@ -21,7 +21,7 @@|---|---|---|| HTTP | 全项目共用的 `httpx.Client`/transport | 来源策略、DTO、脱敏 || RSS/Atom | `feedparser` | 有界抓取、快照、复核、导入 |-| 追更来源接口 | kemono 系公开 JSON API(`Accept: text/css`,站点自述的抓取路径)、rule34.xxx 官方 dapi(需账号 API key)、f95zone `latest_data.php` 与线程页 | 连接器边界、凭据隔离、变体与跨站重复判定、候选复核与批准后的 online asset 投影 |+| 追更来源接口 | kemono 系公开 JSON API(`Accept: text/css`,站点自述的抓取路径)、rule34.xxx 官方 dapi(需账号 API key)、f95zone `latest_data.php`、线程页与站内 masked XHR | 连接器边界、凭据隔离、文件站目标校验、变体与跨站重复判定、候选复核与批准后的 online asset 投影 || HTML 适配器 | Beautiful Soup 或 selectolax | 来源专用选择器和来源记录 || 位图 | Pillow | 头像/Logo 质量和来源策略 || 搜索 | SQLite FTS5 | 索引字段、排序、profile 感知筛选 |diff --git a/docs/reference-snapshots/f95-masked-gofile-media.md b/docs/reference-snapshots/f95-masked-gofile-media.mdnew file mode 100644index 000000000..1a1896233--- /dev/null+++ b/docs/reference-snapshots/f95-masked-gofile-media.md@@ -0,0 +1,36 @@+# F95 掩码链接与 Gofile 文件列表证据++- 取证日期:2026-08-28+- 用途:F95 回复里的媒体链接判定、Cookie 边界、Mix 触发条件。+- 凭据保护:取证只记录请求形状、状态、哈希和脱敏后的目标域名;Cookie 与令牌值未记录。++## F95 masked 链接++脚本:`https://f95zone.to/assets/js/masked.js`++- 响应:HTTP 200,1,255 字节。+- SHA-256:`E4863BA97D84C2B2FC459300F7621BEA5467FB922022FA139551154B6D9351E0`。+- 当前协议:向原 masked 路径 POST `xhr=1&download=1`,JSON 的 `status=ok` 时从+ `msg` 读取真实目标;服务也可能返回验证码状态。+- 已配置的 F95 Cookie 对样本请求有效,分别解析到 Gofile 与 Pixeldrain。Cookie 只应发送到+ `f95zone.to`,不能发送到解析后的文件站。++Peach 因此只把真实文件分发域或未解析的 masked 路径当成媒体候选;普通外链不计入视频数。++## Gofile 公开分享++官方页面与模块:++| 资源 | HTTP | 字节 | SHA-256 |+| --- | ---: | ---: | --- |+| `https://gofile.io/js/app.js` | 200 | 1,295 | `F1D7218BFC02E7260A145E0FA207A09238DF264F8E2A0F5977BD95DA8BC8B01A` |+| `https://gofile.io/js/pages/files.js` | 200 | 3,163 | `2F2675E7291EE61A159867EE03773A7F2382140149A5779DFE1819CFBB59E437` |+| `https://gofile.io/js/services/contents.js` | 200 | 7,226 | `C57C3E499A6C46F6212568EC810671C0C11C6034900466318CE4A39DB5B56DC3` |++当前网页通过 `GET /contents/{contentId}` 取目录,并同时发送 Bearer token 与短期+`X-Website-Token`。官方 API 文档也要求 Authorization token。无令牌返回 `error-token`;官网同款+游客令牌配网页签名访问两个样本都返回 `error-notPremium`。应用内浏览器打开样本页的导航超时,实时+DOM 与视觉结果为**未取得**。++结论:F95 Cookie 只能取得 Gofile 分享页,不能代替 Gofile 的账号令牌。没有取得实际文件列表时,+Peach 不把一个分享页或一条回复称为视频;只有至少两个已解析且可播放的视频才显示 Mix。diff --git a/docs/reference-sources.json b/docs/reference-sources.jsonindex 99ae0c61f..801b76c82 100644--- a/docs/reference-sources.json+++ b/docs/reference-sources.json@@ -65,6 +65,21 @@"tests/test_follow_sources.py","tests/test_follow_web.py"]+ },+ {+ "id": "f95-masked-gofile-media",+ "name": "F95 掩码链接与 Gofile 文件列表证据",+ "url": "https://f95zone.to/assets/js/masked.js",+ "snapshot": "docs/reference-snapshots/f95-masked-gofile-media.md",+ "checked_on": "2026-08-28",+ "sha256": "b4fa8a7c397f330ed2f2880fe0dbc1bc7a34e47bb91d935e5f42f2c9502f206d",+ "role": "F95 Cookie 解掩码、文件站目标校验、Gofile 文件列表未取得说明与 Mix 计数边界。",+ "consumers": [+ "src/peach/follow_sources.py",+ "web/app.js",+ "tests/test_follow_sources.py",+ "tests/test_follow_web.py"+ ]}]}diff --git a/src/peach/follow_sources.py b/src/peach/follow_sources.pyindex f7ffc520e..6b7af2dd5 100644--- a/src/peach/follow_sources.py+++ b/src/peach/follow_sources.py@@ -61,14 +61,24 @@ def resource_links(text: str | None) -> list[str]:"""found = []for link in _LINK_RE.findall(text or ""):- host = (urllib.parse.urlsplit(link).hostname or "").lower()- host = host[4:] if host.startswith("www.") else host- if any(host == domain or host.endswith("." + domain)- for domain in _FILE_HOST_DOMAINS):+ if _is_resource_url(link):found.append(link)return found+def _is_resource_url(url: str) -> bool:+ try:+ parsed = urllib.parse.urlsplit(url)+ except ValueError:+ return False+ host = (parsed.hostname or "").lower()+ host = host[4:] if host.startswith("www.") else host+ return parsed.scheme == "https" and any(+ host == domain or host.endswith("." + domain)+ for domain in _FILE_HOST_DOMAINS+ )++@dataclass(frozen=True)class FollowCandidate:"""一个未经复核的追更候选。"""@@ -294,6 +304,21 @@ class _BaseConnector:raise FollowSourceError(f"{self.provider} 响应超出大小上限")return response+ def _post(self, url: str, body: bytes, *,+ headers: Mapping[str, str] | None = None) -> HttpResponse:+ if self.blocked_reason:+ raise FollowSourceError(self.blocked_reason)+ merged = self._headers()+ merged.update(headers or {})+ try:+ response = self.transport(HttpRequest("POST", url, merged, body),+ self.timeout, self.max_bytes)+ except (OSError, httpx.HTTPError) as exc:+ raise FollowSourceError(f"{self.provider} 请求失败") from exc+ if len(response.body) > self.max_bytes:+ raise FollowSourceError(f"{self.provider} 响应超出大小上限")+ return response+@staticmethoddef _conditional(response: HttpResponse) -> dict[str, str | None]:headers = {key.lower(): value for key, value in response.headers.items()}@@ -805,11 +830,10 @@ class F95ZoneConnector(_BaseConnector):主贴的版本号更新常常滞后于回复——真正的新链接先出现在楼下——所以这里读的是线程的 `/latest` 页而不是主贴;`latest_data.php` 另给线程当前的 `version` 与时间戳。- **发现不需要登录,取媒体需要。** 2026-08-25 实测 `/latest` 页在无 cookie 下- 完整返回回复正文与外链(`/masked/...` 之类),所以追更判定本身不吃凭据;但- `attachments.f95zone.to` 上的附件图片和 `masked` 链接的真实跳转要登录会话才拿得到。- 候选因此带 `media_needs_credential`,下载动作必须先看这个标志,不要拿 403 的- 附件冒充「已保存」。+ **发现不需要登录,解析 masked 链接需要。** 2026-08-28 实测 `/latest` 页在无+ cookie 下完整返回回复正文与 `/masked/...`;配置 cookie 后向同一路径 POST+ `xhr=1&download=1` 才返回真实网盘 URL。cookie 只发回 f95zone.to,绝不跟着+ 真实链接送到 Gofile / Pixeldrain。`ref` 是线程 id,例如 `50685`。"""@@ -819,6 +843,7 @@ class F95ZoneConnector(_BaseConnector):_THREAD_RE = re.compile(r"^\d{1,12}$")#: latest_data.php 按分类分库,线程不在哪个分类里事先不知道,只能逐个试。CATEGORIES = ("games", "animations", "comics", "assets", "mods")+ _MASKED_PATH_RE = re.compile(r"^/masked/", re.IGNORECASE)def fetch(self, ref: str, *, etag: str | None = None,last_modified: str | None = None, page: int = 0) -> SourceFetch:@@ -876,22 +901,76 @@ class F95ZoneConnector(_BaseConnector):str(node.get("href")) for node in (body.select("a[href]") if body else [])if str(node.get("href", "")).startswith("http")]+ media_links, needs_credential = self._media_links(links)yield FollowCandidate(provider=self.provider,external_id=post_id,title=thread_title,url=f"https://f95zone.to/threads/{thread}/post-{post_id}",- media_url=links[0] if links else None,+ media_url=media_links[0] if media_links else None,published_at=_iso_from_text(time_node.get("datetime"))if time_node is not None else None,author=_plain_text(str(article.get("data-author") or "")) or None,summary=_plain_text(body.get_text(" ")) if body else None,- extra={"thread_id": thread, "link_count": len(links),- "links": links[:8],- # 发现是公开的,取媒体不是:附件与 masked 跳转都要登录会话。- "media_needs_credential": True},+ extra={"thread_id": thread, "link_count": len(media_links),+ "links": media_links[:8],+ "media_needs_credential": needs_credential},)+ def _media_links(self, links: list[str]) -> tuple[list[str], bool]:+ """只保留文件分发链接,并用本机 F95 会话解开 masked URL。"""+ cookie = str(self.credential.values.get("cookie") or "") \+ if self.credential else ""+ media: list[str] = []+ needs_credential = False+ for link in links:+ if self._is_masked(link):+ target = self._resolve_masked(link, cookie) if cookie else None+ if target is None:+ needs_credential = True+ media.append(link)+ elif target not in media:+ media.append(target)+ continue+ if _is_resource_url(link) and link not in media:+ media.append(link)+ return media, needs_credential++ @classmethod+ def _is_masked(cls, url: str) -> bool:+ try:+ parsed = urllib.parse.urlsplit(url)+ except ValueError:+ return False+ host = (parsed.hostname or "").casefold()+ return (parsed.scheme == "https"+ and (host == "f95zone.to" or host.endswith(".f95zone.to"))+ and bool(cls._MASKED_PATH_RE.match(parsed.path)))++ def _resolve_masked(self, url: str, cookie: str) -> str | None:+ # masked.js 使用同路径 XHR POST。失败只让这一条维持「需会话」,不能让整个+ # 线程的公开发现一起失败。+ try:+ response = self._post(+ url,+ b"xhr=1&download=1",+ headers={+ "Accept": "application/json",+ "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",+ "Cookie": cookie,+ "X-Requested-With": "XMLHttpRequest",+ },+ )+ if response.status != 200:+ return None+ payload = self._json(response)+ except FollowSourceError:+ return None+ if not isinstance(payload, dict):+ return None+ target = str(payload.get("msg") or "")+ return target if payload.get("status") == "ok" and _is_resource_url(target) else None+def thread_index(self, category: str, query: str) -> tuple[dict, ...]:"""在 `latest_data.php` 里按名字查线程;用于登记订阅时确认 id 与版本。"""if category not in self.CATEGORIES:diff --git a/tests/test_follow_sources.py b/tests/test_follow_sources.pyindex 0bb5d7947..3a0084d8f 100644--- a/tests/test_follow_sources.py+++ b/tests/test_follow_sources.py@@ -515,6 +515,17 @@ class PagingBackTests(unittest.TestCase):class F95ZoneConnectorTests(unittest.TestCase):+ @staticmethod+ def _masked_transport(record):+ def call(request, timeout, max_bytes):+ record.append(request)+ if request.method == "GET":+ return HttpResponse(200, {}, F95_HTML)+ return HttpResponse(200, {}, json.dumps({+ "status": "ok", "msg": "https://gofile.io/d/oOdYTK",+ }).encode())+ return call+def test_latest_page_yields_replies_not_just_the_opening_post(self):seen = []result = F95ZoneConnector(@@ -546,6 +557,33 @@ class F95ZoneConnectorTests(unittest.TestCase):result = F95ZoneConnector(transport=_transport(body=F95_HTML)).fetch("50685")self.assertTrue(result.candidates[0].extra["media_needs_credential"])+ def test_cookie_resolves_masked_media_without_leaking_to_the_file_host(self):+ seen = []+ result = F95ZoneConnector(+ transport=self._masked_transport(seen),+ credential=Credential("f95zone", {"cookie": "xf=1"}),+ ).fetch("50685")+ candidate = result.candidates[0]+ self.assertEqual(candidate.media_url, "https://gofile.io/d/oOdYTK")+ self.assertEqual(candidate.extra["links"], ["https://gofile.io/d/oOdYTK"])+ self.assertFalse(candidate.extra["media_needs_credential"])+ self.assertEqual([request.method for request in seen], ["GET", "POST"])+ self.assertEqual(seen[1].url,+ "https://f95zone.to/masked/gofile.io/50685/abc")+ self.assertEqual(seen[1].headers["Cookie"], "xf=1")+ self.assertEqual(seen[1].body, b"xhr=1&download=1")+ self.assertFalse(any("gofile.io/d/" in request.url for request in seen))++ def test_non_file_links_do_not_turn_a_reply_into_media(self):+ body = F95_HTML.replace(+ b"https://f95zone.to/masked/gofile.io/50685/abc",+ b"https://example.com/creator",+ )+ result = F95ZoneConnector(transport=_transport(body=body)).fetch("50685")+ self.assertIsNone(result.candidates[0].media_url)+ self.assertEqual(result.candidates[0].extra["link_count"], 0)+ self.assertFalse(result.candidates[0].extra["media_needs_credential"])+def test_only_absolute_links_count_as_media(self):result = F95ZoneConnector(transport=_transport(body=F95_HTML)).fetch("50685")self.assertEqual(result.candidates[0].media_url,diff --git a/tests/test_follow_web.py b/tests/test_follow_web.pyindex 32022c8ec..8bcc31340 100644--- a/tests/test_follow_web.py+++ b/tests/test_follow_web.py@@ -1179,6 +1179,8 @@ class FollowWebSourceTests(unittest.TestCase):self.assertPageContains('class="followorigin" href="${esc(item.url)}" target="_blank"')self.assertPageContains('title="打开来源页面" aria-label="打开来源页面"')self.assertNotIn('打开来源页面</a>', self.page)+ self.assertPageContains(".followdetailtitle{display:flex;gap:5px")+ self.assertPageContains(".followmedianote{margin:18px 0 14px}")self.assertPageContains("followAuthorAvatar(authorSources)")self.assertPageContains("followTagChip(item,tag,'button')")self.assertPageContains(".followdetailtags .tg{max-width:none")@@ -1413,16 +1415,22 @@ class FollowWebSourceTests(unittest.TestCase):self.assertPageContains("author:input.dataset.author")def test_credential_dependent_media_is_called_out(self):- self.assertPageContains("媒体需要登录会话才能取,发现本身不需要")+ self.assertPageContains("媒体链接需要 F95 登录会话解析")+ self.assertPageContains("已取得外部文件页;视频列表未取得")def test_follow_styles_exist_for_the_card_surface(self):for selector in (".followlist{", ".followitem{", ".fbadge{", ".followqueue"):self.assertPageContains(selector)def test_follow_cards_reuse_home_cards_hover_actions_and_mix_stacks(self):- self.assertPageContains('class="card followitem${collection.length>1?\' collection\':\'\'}"')- self.assertPageContains("collection.length>1?'mixstack '")+ self.assertPageContains("function followVideoItems(group)")+ self.assertPageContains("item.playable&&item.media_kind==='video'")+ self.assertPageContains('class="card followitem${isMix?\' collection\':\'\'}"')+ self.assertPageContains("isMix?'mixstack '")self.assertPageContains('class="mixbadge" data-follow-collection=')+ self.assertPageContains("${videos.length} 个视频")+ self.assertPageContains("const collection=group&&followVideoItems(group).length>1?group:null")+ self.assertPageContains("const items=followVideoItems(group)")self.assertPageContains(".factions{position:absolute;right:10px;top:10px")self.assertPageContains("@media (hover:hover) and (pointer:fine){.followitem:hover .factions")self.assertPageContains("function followQueueHtml(group,itemId)")diff --git a/tests/test_reference_updates.py b/tests/test_reference_updates.pyindex 516cbbf08..263bffdbf 100644--- a/tests/test_reference_updates.py+++ b/tests/test_reference_updates.py@@ -29,7 +29,8 @@ class ReferenceUpdateTests(unittest.TestCase):self.assertEqual(set(sources),{"vercel-report-design", "vercel-web-interface-guidelines",- "fiu758-studio-logo-discovery", "rule34-follow-tags-and-collections"},+ "fiu758-studio-logo-discovery", "rule34-follow-tags-and-collections",+ "f95-masked-gofile-media"},)self.assertNotEqual(sources["vercel-report-design"]["url"],diff --git a/web/app.css b/web/app.cssindex 27b7ebab9..08ff65bfc 100644--- a/web/app.css+++ b/web/app.css@@ -1249,10 +1249,10 @@ body.drawer-open .edge{opacity:0;pointer-events:none} /* 展开时窄栏让位.fvkind.wip{color:var(--meter)}.fvkind.alt{color:var(--tungsten)}.followdetailmedia{min-height:min(62vh,640px)}.followdetailposter{position:relative;z-index:1;display:block;width:100%;height:100%;max-height:76vh;object-fit:contain;background:#000}.followdetailplaceholder{display:grid;place-items:center;gap:10px;color:var(--muted)}.followdetailplaceholder .ficon{width:34px;height:34px;margin:0}-.followdetailtitle{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:9px;align-items:start;margin-bottom:8px}.followdetailtitle .stitle{margin:0}.followdetailtitle .followorigin{width:30px;height:30px;margin:0;display:grid;place-items:center;border-radius:7px}.followdetailtitle .followorigin:hover{background:var(--hover)}+.followdetailtitle{display:flex;gap:5px;align-items:flex-start;margin-bottom:8px}.followdetailtitle .stitle{width:auto;max-width:calc(100% - 35px);margin:0}.followdetailtitle .followorigin{flex:none;width:30px;height:30px;margin:0;display:grid;place-items:center;border-radius:7px}.followdetailtitle .followorigin:hover{background:var(--hover)}.followdetailidentity{display:flex;align-items:center;gap:10px;margin:2px 0 12px}.followdetailidentity .mav{flex:none}.followdetailidentity b,.followdetailidentity span{display:block}.followdetailidentity>div>span{margin-top:3px;color:var(--muted);font-size:var(--fs-xs)}.followdetailsummary{margin:0 0 16px;line-height:1.6;color:var(--ink-2);white-space:pre-line}.followdetailtags .tg{max-width:none;overflow:visible;text-overflow:clip;white-space:normal;text-align:left;color:var(--ink-2);font-family:inherit}.followqueue .mixitempic>.fnothumb{position:static;width:100%;height:100%}-.followdetailactions button:disabled{opacity:.45;cursor:default}.followorigin{display:inline-flex;align-items:center;gap:7px;width:max-content;margin-top:auto;color:var(--muted);text-decoration:none}.followorigin svg{width:16px;height:16px;stroke:currentColor;fill:none}.followorigin:hover{color:var(--ink);text-decoration:none}+.followmedianote{margin:18px 0 14px}.followdetailactions{margin-top:2px}.followdetailactions button:disabled{opacity:.45;cursor:default}.followorigin{display:inline-flex;align-items:center;gap:7px;width:max-content;margin-top:auto;color:var(--muted);text-decoration:none}.followorigin svg{width:16px;height:16px;stroke:currentColor;fill:none}.followorigin:hover{color:var(--ink);text-decoration:none}@media (max-width:640px){.followhead{align-items:center}.follow .fcheck{height:36px;padding:0 13px}.followauthors{margin-right:-12px;padding-top:3px}.followfilters{margin-right:-12px;padding-right:12px}}diff --git a/web/app.js b/web/app.jsindex b1b9cdd4e..8bbbe516b 100644--- a/web/app.js+++ b/web/app.js@@ -1326,6 +1326,20 @@ function followCollectionItems(group){if(!item||seen.has(item.id))return false;seen.add(item.id);return true});}+// F95 的「8 条动态」可能只有一个网盘页,也可能一条实际视频都没有。Mix 是播放+// 语义,只能由已解析、可在 Peach 内播放的视频触发,不能拿回复数或外链数冒充。+function followVideoItems(group){+ return followCollectionItems(group).filter(item=>+ item.playable&&item.media_kind==='video');+}++function followMediaNote(item){+ if(item.media_needs_credential)return '媒体链接需要 F95 登录会话解析';+ if(item.has_media&&!item.playable&&item.media_kind==='external')+ return '已取得外部文件页;视频列表未取得';+ return '';+}+/* 集合弹层沿用原来的动态语义:线程标题不能冒充每条回复的正文,行首则说明它与主条目的关系。 */function followCollectionCopy(group,item,mark=''){@@ -1338,8 +1352,8 @@ function followCollectionCopy(group,item,mark=''){}function followQueueHtml(group,itemId){- const items=followCollectionItems(group);- return `<aside class="mixqueue followqueue"><div class="mixqueuehead"><div><h2>${esc(group.primary.title||'视频集合')}</h2><span>${items.length} 个${items.some(item=>item.has_media)?'视频':'条目'}</span></div><div class="mixqueueactions">+ const items=followVideoItems(group);+ return `<aside class="mixqueue followqueue"><div class="mixqueuehead"><div><h2>${esc(group.primary.title||'视频集合')}</h2><span>${items.length} 个视频</span></div><div class="mixqueueactions"><button data-follow-queue-close title="关闭" aria-label="关闭">${icon('x')}</button></div></div><div class="mixlist">${items.map(item=>{const copy=followCollectionCopy(group,item,group.duplicates.includes(item)?item.provider_label:'');const thumb=item.thumb_url@@ -1373,7 +1387,7 @@ async function openFollowDetail(id,push=true){if(!push)followDetailReturnPath='/follow';const item=await followItemById(+id);if(!item)return;const group=followGroupByItemId.get(item.id);- const collection=group&&followCollectionItems(group).length>1?group:null;+ const collection=group&&followVideoItems(group).length>1?group:null;disposeStage(false);if(push)route(`/follow/item/${item.id}`);const source=(followData?.sources||[]).find(row=>row.id===item.source_id);@@ -1403,7 +1417,7 @@ async function openFollowDetail(id,push=true){<div class="smeta mono"><span>${followWhen(item)}</span>${item.duration?`<span>${fmtDur(item.duration)}</span>`:''}${badges?`<span class="fbadges">${badges}</span>`:''}</div>${item.summary?`<p class="followdetailsummary">${esc(item.summary)}</p>`:''}${tags?`<div class="stags followdetailtags">${tags}</div>`:''}- ${item.media_needs_credential?'<p class="fnote">媒体需要登录会话才能取,发现本身不需要</p>':''}+ ${followMediaNote(item)?`<p class="fnote followmedianote">${esc(followMediaNote(item))}</p>`:''}<div class="fb followdetailactions"><button class="later" data-follow-detail-save aria-label="${item.status==='saved'?'已保存':'保存到账本'}" title="${item.status==='saved'?'已保存':'保存到账本'}"${item.status==='saved'?' disabled':''}>${item.status==='saved'?icon('check'):icon('bookmark-plus')}</button><button class="seen" data-follow-detail-status="seen" aria-label="标记已看" title="标记已看" aria-pressed="${item.status==='seen'}">${icon('eye')}</button>@@ -1449,16 +1463,16 @@ function followCard(group,authorSources=[]){const thumb=item.thumb_url? `<img src="${esc(item.thumb_url)}" alt="" loading="lazy" referrerpolicy="no-referrer" onerror="this.remove()">`: `<span class="fnothumb">${esc(item.provider_label)}</span>`;- const collection=followCollectionItems(group),collectionCount=collection.filter(row=>row.has_media).length;+ const videos=followVideoItems(group),isMix=videos.length>1;const badges=followBadges(group);const tags=(item.tags||[]).slice(0,3).map(tag=>followTagChip(item,tag)).join('');const open=`<button class="cardopenhit" data-follow-detail="${item.id}" aria-label="打开 ${esc(item.title)} 详情"></button>`;- return `<article class="card followitem${collection.length>1?' collection':''}" data-follow-item="${item.id}" data-status="${esc(item.status)}">- <div class="${collection.length>1?'mixstack ':''}followvisual"><div class="pic">+ return `<article class="card followitem${isMix?' collection':''}" data-follow-item="${item.id}" data-status="${esc(item.status)}">+ <div class="${isMix?'mixstack ':''}followvisual"><div class="pic">${open}${thumb}<span class="badge" title="${esc(item.provider_label)}" aria-label="来源:${esc(item.provider_label)}">${sourceIcon(item.provider)}</span><span class="selectionMark">${icon('check')}</span>${item.duration?`<span class="dur mono">${fmtDur(item.duration)}</span>`:''}- ${collection.length>1?`<button class="mixbadge" data-follow-collection="${item.id}">${icon('play')}${collectionCount||collection.length} 个${collectionCount?'视频':'条目'}</button>`:''}+ ${isMix?`<button class="mixbadge" data-follow-collection="${videos[0].id}">${icon('play')}${videos.length} 个视频</button>`:''}<div class="factions"><button data-follow-save="${item.id}" title="${item.status==='saved'?'已保存':'保存到账本'}" aria-label="${item.status==='saved'?'已保存':'保存到账本'}"${item.status==='saved'?' disabled':''}>${item.status==='saved'?icon('check'):icon('bookmark-plus')}</button><button data-follow-status="${item.id}" data-to="seen" title="标记已看" aria-label="标记已看"${item.status==='seen'?' disabled':''}>${icon('eye')}</button>@@ -1468,7 +1482,7 @@ function followCard(group,authorSources=[]){<div class="meta"><span class="mav fsourceavatar" title="作者头像">${followAuthorAvatar(authorSources)}</span><div class="mtext"><button class="t cardtitle" data-follow-detail="${item.id}">${esc(item.title)}</button><div class="s mono"><span>${followWhen(item)}</span>${badges?`<span class="fbadges">${badges}</span>`:''}</div>- ${tags?`<div class="ctags">${tags}</div>`:''}${item.media_needs_credential?'<span class="fnote">媒体需要登录会话才能取,发现本身不需要</span>':''}</div></div>+ ${tags?`<div class="ctags">${tags}</div>`:''}${followMediaNote(item)?`<span class="fnote">${esc(followMediaNote(item))}</span>`:''}</div></div><span class="fstate" aria-live="polite"></span></article>`;}