parameters: (self, torrent_id)
return_statement: return None
docstring: Downloads the torrent at torrent_id using the authkey and passkey
docstring_summary: Downloads the torrent at torrent_id using the authkey and passkey
docstring_tokens: Downloads the torrent at torrent_id using the authkey and passkey
function: def get_torrent(self, torrent_id):
          '''Downloads the torrent at torrent_id using the authkey and passkey'''
          torrentpage = 'https://{0}/torrents.php'.format(WHAT_CD_DOMAIN)
          params = {'action': 'download', 'id': torrent_id}
          if self.authkey:
              params['authkey'] = self.authkey
              params['torrent_pass'] = self.passkey
          r = self.session.get(torrentpage, params=params, allow_redirects=False)
          if r.status_code == 200 and 'application/x-bittorrent' in r.headers['content-type']:
              filename = re.search('filename="(.*)"', r.headers['content-disposition']).group(1)
              return filename, r.content
          return None
function_tokens: def get_torrent ( self , torrent_id ) : torrentpage = 'https://{0}/torrents.php' . format ( WHAT_CD_DOMAIN ) params = { 'action' : 'download' , 'id' : torrent_id } if self . authkey : params [ 'authkey' ] = self . authkey params [ 'torrent_pass' ] = self . passkey r = self . session . get ( torrentpage , params = params , allow_redirects = False ) if r . status_code == 200 and 'application/x-bittorrent' in r . headers [ 'content-type' ] : filename = re . search ( 'filename="(.*)"' , r . headers [ 'content-disposition' ] ) . group ( 1 ) return filename , r . content return None