from mirror.utils import is_absurl, domain class Injections(object): def process_item(self, item, spider): item['injections'] = [other for own in item['url'] for other in item['injections'] if domain(other) != domain(own) and is_absurl(other) ] return item