Answer the question
In order to leave comments, you need to log in
How to start torrenting in python?
I want to automatically create a torrent file and start streaming using python
I found the torf module
And created the first torrent file
from torf import Torrent
t = Torrent(path='text.txt',
trackers=['udp://tracker.openbittorrent.com:80/announce',
'udp://tracker.opentrackr.org:1337/announce'],
comment='This is a comment')
t.private = True
t.generate()
print(t.magnet())
t.write('my.torrent')
Answer the question
In order to leave comments, you need to log in
I advise you to read the answer here: https://ru.stackoverflow.com/questions/1239765/How to...
updated:
You should probably run your file and be sure to specify the download folder where your files are already located for distribution
upd2 :
You it's worth using python-qbittorrent to start downloading your file right away. Before that, you must activate the web interface, it's easy: * click *
from qbittorrent import Client
qb = Client('http://127.0.0.1:8080/')
qb.login()
dl_path = 'special-dir/'
torrent_file = open('my-torrent-file.torrent', 'rb')
qb.download_from_file(torrent_file, savepath=dl_path)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question