Add get_tracker_peers script
This commit is contained in:
parent
f0f82d4b13
commit
4ee2d5534e
19
Pipfile
19
Pipfile
|
@ -6,17 +6,18 @@ verify_ssl = true
|
|||
[dev-packages]
|
||||
|
||||
[packages]
|
||||
tqdm = "*"
|
||||
pillow = "*"
|
||||
matplotlib = "*"
|
||||
pandas = "*"
|
||||
numpy = "*"
|
||||
pyyaml = "*"
|
||||
ebooklib = "*"
|
||||
python-libxdo = "*"
|
||||
requests = "*"
|
||||
beautifulsoup4 = "*"
|
||||
bencode.py = "4"
|
||||
ebooklib = "*"
|
||||
flask = "*"
|
||||
matplotlib = "*"
|
||||
numpy = "*"
|
||||
pandas = "*"
|
||||
pillow = "*"
|
||||
python-libxdo = "*"
|
||||
pyyaml = "*"
|
||||
requests = "*"
|
||||
tqdm = "*"
|
||||
|
||||
[requires]
|
||||
python_version = "3.8"
|
||||
|
|
43
Pipfile.lock
generated
43
Pipfile.lock
generated
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "d4a5af2b7f999bc59d2508fdcd0099fab1cde1eceee5c2f233bbbb3f27a34081"
|
||||
"sha256": "4dc1f219fe0e75649026fbb1117619d56ef330f6e993237cf1897278399bdb83"
|
||||
},
|
||||
"pipfile-spec": 6,
|
||||
"requires": {
|
||||
|
@ -25,6 +25,13 @@
|
|||
"index": "pypi",
|
||||
"version": "==4.9.1"
|
||||
},
|
||||
"bencode": {
|
||||
"hashes": [
|
||||
"sha256:0301c2202233a3f274c940702bac7bd02d5d053b8bf9502b085156270e30be9b"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==1.0"
|
||||
},
|
||||
"certifi": {
|
||||
"hashes": [
|
||||
"sha256:5930595817496dd21bb8dc35dad090f1c2cd0adfaf21204bf6732ca5d8ee34d3",
|
||||
|
@ -237,25 +244,25 @@
|
|||
},
|
||||
"pandas": {
|
||||
"hashes": [
|
||||
"sha256:2b89a916b533849a84a9625b5ed74ec0df8a986787468dc4c950a6c790c156f4",
|
||||
"sha256:365323a94de00324c262c344abdb714b08c16f05496c79d5ad37de942ed4b862",
|
||||
"sha256:3db6385efa2739ad41fce265ba2ab15dea7a77579ad5c47b851ba1830b161135",
|
||||
"sha256:53a6039f96a60afddea1368dbf49f6c8d46fa009dadbd5edd059f8cb8ddbbe47",
|
||||
"sha256:63ea1de1b0577d446169c534dfec97c812ee4442e1268f54c4f01e6c6d1c7513",
|
||||
"sha256:87bec0cca6e2435dc96bf063cfa332cd11825b48d6199974916acaff5d80ea80",
|
||||
"sha256:8dd0d1217eb4466f3953e2cc66102c17c4fe1ad3ec4eee7e270cfd156ae9c9fb",
|
||||
"sha256:9352a0519a1109d9809cc8f524f57405ff9b1bc14fd07a86703852bc6996a310",
|
||||
"sha256:991b9b847b5f850271b19975fad8ad412d92ffe29dfae48ce141ec9510f93d36",
|
||||
"sha256:a4046d3fea187d7028e2d290bf0ef0486be3ee5cb28db986d2f00454baf3d24a",
|
||||
"sha256:a99300fc95f1614f012582010c7c353dbc213bbf4412df0125adfdb5a8bf1753",
|
||||
"sha256:bc33490bb9ccc21afd0c6a5660bbdaf7096c100d1ab3aceca73ad6b233124fb6",
|
||||
"sha256:be9f60701d4e41282f51389dbce06e755f8db39d3f22274a9d043cd59995bd20",
|
||||
"sha256:cc60b03e9d5f42026b5055901fd2e098938b06a697de4bcc4cd2622ca2f82172",
|
||||
"sha256:e9d14bdb16ad6f9006c9d1ea9af9e9dd144de456d24b28c21fc219a42c9684d5",
|
||||
"sha256:ffcaf569c0caff0f9cc2dcf533fdafd062029d4b48e46841cbc418eb2433a7b3"
|
||||
"sha256:0210f8fe19c2667a3817adb6de2c4fd92b1b78e1975ca60c0efa908e0985cbdb",
|
||||
"sha256:0227e3a6e3a22c0e283a5041f1e3064d78fbde811217668bb966ed05386d8a7e",
|
||||
"sha256:0bc440493cf9dc5b36d5d46bbd5508f6547ba68b02a28234cd8e81fdce42744d",
|
||||
"sha256:16504f915f1ae424052f1e9b7cd2d01786f098fbb00fa4e0f69d42b22952d798",
|
||||
"sha256:182a5aeae319df391c3df4740bb17d5300dcd78034b17732c12e62e6dd79e4a4",
|
||||
"sha256:35db623487f00d9392d8af44a24516d6cb9f274afaf73cfcfe180b9c54e007d2",
|
||||
"sha256:40ec0a7f611a3d00d3c666c4cceb9aa3f5bf9fbd81392948a93663064f527203",
|
||||
"sha256:47a03bfef80d6812c91ed6fae43f04f2fa80a4e1b82b35aa4d9002e39529e0b8",
|
||||
"sha256:4b21d46728f8a6be537716035b445e7ef3a75dbd30bd31aa1b251323219d853e",
|
||||
"sha256:4d1a806252001c5db7caecbe1a26e49a6c23421d85a700960f6ba093112f54a1",
|
||||
"sha256:60e20a4ab4d4fec253557d0fc9a4e4095c37b664f78c72af24860c8adcd07088",
|
||||
"sha256:9f61cca5262840ff46ef857d4f5f65679b82188709d0e5e086a9123791f721c8",
|
||||
"sha256:a15835c8409d5edc50b4af93be3377b5dd3eb53517e7f785060df1f06f6da0e2",
|
||||
"sha256:b39508562ad0bb3f384b0db24da7d68a2608b9ddc85b1d931ccaaa92d5e45273",
|
||||
"sha256:ed60848caadeacecefd0b1de81b91beff23960032cded0ac1449242b506a3b3f",
|
||||
"sha256:fc714895b6de6803ac9f661abb316853d0cd657f5d23985222255ad76ccedc25"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==1.1.0rc0"
|
||||
"version": "==1.1.0"
|
||||
},
|
||||
"pillow": {
|
||||
"hashes": [
|
||||
|
|
26
get_tracker_peers.py
Executable file
26
get_tracker_peers.py
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env python3
|
||||
import bencodepy
|
||||
import itertools
|
||||
import requests
|
||||
|
||||
|
||||
def grouper(n, iterable, fillvalue=None):
|
||||
"grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
|
||||
args = [iter(iterable)] * n
|
||||
return itertools.zip_longest(*args, fillvalue=fillvalue)
|
||||
|
||||
|
||||
for torrent in bencodepy.decode(
|
||||
requests.get("http://tracker.sbruder.de:6969/scrape").content
|
||||
)[b"files"].keys():
|
||||
print("magnet:?xt=urn:btih:" + torrent.hex())
|
||||
for peer in grouper(
|
||||
6,
|
||||
bencodepy.decode(
|
||||
requests.get(
|
||||
"http://tracker.sbruder.de:6969/announce",
|
||||
params={"info_hash": torrent, "peer_id": "acabacabacabacabacab"},
|
||||
).content
|
||||
)[b"peers"],
|
||||
):
|
||||
print(".".join(map(str, peer[:4])), int.from_bytes(peer[-2:], "big"))
|
Loading…
Reference in a new issue