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

Method download_request

scrapy/core/downloader/handlers/file.py:18–22  ·  view source on GitHub ↗
(self, request: Request)

Source from the content-addressed store, hash-verified

16
17class FileDownloadHandler(BaseDownloadHandler):
18 async def download_request(self, request: Request) -> Response:
19 filepath = file_uri_to_path(request.url)
20 body = await run_in_thread(Path(filepath).read_bytes)
21 respcls = responsetypes.from_args(filename=filepath, body=body)
22 return respcls(url=request.url, body=body)

Callers

nothing calls this directly

Calls 2

run_in_threadFunction · 0.90
from_argsMethod · 0.80

Tested by

no test coverage detected