Last update at :2024-06-11,Edit by888u
Simple Torrent: one playback, BT offline download program without copyright restrictions and automatic upload
This article is reproduced from the blog of rat’s.
Let’s talk about the software features first: 1. You can only download BT or magnet. 2 No Chinese. 3 Without copyright restrictions, the effect is not strong, and some accounts are blocked.
Simple Torrent, a project developed based on Cloud Torrent, is also written in Golang. It adds some applicable functions to the original ones, including download/upload speed limits, no copyright restrictions, RSS subscriptions and custom addition of BT-Trackers. etc. It also has an API interface and supports automatic calling of external commands after downloading. The playability is still very high. For example, like aria2, we can automatically upload the downloaded resources to a network disk such as OneDrive or Google Drive.
Installation
Github address: https://github.com/boypt/simple-torrent
Use SSH client to log in to the server and run the command:
bash <(wget -qO- https://raw.githubusercontent.com/boypt/simple-torrent/master/scripts/quickinstall.sh)Then use ip:3000 to access.
By the way, I provide the BT-Trackers server address that bloggers often use. The effect is good, as follows:
https://trackerslist.com/all.txtYou can modify it directly in the web interface.
Related commands:
Start: systemctl start cloud-torrent Restart: systemctl restart cloud-torrent Stop: systemctl stop cloud-torrent View status: systemctl status cloud-torrentDocker installation
1. Install Docker
#CentOS 6 system 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 system curl -sSL https://get.docker.com/ | sh systemctl start docker systemctl enable docker2. Install Simple Torrent
docker run --restart=always --name simple-torrent -d \ -p 3000:3000 \ -v ~/downloads:/downloads \ -v ~/torrents:/torrents \ boypt/cloud-torrentThen use ip:3000 to access.
Finally, if you cannot access the web side, you may need to check the firewall port. If you have a security group, you should also allow the relevant ports.
Here is a CentOS system firewall opening command, roughly as follows:
#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 --reloadAPI usage
As for the usage of the API, the official documentation is very detailed. Here are just a few, as follows:
#Add seeds via remote address curl --data "http://domain.com/file.torrent" "http://localhost:3000/api/url" #Add seeds through local files curl --data-binary "my.torrent" "http://localhost:3000/api/url" #Add seeds via magnet link curl --data "magnet:?xt=urn:btih:..." "http://localhost:3000/api/url" #Start seed task curl --data "start:${HASH}" "http://localhost:3000/api/torrent" #Stop seed task curl --data "stop:${HASH}" "http://localhost:3000/api/torrent" #Delete seed task curl --data "delete:${HASH}" "http://localhost:3000/api/torrent" #View file and seed information /api/files and /api/torrentsExternal program call
First modify the configuration file. The configuration file installed through the above script is in your home directory, such as the /root directory, and the configuration file cloud-torrent.json.
Modify the following parameters:
#External program call parameters "donecmd": "", #For example, after I want to download it, I can directly run the rats.sh script in the /home directory. "donecmd": "/home/rats.sh",Then the script will be run after the download is complete.
Generally, after the torrent download is completed, the following parameter variables will be returned. Here are the main ones:
CLD_DIR is the download path and is an absolute path CLD_PATH is the download file name CLD_SIZE is the file size CLD_TYPE is the calling event type, which is divided into files and torrent, which are individual files and whole files in the torrent respectively. CLD_HASH is the file HASH valuePut here a script that automatically moves after downloading, targeting the folder mounted by rclone.
#!/bin/bash #Folder path to be moved after downloading RemoteDIR="/down/moerats"; if [[ ${CLD_TYPE} == "torrent" ]]; then eval mv \'"${CLD_DIR}/${CLD_PATH}"\' "${RemoteDIR}"; #Stop the task after moving curl --data "stop:${CLD_HASH}" "http://127.0.0.1:3000/api/torrent"; #Clear the task after stopping, that is, it will not appear in the web interface. curl --data "delete:${CLD_HASH}" "http://127.0.0.1:3000/api/torrent"; fiThis can also be used in conjunction with TG robots and other things. There are many ways to play, and you can use it in conjunction with the API.
It should be noted that when configuring the calling script, you need to give the script executable rights and restart the program to take effect, for example:
#Give executable rights, script path/root/rats.sh chmod +x /root/rats.sh #Restart programRecommended site search: server rental US high defense, server space rental, Korean cheap server, overseas host rental, virtual host rental, .net space, free domain name registration, vip domain name, anti-complaint vps host, domain name,
发表评论