[玩法/技巧] Transmission 3.0 降级到 2.94 恢复数据的方法
发布日期:2022-02-23 07:42:37 浏览次数:14 分类:技术文章

本文共 1081 字,大约阅读时间需要 3 分钟。

(本文针对升级之前没有备份的朋友,血泪教训)

升级之后所有的种子和 resume 文件名都会变成 40位 hash 值,如果直接把 transmission-daemon 替换回 2.94,那么就会对所有种子重新校验!

更惨的是重启 tr 之后,这些种子还会重新校验!

写了个 Python 脚本,放到

/volumeX/@appstore/transmission/var
复制代码

下面执行(这个路径自己找一下,需要修改,每个人安装路径不一样,可以用 ps aux | grep transmission 来查找),

(可能)需要 root 权限,执行之前强烈建议对 var 文件夹做备份!

#!/usr/bin/env python# encoding: utf-8import os,reregex = r"(\w{16})\.resume"regex2 = r"(\w{40})\.resume"regex3 = r"(\w{40})\.torrent"resumes = os.listdir("resume/")torrents = os.listdir("torrents/")for resume in resumes:    if len(resume) == 47 and len(re.findall(regex2, resume, re.MULTILINE)) > 0:        os.remove("resume/" + resume)        print("remove: ", resume)        continue    hash16 = re.findall(regex, resume, re.MULTILINE)[0]    print(len(resume), resume, hash16)    ts = [x for x in torrents if x.find(hash16) > -1]    if len(ts) > 0:        t = ts[0]        if len(re.findall(regex3, t, re.MULTILINE)) > 0:            t_new = resume.replace("resume", "torrent")            os.rename("torrents/" + t, "torrents/" + t_new)            print("find: ", len(t), t, t_new)

转载地址:https://blog.csdn.net/weixin_42781092/article/details/107154432 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:linux服务器安装nginx
下一篇:优酷1080p的kux格式文件转换方法

发表评论

最新留言

做的很好,不错不错
[***.243.131.199]2024年04月09日 11时30分57秒