Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests, json, urllib
- class T411():
- api = 'https://api.t411.me'
- def __init__(self, username, password):
- r = requests.post( '%s/auth' % self.api, dict(username=username,password=password), verify=False )
- j = json.loads( r.content )
- self.header = dict(authorization=j['token'])
- def search(self, search, fields): #fields ne doit pas etre vide
- url = '%s/torrents/search/%s?%s' % ( self.api, urllib.quote_plus(search), urllib.urlencode(fields) )
- r = requests.get( url, headers=self.header, verify=False )
- j = json.loads( r.content )
- return j['torrents']
- t411 = T411(USERNAME,PASSWORD)
- print t411.search('naruto',dict(cid=406,limit=200))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement