from scrapy.pipelines.images import ImagesPipeline

class ProxiedImagesPipeline(ImagesPipeline):
    def get_media_requests(self, item, info):
        for request in super().get_media_requests(item, info):
            request.meta['proxy'] = 'http://proxy.example:8080'
            yield request

For Scrapy 2.13.3, replace the standard ImagesPipeline entry in ITEM_PIPELINES with this subclass's import path. Retain IMAGES_STORE and other settings.

Calling the parent preserves its configured image-URL field and callbacks. The subclass adds only the request route, which enabled HttpProxyMiddleware consumes. Each image URL remains its destination. New public-image requests with no proxy credentials can use an entry from the HTTP proxy list when that route is permitted.

Page requests keep their own policy. With a global proxy environment, meta={'proxy': None} makes a selected page request direct in this release.

Check a download actually issued. A pipeline cache hit can avoid a network request. For new transfers, compare the completed-image result entries with requested URLs: successful operations appear there, while failures can leave the original image-URL field populated. Trace missing results through downloader logs and the chosen proxy.

Winndannde jowitiiɗe heen