How to convert torrent info hash for scrape?

前端 未结 3 2065
心在旅途
心在旅途 2021-01-06 14:14

I have a torrent hash from the magnet link. For example: fda164e7af470f83ea699a529845a9353cc26576 When I try to get information about leechers and peers I should request: ht

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-06 14:42

    Got this python snippet from a colleague,

    r = ''
    s = 'fda164e7af470f83ea699a529845a9353cc26576'
    for n in range(0, len(s), 2):
        r += '%%%s' % s[n:n+2].upper()
    print r
    

    Output: %FD%A1%64%E7%AF%47%0F%83%EA%69%9A%52%98%45%A9%35%3C%C2%65%76

    Works like a charm.

    Edit: Works like a charm for getting the tracker to give back status 200 (ok) but still doesn't work for retrieving the torrent details...

提交回复
热议问题