from scrapy.pipelines.images import ImagesPipeline

from .files import GridFSFilesPipeline


class GridFSImagesPipeline(ImagesPipeline, GridFSFilesPipeline):
    """
    An extension of ImagesPipeline that store files in MongoDB GridFS.
    Is using a guid to check if the file exists in GridFS and MongoDB ObjectId to reference the file with item.
    ImagesPipeline was using a single variable 'path' for reference and identification.
    guid is used in MongoGridFSFilesPipeline because the pipeline needs a unique identifier generated based on file URL.
    MongoGridFSFilesPipeline is using ObjectId to reference the file because it's the primary key.
    """

@@ -650,16 +650,163 @@
 ry key.%0A    %22%22%22%0A
+%0A    @classmethod%0A    def from_settings(cls, settings):%0A        store_uri = settings%5B'MONGO_URI'%5D%0A        return cls(store_uri, settings=settings)%0A

Add GridFSImagesPipeline.from_settings to use MONGO_URI