MCPcopy
hub / github.com/jhao104/proxy_pool / createFromJson

Method createFromJson

helper/proxy.py:33–44  ·  view source on GitHub ↗
(cls, proxy_json)

Source from the content-addressed store, hash-verified

31
32 @classmethod
33 def createFromJson(cls, proxy_json):
34 _dict = json.loads(proxy_json)
35 return cls(proxy=_dict.get("proxy", ""),
36 fail_count=_dict.get("fail_count", 0),
37 region=_dict.get("region", ""),
38 anonymous=_dict.get("anonymous", ""),
39 source=_dict.get("source", ""),
40 check_count=_dict.get("check_count", 0),
41 last_status=_dict.get("last_status", ""),
42 last_time=_dict.get("last_time", ""),
43 https=_dict.get("https", False)
44 )
45
46 @property
47 def proxy(self):

Callers 6

testProxyClassFunction · 0.80
testRedisClientFunction · 0.80
testSsdbClientFunction · 0.80
getMethod · 0.80
popMethod · 0.80
getAllMethod · 0.80

Calls 1

getMethod · 0.45

Tested by 3

testProxyClassFunction · 0.64
testRedisClientFunction · 0.64
testSsdbClientFunction · 0.64