feat: add FileDownloadCrawler#2043
Conversation
4669391 to
db4ded0
Compare
Pijukatel
left a comment
There was a problem hiding this comment.
For large files, it would be great to have something like https://pypi.org/project/smart-open/ , but our storages lacks interface to support such chunked uploads
vdusek
left a comment
There was a problem hiding this comment.
Otherwise it looks great
| ) | ||
|
|
||
| self._statistics.register_status_code(response.status_code) | ||
| context.request.state = RequestState.AFTER_NAV |
There was a problem hiding this comment.
From Claude:
The streamed path never sets
context.request.loaded_url, whereas the bufferedcrawl()path does (request.loaded_url = str(response.url)). As a result, in stream mode_check_url_after_redirectsis effectively skipped (it's guarded byif loaded_url is not None), so off-domain redirects aren't filtered by the enqueue strategy, andcontext.request.loaded_urlstaysNonefor user code. It's a silent divergence between the two modes. Thestream()API doesn't expose the final URL, so this may be hard to fix cleanly, but worth a note/follow-up.
There was a problem hiding this comment.
That's true. But we can't do that without updating the HTTP clients API. This will be fixed along with #874 when the clients are synchronized with Crawlee JS v4.
Description
FileDownloadCrawlerwith support for streaming the response body in the request handler.Issues
FileDownloadcrawler #875Testing
FileDownloadCrawler