How does scrapy get item? in the file_path () function?

    def gen_media_requests(self, item, info):
        for image_url in item["cimage_urls"]:
            yield scrapy.Request(image_url, meta={"item": item})

    def file_path(self, request, response=None, info=None):
        item = request.meta.get("item", "test")
        name = item["name"]
        image_guid = request.url.split("/")[-1]
        return "full/%s/%s" % (name, image_guid)

I put item in meta and passed it to file_path (), according to the above code, but debug found that in file_path (), meta is empty. I need to store pictures in a folder according to a field in item. If the above code can not be easily modified to achieve the effect, is there any other way?


function name is wrong, it is get_media_requests

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35b1d-2b72f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35b1d-2b72f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?