Scrapy, a fast high-level web crawling & scraping framework for Python.
make thumb_path method backwards compatible
Mohammadtaher Abbasi896f16f2def7
diff --git a/scrapy/pipelines/images.py b/scrapy/pipelines/images.pyindex 45ac03820..6b97190ee 100644--- a/scrapy/pipelines/images.py+++ b/scrapy/pipelines/images.py@@ -179,6 +179,6 @@ class ImagesPipeline(FilesPipeline):image_guid = hashlib.sha1(to_bytes(request.url)).hexdigest()return f'full/{image_guid}.jpg'- def thumb_path(self, request, thumb_id, response=None, info=None, item=None):+ def thumb_path(self, request, thumb_id, response=None, info=None, *, item=None):thumb_guid = hashlib.sha1(to_bytes(request.url)).hexdigest()return f'thumbs/{thumb_id}/{thumb_guid}.jpg'diff --git a/scrapy/pipelines/media.py b/scrapy/pipelines/media.pyindex d1bccf323..430c37227 100644--- a/scrapy/pipelines/media.py+++ b/scrapy/pipelines/media.py@@ -121,7 +121,7 @@ class MediaPipeline:def _make_compatible(self):"""Make overridable methods of MediaPipeline and subclasses backwards compatible"""methods = [- "file_path", "media_to_download", "media_downloaded",+ "file_path", "thumb_path", "media_to_download", "media_downloaded","file_downloaded", "image_downloaded", "get_images"]