BTSU is a torrent website project, powered by p2pspider and django.
Online Demo: BTSU Torrents
-
Install Node.js
sudo apt-get install nodejs nodejs-legacy npm -y
-
Install dependent packages
cd p2pspider npm install -g # if encountered error - Cannot find module, please use: npm install
-
Install pm2 and run index.js with pm2 cluster mode
sudo npm install pm2 -g cd p2pspider sudo pm2 start index.js -i 0
All torrent files which get from DHT Network will be saved in p2pspider/torrents
, need to use transmission
to parse them and save hash
, name
, magnet
and info
into database.
-
Install transmission
sudo apt-get install transmission-cli -y
-
Parse torrents and save to database
# python utils/tor2db.py <torrents_folder> <database_path> python utils/tor2db.py p2pspider/torrents btsu/btsu/torrents.db
-
If you already have old torrents.db which created in the past, and you want to merge it with your current one
# python utils/mergedb.py <a.db> <b.db> python utils/mergedb.py torrents.db old_torrents.db
BTSU is a django project, please:
-
install Django
pip install Django # or install from requirements.txt pip install -r requirements.txt
-
update the
TOR_DB_PATH
and add your server ip intoALLOWED_HOSTS
inbtsu/btsu/settings.py
before you run the server.# python {your_code_path}/btsu/manage.py runserver 0.0.0.0:{your_port} python btsu/btsu/manage.py runserver 0.0.0.0:1234
keep_running.sh
is a script which can keep the BTSU running and restart it when the server down.
Please update the {your_code_path}
inside before you use it.
fs_watchdog.py
is a script which can watch torrents folder and update database while get new torrent. You need to install watchdog before use it.
pip install watchdog
# or install from requirements.txt
pip install -r requirements.txt
# then
python fs_watchdog.py <torrent_folder> <database>
Now BTSU support download magnet through transmission-web.
Please setup TRANSMISSION_USER
, TRANSMISSION_PWD
, TRANSMISSION_WEB
and set TRANSMISSION_SET = True
in settings.py
then you can add magnet link to your transmission-daemon.