unraid环境下qBittorrent、CloudDrive、115网盘等应用联动的老司机骚操作
功能1: qBittorrent下载至CloudDrive挂载的网盘,plex等软件直接使用
1.1. qb下载选项设置未完成文件保存路径
1.2. tmp路径最好映射到外面,要不然docker可能会撑爆掉
2. (可选)如果是下载电视剧之类的大量文件,又不想等全部下载完,可以把tmp路径也包含到plex媒体库里
此处记不清是不是所有文件下载完成,才会转移到下载目录,大家有再次确认的也可以发到评论区
将外部tmp文件夹映射到plex内
功能2:解决下载学习资料,不能转移到115网盘
1. 利用qb下载完成后执行脚本命令,更改hash,可正常上传至115
加入命令
上传执行脚本
import os
import sys
import hashlib
import random
def change_file_hash(file_path):
with open(file_path, 'rb') as f:
data = f.read()
with open(file_path, 'ab') as f:
f.write(os.urandom(random.randint(1, 10)))
# qBittorrent会提供下载完成的文件或文件夹的路径作为第一个参数
file_path = sys.argv[1]
change_file_hash(file_path)
以下脚本是限制在'Other'这个目录下才会进行操作
需要
import os
import sys
import hashlib
import random
def change_file_hash(file_path):
if 'Other' in file_path:
with open(file_path, 'rb') as f:
data = f.read()
with open(file_path, 'ab') as f:
f.write(os.urandom(random.randint(1, 10)))
# qBittorrent会提供下载完成的文件或文件夹的路径作为第一个参数
file_path = sys.argv[1]
change_file_hash(file_path)
感觉排版不友好的,直接看下面链接,有文档直接下载
https://l099efu7tm2.feishu.cn/wiki/VjY6wztgNiWtBSkD36hcQ8gxnph?from=from_copylink
如需要打印信息和详细说明,可使用以下脚本
import os
import sys
import hashlib
import random
# 定义一个函数来更改文件的hash值
def change_file_hash(file_path):
# 检查文件路径是否包含"Other"
if 'Other' in file_path:
# 打开文件并读取内容
with open(file_path, 'rb') as f:
data = f.read()
# 计算原始的hash值
original_hash = hashlib.sha1(data).hexdigest()
# 打印原始的hash值
print(f'Original hash for {file_path}: {original_hash}')
# 打开文件并在末尾添加一些随机数据
with open(file_path, 'ab') as f:
f.write(os.urandom(random.randint(1, 10)))
# 重新打开文件并读取内容
with open(file_path, 'rb') as f:
data = f.read()
# 计算新的hash值
new_hash = hashlib.sha1(data).hexdigest()
# 打印新的hash值
print(f'New hash for {file_path}: {new_hash}')
# qBittorrent会提供下载完成的文件或文件夹的路径作为第一个参数
file_path = sys.argv[1]
# 调用函数来更改文件的hash值
change_file_hash(file_path)
AI小值-电脑数码
校验提示文案
AI小值-电脑数码
校验提示文案