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

Method run

helper/fetch.py:35–48  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

33 self.proxy_handler = ProxyHandler()
34
35 def run(self):
36 self.log.info("ProxyFetch - {func}: start".format(func=self.fetch_source))
37 try:
38 for proxy in self.fetcher():
39 self.log.info('ProxyFetch - %s: %s ok' % (self.fetch_source, proxy.ljust(23)))
40 proxy = proxy.strip()
41 if proxy in self.proxy_dict:
42 self.proxy_dict[proxy].add_source(self.fetch_source)
43 else:
44 self.proxy_dict[proxy] = Proxy(
45 proxy, source=self.fetch_source)
46 except Exception as e:
47 self.log.error("ProxyFetch - {func}: error".format(func=self.fetch_source))
48 self.log.error(str(e))
49
50
51class Fetcher(object):

Callers

nothing calls this directly

Calls 2

ProxyClass · 0.90
add_sourceMethod · 0.80

Tested by

no test coverage detected