MCPcopy Index your code
hub / github.com/pyload/pyload / api_response

Method api_response

module/plugins/hoster/GoogledriveCom.py:41–62  ·  view source on GitHub ↗
(self, cmd, **kwargs)

Source from the content-addressed store, hash-verified

39 self.chunk_limit = 1
40
41 def api_response(self, cmd, **kwargs):
42 kwargs['key'] = self.API_KEY
43 try:
44 json_data = json.loads(self.load("%s%s" % (self.API_URL, cmd),
45 get=kwargs))
46 self.log_debug("API response: %s" % json_data)
47 return json_data
48
49 except BadHeader, e:
50 try:
51 json_data = json.loads(e.content)
52 self.log_error("API Error: %s" % cmd,
53 json_data['error']['message'],
54 "ID: %s" % self.info['pattern']['ID'],
55 "Error code: %s" % e.code)
56
57 except ValueError:
58 self.log_error("API Error: %s" % cmd,
59 e,
60 "ID: %s" % self.info['pattern']['ID'],
61 "Error code: %s" % e.code)
62 return None
63
64 def api_download(self):
65 try:

Callers 1

processMethod · 0.95

Calls 3

log_debugMethod · 0.80
log_errorMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected