Scrapy manually sending item to pipeline does not fire item_passed signal
<p>I'm trying to write a crawler which does the following job:
Start from a specific URL, then crawl the pages up to a depth limit (simple Scrapy task). During this time, check the first 1 kB of the header field, and extract the file information with <a href="https://github.com/ahupp/python-magic" rel="nofollow noreferrer">Magic</a>. If it is a file, I want to send it to a pipeline for further processing.</p>
<p>What I did so far is:</p>
<pre><code>def process_links(self, links):

    for link in links:
        try:
            req = urlopen(link.url)
        except Exception as e:
            self.logger.error(&quot;--&gt; Exception URL[%s]: %s&quot;, link, e)
            req = None

        if req is not None:
            ext_type = magic.from_buffer(req.read(1024))
            if 'HTML' in ext_type:
                yield link
            else:
                item = FileItem()
                item[&quot;type&quot;] = &quot;FILE&quot;
                item[&quot;url&quot;] = link.url
                item[&quot;extension&quot;] = ext_type
                itemproc = self.crawler.engine.scraper.itemproc
                itemproc.process_item(item, self)
</code></pre>
<p>So I basically get the URLs from the scraped page, then depending on their type, either I yield a new Request or I send a new FileItem item to the pipeline manually (with the last two lines)</p>
<p>I also have parse_page function for parsing HTML pages:</p>
<pre><code>def parse_page(self, response):

    item = PageItem()
    item[&quot;type&quot;] = &quot;PAGE&quot;
    item[&quot;url&quot;] = response.request.url
    item[&quot;depth&quot;] = response.meta['depth']
    item[&quot;response_url&quot;] = response.url
    item[&quot;status_code&quot;] = response.status
    item[&quot;status_msg&quot;] = &quot;OK&quot;
    item[&quot;request_headers&quot;] = response.request.headers
    item[&quot;body&quot;] = response.body
    item[&quot;links&quot;] = []
    yield item
</code></pre>
<p>Which yields the PageItem object.</p>
<p>Although the yielded PageItem fires the item_passed signal in Scrapy, manually passed FileItems do not fire the signal. Am I missing something while manually passing the FileItems to the pipeline?</p>
<p>Thanks in advance!</p>