Created
October 11, 2020 15:06
-
-
Save buzztiaan/88c71bf17dcf04cf1fced809cdf0bccb to your computer and use it in GitHub Desktop.
torrent roulette!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import btdht | |
import binascii | |
import random | |
dht = btdht.DHT() | |
dht.start() | |
time.sleep(15) | |
peers = 0 | |
while peers < 10: | |
torrent = format(random.randrange(16**40), '040x') | |
#torrent = format(1026386259810461851159327840101891921412120041165, 'x') | |
print (" trying ", torrent) | |
output = dht.get_peers(binascii.a2b_hex(torrent)) | |
if not output is None : | |
print (output) | |
time.sleep(5) | |
output = dht.get_peers(binascii.a2b_hex(torrent)) | |
print (output) | |
if output is None : | |
peers = 0 | |
else: | |
print ("Found active torrent!") | |
peers = len(output) | |
print(output); | |
print(peers); | |
print(torrent); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment