Code:
BT_CLIENTS = {
"uTorrent3.0-1" : {
"user-agent" : "uTorrent/3000(25756)",
"peer-id" : "-UT3000-",
"scrape" : True,
"comment" : "new",
},
"uTorrent3.0" : {
"user-agent" : "uTorrent/3000(25460)",
"peer-id" : "-UT3000-",
"scrape" : True,
"comment" : "new",
},
"uTorrent2.2.1" : {
"user-agent" : "uTorrent/2210(25130)",
"peer-id" : "-UT2210-",
"scrape" : False,
"comment" : "stable",
},
"uTorrent2.0B" : {
"user-agent" : "uTorrent/200B(17539)",
"peer-id" : "-UT200B-",
"scrape" : False,
"comment" : "stable",
},
"uTorrent1.85" : {
"user-agent" : "uTorrent/1850(17414)",
"peer-id" : "-UT1850-",
"scrape" : False,
"comment" : "stable",
},
"uTorrent1.83" : {
"user-agent" : "uTorrent183B(14809)",
"peer-id" : "-UT183B-",
"scrape" : False,
"comment" : "deprecated",
},
"uTorrent1.61" : {
"user-agent" : "uTorrent/1610",
"peer-id" : "-UT1610-",
"scrape" : False,
"comment" : "deprecated",
},
}
Code:
HEX = list("0123456789ABCDEF")
Code:
client_info = BT_CLIENTS[self.client_id]
# generate peer_id : based on client chosen
self.peer_id = client_info["peer-id"] + hex_to_byte("".join(random.sample(HEX*3, 24)))
12 random chars ... not such a good idea if you want to keep your accounts safe ... just saying
Bookmarks