| 25 | API_URL = "https://api.linkifier.com/downloadapi.svc/" |
| 26 | |
| 27 | def api_response(self, method, user, password, **kwargs): |
| 28 | post = {'login': user, |
| 29 | 'md5Pass': hashlib.md5(password).hexdigest(), |
| 30 | 'apiKey': self.API_KEY} |
| 31 | post.update(kwargs) |
| 32 | self.req.http.c.setopt(pycurl.HTTPHEADER, ["Content-Type: application/json; charset=utf-8"]) |
| 33 | res = json.loads(self.load(self.API_URL + method, |
| 34 | post=json.dumps(post))) |
| 35 | self.req.http.c.setopt(pycurl.HTTPHEADER, ["Content-Type: text/html; charset=utf-8"]) |
| 36 | return res |
| 37 | |
| 38 | def grab_hosters(self, user, password, data): |
| 39 | json_data = self.api_response("hosters", user, password) |