'Checks entry filename if it\'s found from content-disposition'

def filename_from_headers(self, entry, response):

    if (not response.headers.get(u'content-disposition')):
        return
    filename = parse_header(response.headers[u'content-disposition'])[1].get(u'filename')
    if filename:
        try:
            filename = native_str_to_text(filename, encoding=u'latin1')
            log.debug(u'filename    header    latin1    decoded')
        except UnicodeError:
            try:
                filename = native_str_to_text(filename, encoding=u'utf-8')
                log.debug(u'filename    header    UTF-8    decoded')
            except UnicodeError:
                pass
        filename = decode_html(filename)
        log.debug(u'Found    filename    from    headers:    %s', filename)
        if (u'filename' in entry):
            log.debug(u'Overriding    filename    %s    with    %s    from    content-disposition', entry[u'filename'], filename)
        entry[u'filename'] = filename
