Example #1
0
 def prepare_item_pipeline(meta_data: dict) -> Generator[FirmwareItem, None, None]:
     loader = ItemLoader(item=FirmwareItem(), selector=meta_data['file_urls'])
     loader.add_value('file_urls', meta_data['file_urls'])
     loader.add_value('vendor', meta_data['vendor'])
     loader.add_value('device_name', meta_data['device_name'])
     loader.add_value('device_class', meta_data['device_class'])
     loader.add_value('firmware_version', meta_data['firmware_version'])
     loader.add_value('release_date', meta_data['release_date'])
     yield loader.load_item()
Example #2
0
    def prepare_item_pipeline(response, meta_data):
        loader = ItemLoader(item=FirmwareItem(), response=response, date_fmt=['%Y-%m-%d'])

        loader.add_value('device_name', meta_data['device_name'])
        loader.add_value('vendor', meta_data['vendor'])
        loader.add_value('firmware_version', meta_data['firmware_version'])
        loader.add_value('device_class', meta_data['device_class'])
        loader.add_value('release_date', meta_data['release_date'])
        loader.add_value("file_urls", meta_data['file_urls'])

        return loader.load_item()