Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

QQ: scraper library #8

Open
mgaulton opened this issue Aug 9, 2017 · 0 comments
Open

QQ: scraper library #8

mgaulton opened this issue Aug 9, 2017 · 0 comments

Comments

@mgaulton
Copy link

mgaulton commented Aug 9, 2017

I'm trying to cobble something together to take a torrent / magnet as input, get the HASH and Trackers, then verify that there are at lease X seeds active. I found your library on a stackoverflow there and wondering if you could suggest a method.
My attempt so far has failed with either "TypeError: Odd-length string" or bombed due to domain not existing.

excerpt

Open torrent file

torrent_file = open(sys.argv[1], "rb")
metainfo = bencode.bdecode(torrent_file.read())
info = metainfo['info']
print metainfo['announce']
print hashlib.sha1(bencode.bencode(info)).hexdigest()
torrent_hash = hashlib.sha1(bencode.bencode(info)).hexdigest()
tracker = metainfo['announce']
scrape(tracker,torrent_hash)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant