Commit Graph
1016 Commits
Author SHA1 Message Date
ForgQi ea3298340f Bump workspace version to 1.2.6 and update docs
Update workspace package version from 1.2.5 to 1.2.6 in Cargo.toml and synchronize package versions in Cargo.lock (biliup, biliup-cli, danmaku, stream-gears). Also add a README bullet noting streaming-upload without local save (边录边传 0 落盘).
2026-09-21 23:07:55 +08:00
NoahandAluneu f06efbb3b9 feat(ui): 前端整体重设计与统一(接手 #1653) (#1704)
* feat(ui): 前端整体重设计与统一(接手 #1653)

来自 Aluneu 的 PR #1653(head bdcfbea),在 master 4e156ac 上重新落地。
相对原 PR 的差异:
- 剔除 logo / favicon / logo.svg 品牌资产变更,侧栏与登录页仍用 public/logo.png
- 解决与 master 的三处冲突:upload-manager add/edit 的 studioEntity 补回 #1699 的 tid_v2;
  global.tsx 下载插件说明补上 mesio(9d02856)
- README.md 相关提交在原 PR 合并上游时已归零,此处不含

主要内容:
- PageHeader / SectionTitle / data-card 统一页头与卡片容器,status.tsx 作为状态视觉的唯一来源
- 侧栏自绘重写:5 组 9 项、服务状态指示、折叠偏好持久化、移动端抽屉
- 首页从外链 iframe 改为本地数据的控制台(KPI / 进行中 / 未开播 / 24h 事件流)
- 直播管理:搜索、平台筛选、网格/列表双视图、批量暂停/删除;接口失败不再被当作空列表
- 新增 /changelog 页,运行时拉取官方 CHANGELOG,带 localStorage 离线缓存
- 全局自定义背景:仅本地图片,canvas 重绘为 JPEG data URL,2MB 上限
- 修复:根 layout 与 (app)/layout 双重 <html>/<body>、主题水合闪烁、扫码登录无保护取值崩溃、
  弹窗内 width:1000 横向溢出、移动端抽屉被遮罩拦截
- 后处理 {cmd,value} ↔ HookStep 转换抽成 lib/postprocessor.ts
- 12 个平台插件文案精简

* fix(ui): 空间配置平台列表改为遍历插件注册表

dashboard 里硬编码的 PLATFORM_LIST 让新增平台插件要改第三个地方,漏了就在 UI 里静默消失。
把顺序与文案登记到 app/ui/plugins/index.ts 的 PlatformPanels,dashboard 只负责渲染。

* fix(ui): 控制台断连判定改为全部接口失败才触发,并放宽轮询频率

- /v1/status 单独失败时原先把整个控制台替换成「无法连接后端」,主播卡片全部消失;
  现在只有四个接口全部失败才判定断连,单个接口失败只显示对应提示条
- 主播状态 4s → 10s;streamer-info(全表)、videos(扫目录)、status(序列化整份配置)
  30s → 60s;侧栏与直播管理页共用同一组常量
- 事件流的平台名复用 status.tsx 的 platformName,删掉 use-dashboard 里的重复实现
- 首页「文档」链接对齐 README 里的 biliup.github.io 地址

* fix(ui): 直播状态文案与配色在卡片和列表视图保持一致

- 列表视图的「未开播」原是红底白字,与卡片的灰色徽章不一致;改为同一套三色
- 补回 Pending →「检测中」(原页面就有,重设计后被吞成「未开播」)
- OutOfSchedule 不再归到绿色录制组,绿色只留给 Working
- 删除无人引用的 statusMeta / platformTag

* fix(ui): 编辑投稿模板页在分区列表加载失败时给出原因而不是空白

/bili/archive/pre 需要可用的 B 站 cookie,没有账号时后端返回 500;原先 isError 为真但
error 为 undefined,页面渲染成一个空 div。现在保留页头并显示服务端返回的 message。

* fix(ui): 更新日志页不再把过时的最后一条标成「最新」

仓库里的 CHANGELOG.md 停在 1.2.1,而运行版本已是 1.2.5。页面现在读取 /v1/status 的版本号:
运行版本比日志最新一条还新时去掉「最新」标签并在顶部如实说明;日志里有当前版本时标「当前运行」。

* chore(ui): 清理重设计遗留的重复代码与死代码

- 直播管理页网格 / 列表两份完全相同的操作按钮合并为一处
- 去掉源码里面向评审工具的注释(「相对 PR 版本的增强」「保留 PR 逻辑」等)
- useGlobalBackground 删除 URL 模式残留的 validateBg / isRemoteUrl,遮罩透明度钳制与滑块范围对齐(0.05–0.8)
- 删除无人引用的 (app)/page.module.css 与 BiliupStatus 类型
- 移除 react-use(useWindowSize 已由 useIsMobile 替代,代码里已无引用)

* fix(ui): 全局设置里 sync_save_dir 输入框随下载插件下拉框即时显示

原先用 useFormApi().getValue() 做条件渲染,useFormApi 不订阅表单值变化,
选了 sync-downloader 之后输入框要先保存再刷新才出现。改用 useFormState 订阅 values。

* chore(ui): 删除原 PR 已移除的两个无人引用样式文件

app/page.module.css 与 app/styles/Home.module.css 是脚手架遗留,#1653 已删除;
接手时从合并树导入文件没有带上删除,这里补齐。

* fix(ui): 按 review 意见重审设置页文案,优先清晰无歧义

回应 #1704 的 review:设置页文案不再追求字数少,改为直观、清晰、无歧义。
逐条对照 master 原文与 Rust 实现重写,凡是精简后丢失默认值、单位、取值格式、
生效条件、依赖关系或风险提示的条目一律补回,用换行分点、加粗标出风险项。

- 12 个平台面板 + 全局「下载插件」说明:恢复多行结构,补回默认值 / 单位 / 格式 /
  生效条件(如 douyin_true_origin 需画质为原画且协议为 flv、twitch_disable_ads /
  twitch_cookie 仅 streamlink / ffmpeg 生效、youtube_cookie 填的是文件路径、
  日期格式 YYYYMMDD、大小格式 100M/5G、编码多选用 | 分隔)
- 与实现对齐并修正原文:bilibili 弹幕不再限定非 stream-gears、且随录像分段;
  bili_cookie 与 bili_cookie_file 同时填写时以文本为准;youtube_prefer_vcodec /
  acodec 是编码而非封装格式;streamlink 现可直接下载 FLV 直链;
  youtube_enable_download_playback「只想录直播的可以开启」笔误改为「关闭」;
  bili_qn 占位符改为 25000(原画),与实现默认值一致
- 空间配置页头描述改为准确描述三个 Tab 并提示需点「保存」
- 链接颜色改用 var(--semi-color-link)(原 rgb(var(...)) 为无效 CSS)

不涉及任何逻辑改动。

---------

Co-authored-by: Aluneu <19215190873@163.com>
2026-09-21 13:46:15 +00:00
Noah 4e156ac683 fix(db): 启动时对齐被改写过的迁移校验和,1.2.4 的老库不再无法启动 (#1703)
* fix(db): 启动时对齐被改写过的迁移校验和,老库不再无法启动

1.2.5 就地修改了已经发布的迁移 2(#1684 把 SET tags = null 改成 SET tags = '[]')。
sqlx 会用文件内容的 SHA-384 校验每条已应用的迁移,于是 1.1.8 ~ 1.2.4 期间建立的
数据库升级后一律以 VersionMismatch 整体失败:进程退出码 1,容器反复重启。

在跑迁移之前加一步对齐:只有当 _sqlx_migrations 里记的校验和恰好等于登记在册的
历史摘要时,才在同一个事务里补跑新旧内容的差异(幂等 UPDATE)并改写校验和。
其余任何失配仍按原样报错,不会把用户自己改过的迁移悄悄放行。

* test(db): 钉死已发布迁移的校验和,防止再次就地改写

这次故障的根因是改了一条已经发布过的迁移。加一条断言把迁移 1..5 的 SHA-384 写死:
再有人就地改动已发布的迁移,CI 当场失败,而不是等用户升级时容器起不来。
2026-09-21 02:48:33 +00:00
ForgQi 9d02856a50 Integrate mesio (rust-srec) downloader
Add an in-process mesio downloader using the rust-srec mesio-engine. Introduces crates/biliup-cli/src/server/core/downloader/mesio.rs implementing FLV/HLS pull, timestamp fixes, keyframe indexing, and size/duration-based segmentation with pipeline_common, flv_fix and hls_fix. Wire Mesio into downloader enum/runtime and add UI options and public config docs. Update crates/biliup-cli/Cargo.toml and workspace Cargo.toml/Cargo.lock to include new dependencies and bump version to 1.2.5. Include tests for protocol selection, pipeline behavior and an e2e FLV download. Small helper changes: config enum docs and segment handling.
2026-09-21 00:24:52 +08:00
lplalbertandlplalbert 5ec63167d7 fix(douyu): remove incorrect video_loop check that skips live streams (#1700)
The Douyu API now returns videoLoop=1 for normal live streams,
causing the video_loop != 0 check to incorrectly filter them out
as looped/replay content. Remove this check and rely solely on
show_status to determine if the room is live.

Co-authored-by: lplalbert <“lplalber111@gmail.com”>
2026-09-20 14:52:24 +00:00
Noahandransxd dfb933f066 fix(douyu): tolerate empty PlayResponse data and use server Date for tt (#1698)
Douyu getH5PlayV1 validates tt against server time; local clock skew
returns error -9 with data:"". PlayResponse could not deserialize the
empty-string data, so the -9/-5 branches never ran. Parse Date from
getEncryption for tt (cache offset for reuse) and deserialize data via
Value so real error/msg surfaces.

Fixes #1680

Co-authored-by: ransxd <ransxd@users.noreply.github.com>
2026-09-14 16:48:13 +00:00
Noah 970dfe8b37 feat(upload): support first-class tid_v2 partition id (#1699)
Add optional tid_v2 across Studio, config/DB, CLI, Web UI, stream-gears,
and Python uploaders so new Bilibili partition IDs can be set alongside
legacy tid. Fixes #1662; related to #1562.
2026-09-14 16:19:53 +00:00
Noahandransxd 2295ae1eba fix(streamlink): httpstream prefix for FLV and Error backoff (#1682) (#1695)
Prefix already-resolved progressive HTTP(S) media URLs (e.g. Huya/Douyu
.flv CDN links) with httpstream:// so Streamlink's http plugin matches
them, while leaving HLS/DASH and plugin webpage URLs unchanged.

When a download returns Error (or Err) while the room is still Live,
keep exponential retry backoff instead of resetting retry_count to 0,
which previously caused "Retrying download in 0ns..." spam. Immediate
retry remains only for successful segment completion / clean stream end.

Co-authored-by: ransxd <ransxd@users.noreply.github.com>
2026-09-14 16:18:15 +00:00
Noah f85e66b6c2 fix(record): 文件名含点时不再截断扩展名或死循环 (#1687)
* fix(record): 文件名含点时不再截断扩展名或死循环

Path::with_extension 会把 Mr.Beast 变成 Mr.flv,冲突检测永远命中已有文件,generate_filename 的 loop 占死 tokio 线程且无法 stop。

* test(record): 合并 path_with_suffix 测试到已有 tests 模块

util.rs 已有 mod tests,新增第二个会 E0428。
2026-09-14 02:57:48 +00:00
Noah 1b426721d6 fix(upload): 定时发布把延迟秒数换成 Unix 时间戳 (#1686)
Web UI 存的是延迟秒数,B 站接口要 10 位时间戳。Python 版会做 time()+dtime,Rust 投稿路径漏了换算,定时稿被拒后边录边传首 P 会停摆。
2026-09-13 15:40:17 +00:00
Noah 40234133e3 fix(webui): 保存配置覆写时保留投稿模板关联 (#1685)
覆写弹窗的 entity 白名单漏了 upload_streamers_id,PUT 整行覆盖后外键变 NULL,后续录像不再投稿并走默认 rm。
2026-09-13 15:40:03 +00:00
Noah 9445db636b fix(danmaku): 虎牙弹幕从用户结构体读取昵称和正文 (#1689)
MessageNotice 的 tag 2 是 lSid 不是用户名。旧解析把 lSid 当字符串读,lSid 非 0 时连正文都对不齐,弹幕几乎全部丢弃。
2026-09-13 15:36:15 +00:00
Noah 8437b028c3 fix(db): 迁移 2 将空 tags 写成 [] 而不是 NULL (#1684)
uploadstreamers.tags 是 JSON NOT NULL。SET tags = null 会让从 Python 升级且 tags 为空字符串的实例卡在迁移 2。
2026-09-13 15:33:12 +00:00
Noah 1a56242696 fix(log): 下载器命令行日志脱敏 Cookie 和 OAuth (#1688)
* fix(log): 下载器命令行日志脱敏 Cookie 和 OAuth

ffmpeg/streamlink/yt-dlp/ytarchive 会把 Cookie 头和 auth-token 打进 ds_update.log,该文件可经 Web 日志页与 /static 下载,排障贴日志即泄露登录态。

* fix(log): 头部值整段脱敏并合并测试到已有 tests 模块

Cookie/Authorization 的值吃到下一个引号,OAuth token 不再漏出;新增 --xxx-password 形式 argv 的脱敏;sid 不再当密钥以免误伤斗鱼直链。util.rs 已有 mod tests,第二个会 E0428。
2026-09-13 15:31:43 +00:00
Noahandransxd 86bcaffd2a fix(sync): AUTO 测速超时与 file_size 覆写占位 null (#1693)
- AUTO 线路探测为列表请求与单线路测速增加 15s 硬超时,失败只跳过该线路
- POST 探测体按服务端 probe.post(默认 0.1MB)发送,避免固定 10MB 拖慢选线
- ConfigPatch 序列化跳过未设置的 file_size,避免落库/回传把全局值清成 None
- 迁移清理历史 override 中的 file_size: null 占位
- 同步保留边录边传管线健壮性修复(取消保留分段、错误提示、分段顺序等)

Co-authored-by: ransxd <ransxd@users.noreply.github.com>
2026-09-13 15:29:12 +00:00
Noah 788682398a fix(docker): FFmpeg 固定到 BtbN 月末 autobuild (#1691)
autobuild-2026-08-29 已被上游删除,Docker 构建 404。BtbN 只长期保留每月最后一天的构建,改为固定 autobuild-2026-08-31-13-27 并更新 SHA-256。
2026-09-12 18:39:59 +00:00
Noah 906e0f6fdb docs: 依据代码实现重写 README,迁移弃用域名并修正失效信息 (#1681)
* docs: 依据代码实现重写 README,修正失效信息并补充平台与开发说明

保持原有结构、标题与徽章排版不变,按当前代码逐项校对内容。

修正与实现不符之处:
- 登录信息文件名写作 cookie.json,实际 CLI 默认值为 cookies.json
  (crates/biliup-cli/src/cli.rs 及其单测均为 cookies.json)
- Windows 下载链接硬编码 bbup-app_0.1.0_x64,随发版即失效,改为
  指向 Release 页
- Python 徽章链接 http://www.python.org/download 返回 404,改为
  https://www.python.org/downloads/
- Node.js 要求由 ≥ 18 修正为 ≥ 18.17(Next.js 14 的实际下限)

新增内容:
- 支持平台表:依据 builtin_plugins() 的 19 个平台适配器与通用兜底
  适配器,站点域名取自各适配器正则;弹幕列依据 danmaku
  create_platform() 支持的 7 个平台
- download 子命令用法示例与分段参数说明
- 外部依赖说明:默认 stream-gears 为纯 Rust 实现无需外部程序,
  ffmpeg 下载器与后处理需 ffmpeg,YouTube/niconico 及通用适配器
  需 yt-dlp 或 streamlink
- 目录结构表,以及 cargo 构建前必须先 npm run build 的说明
  (biliup-cli 经 rust-embed 内嵌 out/,缺失会导致编译失败)
- 测试命令与 Docker /opt 持久化、首次访问尽快初始化管理员的提示

校验:CLI 帮助文本与 target/debug/biliup --help、server --help 实际
输出逐字一致;远程访问拒绝启动的报错取自实际运行输出;mermaid
架构图经 mermaid-cli 渲染通过;README 全部外链已联网检查。

* docs: 迁移已弃用的 biliup.rs 文档域名,移除失效的 winget 安装方式

README:
- 顶部 logo 原引用 docs.biliup.rs/home.png,该域名已弃用且无法访问,
  改为仓库内 public/logo.png 的 raw 链接。README 同时用作 PyPI 长描述
  (pyproject.toml readme = "README.md"),故使用绝对地址而非相对路径
- 「使用文档」链接改为新域名
  https://biliup.github.io/biliup/docs/guide/introduction/

SKILL.md:
- 删除 Windows winget 安装段落。winget 上不存在名为 biliup 的包,
  该命令返回 No package found matching input criteria;现有的
  ForgQi.biliup-app(0.6.7)、ForgQi.biliup-rs(0.2.4) 均已停止更新,
  远落后于当前 1.2.4。Windows 用户仍可通过既有的 GitHub Releases
  段落(含 PowerShell 脚本)安装

校验:README 全部 29 个链接联网复查,除 GitHub 对未登录请求的
/stargazers 统一返回 404(rust-lang/rust 同样如此,属反爬行为)外
均为 200;新 logo 地址返回 200、image/png、65525 字节。
2026-09-01 13:49:39 +00:00
Noah c4dbf81c5d fix(danmaku): B站数据包解析不再对畸形输入 panic,解码 panic 不再终结录制 (#1678)
decode_packet 只校验 packet_len 是否越界,未校验其不小于 16 字
节包头:远端发来 packet_len < 16 的畸形帧时,body 反向切片直接
panic;panic 发生在 tokio::spawn 的录制任务里,run() 的重连逻辑
只处理 Err,任务被杀死后没有任何重启机制,弹幕录制静默永久停
止,XML 文件也不会 finalize。

修复:
- packet_len < 16 视为不可信帧,丢弃剩余数据并保留已解析的包,
  同时消除 packet_len=0 时 offset 不前进的死循环隐患
- 压缩包递归解码增加深度上限(真实协议仅一层嵌套),恶意多层
  嵌套不再导致栈溢出
- 客户端在 WebSocket 与 TCP 两条路径上用 catch_unwind 包裹
  decode_message:任何平台解码器 panic 都降级为可跳过的解码错
  误,连接与录制继续存活

新增 5 项回归测试:零长度帧、短长度帧、合法帧后跟畸形头、单层
zlib 嵌套仍可解码、超深嵌套被丢弃。
2026-08-30 15:03:59 +00:00
Noah 01a33213b8 ci: 修复发布与 CI 工作流的权限、死代码及供应链问题 (#1679)
release.yml:
- Windows 归档条件比较 matrix.os 与 windows-2019 永远为假,实际
  依赖 MSYS 的 .exe 兜底才能工作,改为按 runner.os 判断
- publish 归档循环中 exe 变量不重置,目录顺序变化时会污染后续平台
- 替换已归档的 actions-rs/toolchain、actions-rs/cargo,改用
  dtolnay/rust-toolchain 与 cross;checkout@v2(node12 已下线)升 v4
- 弃用的 ::set-output 改为 GITHUB_OUTPUT
- 顶层收紧为 contents: read,仅 publish 任务授予写权限

ci.yml:
- tag 触发从 '*' 收紧为 v[0-9]+.[0-9]+.[0-9]+,任意 tag 不再能
  触发 PyPI 正式发布
- setup-node@v3 升 v4

docker-publish.yml:
- 顶层 packages: write 会授予 pull_request 触发的 test 任务,收紧
  为顶层只读、build/merge 任务单独授予
- 移除 buildx 已弃用的 install: true;docker-compose v1 命令改为
  compose v2 子命令

docs-publish.yml:补 paths 过滤与显式权限。
Termux-publish.yml:setup-node@v3 升 v4。

新增 test.yml:PR 与 master push 运行
cargo test -p biliup -p biliup-cli -p danmaku,合并前有真实测试门禁。

Dockerfile:FFmpeg 从滚动的 latest tag 改为固定 autobuild 版本并
强制 SHA-256 校验,下载被篡改或损坏时构建失败。

docker-compose.yml:占位符 <HOST_PORT> 等使解析必然失败,改为
带默认值的环境变量;移除已废弃的 version 字段。

新增 .dockerignore:排除 .git、构建产物及本地数据库/凭据/日志,
避免进入构建上下文。
2026-08-30 15:00:16 +00:00
Noah 8a19c05c06 fix(webui): 注册提交前执行表单校验,确认密码规则不再被绕过 (#1677)
登录页的提交按钮直接调用 handleSubmit 发起 fetch,从不触发
Semi Form 的规则校验:确认密码字段的一致性 validator 从未执行,
注册时确认密码留空或与密码不一致都能成功提交。

现在提交前先 formApi.validate():校验失败时终止提交,错误信息
展示在对应字段下方;同时为确认密码补充 required 规则,留空时
给出明确提示而不是笼统的“两次密码输入不一致”。
2026-08-30 14:56:56 +00:00
Noah 631e1160b1 fix(flv): 使用 write_all 保证 FLV 标签与 JSON 输出完整写入 (#1676)
flv_writer 中三处使用 io::Write::write 写入数据:write 允许部分
写入且把已写字节数作为 Ok 返回,短写时 previous_tag_size 等
字段会静默缺字节,产出的 FLV 标签结构损坏,播放器与解析器
在该点之后无法继续解析。

将 write_tag 的 previous_tag_size 写入、write_previous_tag_size
与 to_json 的换行写入全部改为 write_all,公开签名保持不变。
新增短写 Writer 回归测试,验证 4 字节 previous_tag_size 在部分
写入场景下仍被完整写出。
2026-08-30 14:54:09 +00:00
Noah 2c3592f117 fix(bilibili): 稿件分页查询复用登录客户端,不再每页新建 Client (#1675)
archives() 之前在分页循环中每请求一页都重新 build 一个
reqwest::Client 和 cookie jar:连接无法复用,代理配置丢失导致
查询绕过 --proxy 直连;且 Jar::add_cookie_str 会把 "; " 拼接的
整串 Cookie 当作单条 Set-Cookie 解析,实际只有第一个 Cookie
生效,其余键值被当作 Cookie 属性丢弃。

改为复用登录时构建的 self.client:cookie store 已含全部登录
Cookie,UA 与原实现一致,并保留代理配置与连接池,同时按原
行为为该请求保留 60 秒总超时。
2026-08-30 14:52:47 +00:00
Noah 5c6c720fdc fix(upload): 测速时单条线路失败不再中断整体测速 (#1674)
Probe::probe 对每条线路的 ping 使用 ? 传播错误,任意一条线路
DNS/连接/读取失败都会让整个测速立即返回错误,即使后续线路
完全可用,调用方也会因 unwrap_or_default 直接退回默认线路。

现在单条线路网络错误或异常状态码只记录警告并跳过该线路,
继续测速其余候选;全部线路失败时返回统一错误。
2026-08-30 14:51:09 +00:00
NoahandNoah 616432d190 feat(sync): 恢复边录边传下载器的流式上传管线 (#1673)
Rust 重写后 sync-downloader 被静默映射为 stream-gears 落盘下载,
边录边传完全失效(#1612)。本次恢复 ffmpeg stdout 到 UPOS 流式
分片上传、逐段投稿/追加分 P 的完整链路,并修复可靠性问题:

- UPOS 拆分为上传 parts 与显式 complete 两阶段,parts 按
  partNumber 排序并校验连续,complete 带状态检查与重试
- 录制同时写临时文件(有界通道背压);短流/预传失败时按实际
  长度回退为文件重传,投稿成功后清理临时文件
- SyncSession 跨拉流重连保留 aid,分 P 严格按录制顺序提交,
  首投结果不确定时停止自动重试避免重复建稿
- 上传/投稿错误向上传播;外层重试只在分 P 推进后重置退避
- 修复 www.douyin.com/live/{id} 被解析成 web_rid=live 的问题

Co-authored-by: Noah <17682131+ransxd@users.noreply.github.com>
2026-08-30 14:50:37 +00:00
yjywybb 051f5c7eb0 fix(upload): preserve filename-invalid characters in submission titles (#1671) 2026-08-25 07:50:23 +00:00
ForgQi 03b7a84f55 Allow remote Web UI bootstrap with auth
This change updates the server default bind to 127.0.0.1 for safer local-only access while documenting how to expose the Web UI via --bind 0.0.0.0 --auth for remote or Docker use. It also removes the previous restriction that blocked first-time admin bootstrap on non-loopback addresses, allowing authenticated remote initialization and bumping the workspace version to 1.2.4.
2026-08-24 01:13:29 +08:00
NoahandNoah c351c39771 fix(server): 会话 Cookie 不再强制 Secure,修复 HTTP 远程访问登录后无法保持登录态 (#1669)
Co-authored-by: Noah <17682131+ransxd@users.noreply.github.com>
2026-08-23 15:20:11 +00:00
NoahandNoah 6cef8afe22 fix(stream-gears): 登录函数释放 GIL 后再执行阻塞网络请求 (#1667)
Co-authored-by: Noah <17682131+ransxd@users.noreply.github.com>
2026-08-22 19:25:48 +00:00
ForgQi eb8699b203 Add recording policy and time-range checks
This change adds a recording policy layer that enforces time-window eligibility and excluded title keywords before probing and before recording. It updates the streamer API to surface reasons like OutOfSchedule and TitleExcluded, clamps ffmpeg/segment durations to the configured window, and exposes the last rejection reason from the worker state for the frontend.
2026-08-22 19:15:48 +08:00
NoahandNoah 1affe97d87 fix(webup): Data 声明 desc_v2 字段,避免提交时被 asdict 静默丢弃 (#1666)
Co-authored-by: Noah <17682131+ransxd@users.noreply.github.com>
2026-08-22 08:52:05 +00:00
cls3389 8fe338b5f5 fix(douyin): 下播后回放房间仍被误判为直播中 (#1663)
抖音主播下播后,直播间跳转 reflow 回放页,接口仍返回 status=2
和可拉取的回放流,导致 monitor 循环误判开播并反复录制垫片流。

两处独立防线:
- get_room_info: finish_time > 0(抖音已写入直播结束时间)判定未开播
- select_stream_url: 流 URL 含 rtm_expr_tag=reflow_room_info
  (回放流标记)时拒绝作为直播流返回

Fixes #1532
2026-08-22 08:39:50 +00:00
NoahandNoah 3750ced583 fix(hls): respect playlist refresh lifecycle (#1665)
Co-authored-by: Noah <17682131+ransxd@users.noreply.github.com>
2026-08-22 08:37:05 +00:00
Noahandransxd e1c4b6887e fix(downloader): 纯视频流分段时避免序列头 expect 导致的 panic (#1664)
分段重建逻辑此前对 on_meta_data / aac_sequence_header / h264_sequence_header 使用 expect。纯视频流(无音频,aac_sequence_header 恒为 None)在首次分段时必然 panic,导致 7x24 录制任务中断。改为缺失时跳过并告警,不再中断录制。

新增回归测试 pure_video_stream_segments_without_panic:构造仅含 onMetaData 与 H264 序列头、无音频标签的 FLV 流并触发分段;修复前该测试会 panic(aac_sequence_header does not exist),修复后通过。

Co-authored-by: ransxd <ransxd@users.noreply.github.com>
2026-08-22 08:35:19 +00:00
Mostly_Harmless b438d72415 feat(web): 完善账号管理、稿件查询与安全边界 (#1660)
启动 Web 服务时自动登记 CLI 指定的 B 站凭据,并为账号登记、刷新和删除统一补上并发去重、原子写入及引用检查。

同时收紧默认监听、管理员初始化、认证路由、静态文件和日志 WebSocket,恢复 server 的 ds_update.log,并避免凭据及上游响应进入日志。

新增按账号查询远程稿件的 API 与 Web 页面,补齐严格分页和响应校验。

关联 biliup/biliup#1624

关联 biliup/biliup#1658

关联 biliup/biliup#724
2026-08-16 14:05:20 +00:00
vector0902androotuc ccb016be4f fix(upload): include lock file path in rate-limit lock error message (#1661)
Co-authored-by: rootuc <rootuc@notunixchan>
2026-08-15 06:40:18 +00:00
PingouinFerreux 0c3bbe2ec1 fix: switch star history chart to a working provider (#1659)
The star history chart in the README is no longer loading because the upstream API it depended on stopped working. Point the chart and its link to the star-history service hosted at star-history.dera.page, which uses a different data source and requires no API key, so the chart renders again for everyone.

This keeps the same query and hash parameters as before, so only the domain in the two URLs changes.
2026-08-14 07:59:58 +00:00
dreammu 3e8b55c2c4 fix(upload): update upload lines (#1656) 2026-08-07 09:28:12 +00:00
Micuks adf6a1c03b fix(hls): 选取最高画质的流,而非固定取 variants[0] (#1649)
HLS 下载器一直取 master playlist 里的第一个变体。Twitch 会把各档
转码清晰度排在源流前面,所以经常录到较低画质的转码流,而不是源流。

改为选取带 RESOLUTION、且码率最高的变体,并跳过 I-frame(trick-play)
流。若没有变体带分辨率,则回退到码率最高的非 I-frame 变体,最后回退
到第一个变体,保证在异常 playlist 下行为不退化。
2026-07-14 14:35:35 +00:00
ForgQi 03c36e1da7 Add batch live-check support + fixes
Introduce batch live-check infrastructure and implementations. Add BatchCheckRequest and LivePlugin::supports_batch_check/batch_check API; Monitor uses BatchLiveCache and batch_verdict to prefilter rooms (platform-level checks + caching and fast rotation). RoomsActor gains PlatformUrls. Implement batch_check for Picarto (explore pagination) and Twitch (GQL batching with auth retry). Other fixes: Douyu auth-failure detection and key invalidation + retry, Inke optional response handling, streamlink runtime tweaks for yt-dlp/Twitch ffmpeg, small test additions and import refactors.
2026-07-14 21:33:23 +08:00
ForgQi 083313257f Improve downloader reliability and add caching
- Add process-level caching for expensive API calls: login tokens (Afreecatv, Douyin), encryption keys (Douyu), room IDs (Douyu, Huya)
- Implement Huya mini-app API option (huya_mobile_api) with WUP protocol support for getCdnTokenInfoEx
- Add cdn_fallback for Huya with health checks and protocol negotiation
- Improve Bilibili stream selection with protocol fallback (hls_fmp4→stream) and qn-based grouping
- Fix Twitch auth token invalidation handling and improve cookie file management
- Refactor YouTube entry selection with proper playlist recursion and date filtering
- Add retry logic for network failures (Douyu betard) and improve error recovery
- Share WBI signer state across Bilibili check_stream calls to respect 2-hour key cache interval
- Always pass --download-archive for YouTube (including live) to prevent post-stream duplicates
- Add field aliases (inke: live_name, kilakila: backPic) and fix Niconico suffix (flv→ts)
2026-07-14 00:32:29 +08:00
ForgQi 18c5bf086e Define AT_HWCAP2 for ppc64le; enable tokio
Set CFLAGS_powerpc64le_unknown_linux_gnu=-DAT_HWCAP2=26 in CI to work around aws-lc-sys (via rustls) calling getauxval(AT_HWCAP2) on manylinux2014 where glibc 2.17 headers lack AT_HWCAP2; glibc still provides getauxval so the value is safe and only used for ppc64le cc invocations. Also enable the tokio "io-std" feature for the biliup-cli crate to opt into the io-std I/O implementation.
2026-07-11 03:53:51 +08:00
ForgQi ddc29f63b4 Update deps & fix server upload/download
Bump dependencies (Cargo.toml + Cargo.lock) to newer crate versions and adapt code to API changes. Refactor server-side upload/download logic, the upload_streamer model, and related API endpoints to improve streaming handling, buffer/error propagation and compatibility with updated crates (e.g. tokio-tungstenite/futures/etc.). These changes align the codebase with the upgraded dependency set and fix streaming/endpoint issues introduced by those upgrades.
2026-07-11 01:57:48 +08:00
ForgQi 58dc75b6ca Build free-threaded wheels for Python 3.14t (#1648)
maturin 1.14 dropped support for free-threaded Python 3.13
("Free-threaded Python interpreter is only supported on 3.14 and
later"), which broke the linux/musllinux/macos free-threaded wheel
steps since maturin-action always uses the latest maturin. Switch
the free-threaded builds from python3.13t to python3.14t, matching
what maturin generate-ci now emits.
2026-07-10 17:08:08 +00:00
Micuks 33649fb568 fix server submit_api web routing (#1645) 2026-07-10 15:11:39 +00:00
Aluneu 165d4eac68 Update CHANGELOG.md (#1646)
更新发行版信息
2026-07-05 11:08:39 +00:00
XuanRan_Nyan 08b96b73f8 feat(douyu): build huos url for forced hs (#1644) 2026-06-26 11:59:42 +00:00
dplei 0fe20687a3 fix(upload): fall back to live URL when copyright_source is blank (#1640)
When the upload template's reprint source (copyright_source) is left
empty, the web form submits an empty string rather than null, so it is
stored as Some(""). build_studio used `unwrap_or_else`, which only fires
on None, so the submitted source became an empty string instead of the
live room URL — contradicting the UI hint
"如不填写转载来源默认为直播间地址".

Treat None and whitespace-only values as "unset" and fall back to the
live room URL. Extract the resolution into a pure `resolve_source`
helper with unit tests covering none / empty / whitespace / real value.
2026-06-11 02:54:59 +00:00
ForgQi b2ab974431 Update README with new features and cleanup
Reorganize features and remove command line tool section.
2026-06-08 01:32:00 +08:00
ForgQi b5ddff0564 Refactor Python package and simplify entry
Remove legacy engine and many plugin modules, refactor upload plugins to standalone classes, and simplify package entry points. __init__.py now provides a safe __version__ fallback; __main__.py directly invokes stream_gears.main_loop. BiliWeb/BiliWebAsync plugins were adapted to use a FileInfo NamedTuple and no longer depend on engine.UploadBase/Plugin decorator. Documentation updated (README expanded with new commands and CLI/SKILL integration) and a new SKILL.md added. Workspace version bumped to 1.2.1 in Cargo.toml (lock updated accordingly).
2026-06-06 03:22:54 +08:00
ForgQi 431d1f61ab Support optional segment limits and danmaku files
Make file_size and segment_time optional and normalize/validate their values so segmentation can be disabled. Frontend: send nulls for empty fields and allow empty segment_time via validation; add showClear to inputs. Downloader: extend SegmentInfo with optional danmaku_file_path and propagate it from various downloaders; DanmakuClient::rolling now returns a bool to signal whether a danmaku file was produced. Uploader: add segment_paths helper to include danmaku files in upload/postprocessing, and preserve processed paths; add unit tests. HookStep: stream child process stdout/stderr as raw bytes to terminal and append to a log file (tee), and simplify run/move logic to use explicit path lists. Cargo.toml: bump reqwest to 0.13.4. Tests and minor adjustments added throughout to support these changes.
2026-06-04 01:19:27 +08:00