0%

记一次群辉存储空间损毁后 QB 种子恢复尝试

前记

  • 应该是 蜗牛星际 电压太高加上 固态不稳定 导致的
  • 这块盘我只放服务. 基本不写这块盘. 像 nastool, qb, tr, emby, iyuu, homepage 等全被一套带走了.
  • 不幸中的万幸, 之前的 qb 页面开着没关.

因为之前我开着 qb 页面没关, 所有抢救下来了 qb 页面(包括所有的种子详情)

  • 大约是 1200 种, 因为 qb 页面里面可以拿到 torrent hash, 所以 torrent 有望恢复

image.png

主要流程

  1. ⌘ + S, 保存 qb web 页面成单个 html
  2. 对 qb web 页面结构进行分析
  3. 从 qb web 页面提取 torrent hash, (分类, 标签, 保存路径)
  4. 向 iyuu 通过 torrent hash 进行 辅种链接查询
  5. 根据 iyuu 返回的 sid 和 torrent_id 组装成对应的下载链接
  6. 使用 passkey 进行下载
  7. 通过 qb torrent/add 接口批量添加种子

详细操作

仅针对官方 qb webui, 4.5.+, 其他自行研究

⌘ + S, 保存 qb web 页面成单个 html

  • 有手就行, Windows: Ctrl + S

对 qb web 页面结构进行分析

以原生 JS 选择器为例

  • 状态, 分类, 标签, tracker: document.id('Filters_pad')
  • 种子列表标题: document.querySelector("#torrentsTableDiv > table > thead > tr")
  • 种子列表: document.querySelector("#torrentsTableDiv > table > tbody")

这里你可能会发现这里面其实是有 tracker url 的. 不过这个没用, 因为还是没法下载到 torrent 文件

从 qb web 页面提取标题

1
2
3
Array.from(document.querySelector("#torrentsTableFixedHeaderDiv > table > thead > tr").querySelectorAll('th')).map(t => ({
title: t.title, class: t.className
}))

从 qb web 页面提取 torrent hash, (分类, 标签, 保存路径)

  • 种子 hash 列表: Array.from(document.querySelectorAll("#torrentsTableDiv > table > tbody > tr")).map(_ => _.dataset['rowId'])

其他信息, 如 分类, 保存路径, 直接写太麻烦了, 建议使用 jQuery 之类的, 而非 原生 JS 选择器

1
2
3
4
Array.from(document.querySelectorAll("#torrentsTableDiv > table > tbody > tr")).map(t => ({
hash: t.dataset['rowId'],
meta: Array.from(t.querySelectorAll('td')).map(_ => _.title)
}))

向 iyuu 通过 torrent hash 进行 辅种链接查询

  • 结合标题的信息和 torrent 的信息, 这里已经算是完整的种子信息获取出来了
  • 可以选择 https://api.iyuu.cn/docs.php?service=App.Api.Infohash&detail=1&type=fold 或者 https://api.iyuu.cn/docs.php?service=App.Api.Hash&detail=1&type=fold 作为获取信息的接口

这里以后者为例

  • 分别填入以下信息
    • sign: IYUU token
    • timestamp: 客户端时间戳
    • version: 2.0.0
    • hash: ["cf7d88fd656d10fe5130d13567aec27068b96676"]
    • sha1: hash 字段的 sha1 计算结果, http://www.sha1-online.com/ 填写后点击 hash, 输出的 6ecca4d49213d5fd3ec81153a9b9d3395400596a 即为实际内容

根据 iyuu 返回的 sid, base_url, download_pagetorrent_id 组装成对应的下载链接

  • 获取站点信息, 主要关注 base_url, download_page, reseed_check
  • 将参数添加完成后, 这就是一个下载种子的完整链接

参数哪里来? iyuu 配置站点时的必填项

通过 qb torrent/add 接口批量添加种子

  • 这里可以直接通过 qb 接口发种子, 目前 iyuu 是这么实现的.
  • 全部添加完成之后, qb 的种子也算是恢复了.

其他

  • 断电,放电,重启后发现数据可读了😋抓紧时间备份了下. 所以发现损毁之后不要慌,先备份能备份的信息,然后拔插下试试。
  • SSD没法拔,就断电后按开机键,等几分钟,插电!~ 开机!~~
-------------本文结束再接再厉-------------

本文标题:记一次群辉存储空间损毁后 QB 种子恢复尝试

文章作者:IITII

发布时间:2024年12月10日 - 14:12

最后更新:2025年03月10日 - 14:03

原始链接:https://iitii.github.io/2024/12/10/1/

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。