title: Torrent Tracker info hash GET Request- Python
body: <p>I'm trying to connect to a torrent tracker to receive a list of peers to play bit torrent with, however I am having trouble forming the proper GET request.</p>
  
  <p>As far as I understand, I must obtain the 20 byte SHA1 hash of the bencoded 'info' section from the .torrent file. I use the following code:</p>
  
  <pre><code>h = hashlib.new('sha1')
  h.update(bencode.bencode(meta_dict['info']))
  info_hash =  h.digest()
  </code></pre>
  
  <p>This is where I am stuck. I can not figure out how to create the proper url-encoded info_hash to stick into a URL string as a parameter.</p>
  
  <p>I believe it involves some combination of urllib.urlencode and urllib.quote, however my attempts have not worked so far.</p>