惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy International News Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Troy Hunt's Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Attack and Defense Labs
Attack and Defense Labs
S
Secure Thoughts
V2EX - 技术
V2EX - 技术
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
O
OpenAI News
Cloudbric
Cloudbric
Google Online Security Blog
Google Online Security Blog
Schneier on Security
Schneier on Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Help Net Security
Help Net Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
L
Lohrmann on Cybersecurity
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
NISL@THU
NISL@THU
N
News and Events Feed by Topic
T
Tenable Blog
S
Security @ Cisco Blogs
N
News and Events Feed by Topic
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
宝玉的分享
宝玉的分享
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
V
Visual Studio Blog
P
Proofpoint News Feed
Webroot Blog
Webroot Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 三生石上(FineUI控件)
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Jina AI
Jina AI
雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
L
LangChain Blog
The Register - Security
The Register - Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东

Rat's Blog - Rat's

189List:一个全新的天翼云网盘的目录列表程序,CTList升级版 - Rat's Blog unlock-music:支持解密网易云/QQ音乐的加密文件和ID3信息补全 - Rat's Blog Proxyer:一款简单且带Web面板的内网穿透工具 - Rat's Blog CTList:一个可以绑定多个天翼云网盘的目录列表程序,支持视频播放 - Rat's Blog TopDocs:一款美观实用的在线文档编辑系统,支持Markdown语法 - Rat's Blog live-torrent:一个支持磁力链和种子的在线搜索云播Web客户端 - Rat's Blog 视频切片后自动上传至国内免费CDN,无成本加速视频播放 - Rat's Blog 多种功能强大的BT离线下载程序Docker镜像及安装 - Rat's Blog 一个可以绑定多个OneDrive网盘的极简目录列表:OneList - Rat's Blog
Simple Torrent:一个支持边下边播、无版权限制和自动上传的BT离线下载程序 - Rat's Blog
博主: Rat's · 2022-08-03 · via Rat's Blog - Rat's

说明:博主很久以前水过一个BT下载工具Cloud Torrent,不过好像2年没维护了,这里就介绍个基于Cloud Torrent开发的项目Simple Torrent,同样的使用Golang编写,功能在原有的基础上加了些适用的功能,下载/上传速度限制、无版权限制,RSS订阅和自定义添加BT-Trackers等,而且还有api接口,同时还支持下载后自动调用外部命令,可玩性还是很高的,比如我们可以和aria2一样,将下载完成的资源自动上传到OneDriveGoogle Drive等网盘,博主大概用了下,感觉还可以,这里就分享下。

截图

请输入图片描述
请输入图片描述

安装

Github地址:https://github.com/boypt/simple-torrent

使用SSH客户端登录服务器,运行命令:

bash <(wget -qO- https://raw.githubusercontent.com/boypt/simple-torrent/master/scripts/quickinstall.sh)

然后使用ip:3000访问即可。

顺便提供个博主经常用的BT-Trackers服务器地址,效果不错,如下:

https://trackerslist.com/all.txt

直接在Web界面修改即可。

相关命令:

启动:systemctl start cloud-torrent
重启:systemctl restart cloud-torrent
停止:systemctl stop cloud-torrent
查看状态:systemctl status cloud-torrent

Docker安装

1、安装Docker

#CentOS 6系统
rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum update -y
yum -y install docker-io
service docker start
chkconfig docker on

#CentOS 7、Debian、Ubuntu系统
curl -sSL https://get.docker.com/ | sh
systemctl start docker
systemctl enable docker

2、安装Simple Torrent

docker run --restart=always --name simple-torrent -d \
-p 3000:3000 \
-v ~/downloads:/downloads \
-v ~/torrents:/torrents \
boypt/cloud-torrent

然后使用ip:3000访问即可。

最后如果你访问不了Web端,可能要检查下防火墙端口,有安全组的也要放行下相关端口。

这里提供个CentOS系统防火墙开启命令,大致如下:

#CentOS 6
iptables -I INPUT -p tcp --dport 3000 -j ACCEPT
service iptables save
service iptables restart

#CentOS 7
firewall-cmd --zone=public --add-port=3000/tcp --permanent
firewall-cmd --reload

API使用

关于API的用法,官方文档说的很详细了,这里就大概列举几个,如下:

#通过远程地址添加种子
curl --data "http://domain.com/file.torrent" "http://localhost:3000/api/url"
#通过本地文件添加种子
curl --data-binary "my.torrent" "http://localhost:3000/api/url"
#通过磁力链接添加种子
curl --data "magnet:?xt=urn:btih:..." "http://localhost:3000/api/url"

#开始种子任务
curl --data "start:${HASH}" "http://localhost:3000/api/torrent"
#停止种子任务
curl --data "stop:${HASH}" "http://localhost:3000/api/torrent"
#删除种子任务
curl --data "delete:${HASH}" "http://localhost:3000/api/torrent"

#查看文件和种子信息
/api/files和/api/torrents

外部程序调用

先修改配置文件,通过上面脚本安装的配置文件在你的主目录,比如/root目录,配置文件cloud-torrent.json

修改以下参数:

#外部程序调用参数
"donecmd": "",

#比如我要下载完成后,直接运行/home目录下的rats.sh脚本
"donecmd": "/home/rats.sh",

那么下载完成后就会运行该脚本。

一般种子下载完成后,会返回以下参数变量,这里列举下主要的:

CLD_DIR为下载路径,且为绝对路径
CLD_PATH为下载文件名称
CLD_SIZE为文件大小
CLD_TYPE为调用事件类型,分为files和torrent,分别为种子里单个文件和整体文件
CLD_HASH为文件HASH值

这里随便放一个下载后自动移动的脚本,针对rclone挂载的文件夹。

#!/bin/bash

#下载后移动的文件夹路径
RemoteDIR="/down/moerats";  

if [[ ${CLD_TYPE} == "torrent" ]]; then
eval mv \'"${CLD_DIR}/${CLD_PATH}"\' "${RemoteDIR}";
#移动后停止该任务
curl --data "stop:${CLD_HASH}" "http://127.0.0.1:3000/api/torrent";
#停止后清除该任务,也就是不会出现在Web界面了
curl --data "delete:${CLD_HASH}" "http://127.0.0.1:3000/api/torrent";
fi

这里还可以结合TG机器人啥的一起使用,玩法很多,可以自行结合API一起使用。

要注意的是,配置调用脚本的时候,需要给予脚本可执行权,并重启程序生效,比如:

#给予可执行权,脚本路径/root/rats.sh
chmod +x /root/rats.sh
#重启程序
systemctl restart cloud-torrent

相关教程

最后关于这个无版权限制,博主从未遇见过版权投诉,所以无法测试,对于下载的话,有些资源速度还是不错的,具体效果就自行体验了。


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/1023/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。