How to share a big file via BitTorrent
Introduction
Sharing a big file via BitTorrent is a good way to share files with others. It is fast, because users can download the file from multiple sources at the same time. It is also efficient, because the file is divided into small pieces, and users can download the pieces in any order, even exchange pieces with each other.
First, you need to buy a server.
The server must have a good internet connection, and public IP address.
Prepare Server
Assume you have a server with Ubuntu 22.04 installed.
First, install aria2, tmux, and mktorrent.
sudo apt install -y mktorrent aria2
Get the trackers list
Next, get the list of trackers. There are some popular trackers you can use. For example: https://github.com/ngosang/trackerslist?tab=readme-ov-file.
udp://tracker.opentrackr.org:1337/announce
udp://open.tracker.cl:1337/announce
udp://open.demonii.com:1337/announce
udp://open.stealth.si:80/announce
udp://exodus.desync.com:6969/announce
udp://tracker.torrent.eu.org:451/announce
udp://tracker1.bt.moack.co.kr:80/announce
udp://tracker-udp.gbitt.info:80/announce
udp://explodie.org:6969/announce
https://tracker.tamersunion.org:443/announce
udp://tracker.tiny-vps.com:6969/announce
udp://tracker.dump.cl:6969/announce
udp://tracker.ccp.ovh:6969/announce
udp://tracker.bittor.pw:1337/announce
udp://run.publictracker.xyz:6969/announce
udp://retracker01-msk-virt.corbina.net:80/announce
udp://public.publictracker.xyz:6969/announce
udp://opentracker.io:6969/announce
udp://open.free-tracker.ga:6969/announce
udp://new-line.net:6969/announce
Prepare the file
Assume your file is located at /download/bigfile.zip.
Create a torrent file for the file.
cd /download
sudo mktorrent \
-a udp://tracker.opentrackr.org:1337/announce \
-a udp://open.tracker.cl:1337/announce \
-a udp://open.demonii.com:1337/announce \
-a udp://open.stealth.si:80/announce \
-a udp://exodus.desync.com:6969/announce \
-a udp://tracker.torrent.eu.org:451/announce \
-a udp://tracker1.bt.moack.co.kr:80/announce \
-a udp://tracker-udp.gbitt.info:80/announce \
-a udp://explodie.org:6969/announce \
-a https://tracker.tamersunion.org:443/announce \
-a udp://tracker.tiny-vps.com:6969/announce \
-a udp://tracker.dump.cl:6969/announce \
-a udp://tracker.ccp.ovh:6969/announce \
-a udp://tracker.bittor.pw:1337/announce \
-a udp://run.publictracker.xyz:6969/announce \
-a udp://retracker01-msk-virt.corbina.net:80/announce \
-a udp://public.publictracker.xyz:6969/announce \
-a udp://opentracker.io:6969/announce \
-a udp://open.free-tracker.ga:6969/announce \
-a udp://new-line.net:6969/announce \
-o bigfile.torrent \
bigfile.zip
That will create a bigfile.torrent file. You can share this file with others.
Start seeding
However, after you create the torrent file, nobody knows where to download the file from. So, you need to start seeding the file.
tmux new -s seeding
In the new tmux session, start seeding the file.
sudo ufw allow 6881
while true; do
aria2c --enable-dht=true --enable-dht6=true --enable-peer-exchange=true --bt-seed-unverified=true --bt-save-metadata=true --dir=$(pwd) --listen-port=6881 bigfile.torrent
sleep 5
done
That's it. You can share the torrent file with others, and they can download the file from your server.
Let users to download the file
You can share the torrent file with others, and they can download the file from your server.
They need to install any bittorrent client, such as qbittorrent, transmission, Motrix, Free Download Manager, etc.
Then, they can open the torrent file with the bittorrent client, and start downloading the file.
寫成一個簡單的 shell 腳本方便調用
让我抄抄