MCPcopy
hub / github.com/scrapy/scrapy / download_request

Method download_request

scrapy/core/downloader/handlers/http2.py:98–110  ·  view source on GitHub ↗
(self, request: Request, spider: Spider)

Source from the content-addressed store, hash-verified

96 )
97
98 def download_request(self, request: Request, spider: Spider) -> Deferred[Response]:
99 from twisted.internet import reactor
100
101 timeout = request.meta.get("download_timeout") or self._connect_timeout
102 agent = self._get_agent(request, timeout)
103
104 start_time = monotonic()
105 d = agent.request(request, spider)
106 d.addCallback(self._cb_latency, request, start_time)
107
108 timeout_cl = reactor.callLater(timeout, d.cancel)
109 d.addBoth(self._cb_timeout, request, timeout, timeout_cl)
110 return d
111
112 @staticmethod
113 def _cb_latency(

Callers 1

download_requestMethod · 0.45

Calls 3

_get_agentMethod · 0.95
getMethod · 0.45
requestMethod · 0.45

Tested by

no test coverage detected