Is there any way to name a crawled image with other info(text) that we get with the spider? for example in this case I want images with the article title and article published date that I got in spider:
spider file
# lines of code
def parse(self, response):
# lines of code
yield {
'date':date,
'title': article_title,
'image_urls': clean_urls
}
pipelines.py
from scrapy.pipelines.images import ImagesPipeline
class customImagesPipeline(ImagesPipeline):
def file_path(self, request, response=None, info=None, *, item=None):
return f"images/{request.url.split('/')[-1]}"