def relevant_resolvers

dracosc

New member
May 23, 2014
9
0
1
I borrowed the following code from Lambda's Ex**us.
try:
self.hostDict = urlresolver.relevant_resolvers(order_matters=True)
self.hostDict = [i.domains for i in self.hostDict if not '*' in i.domains]
self.hostDict = [i.lower() for i in reduce(lambda x, y: x+y, self.hostDict)]
self.hostDict = [x for y,x in enumerate(self.hostDict) if x not in self.hostDict[:y]]
except:
self.hostDict = []
As i understand, hostDict is used to filter hosts to only URLresolver compatible resolvers. The job is done well but there is an error somewhere i think!
Some resolvers including flashx and youwatch are excluded.....also this happens in Ex**us as well, as i cannot see any flashx and youwatch hosts anywhere!
Can someone help?
 

dracosc

New member
May 23, 2014
9
0
1
FIXED.....don't know why, but 'if not any(value in url for value in hostDict): raise Exception()' works much better than 'if not host in hostDict: raise Exception()'!!
Hope Lambda takes a look at this and edits his scrapers!
 

electromanjim

New member
Mar 13, 2013
22
0
0
FIXED.....don't know why, but 'if not any(value in url for value in hostDict): raise Exception()' works much better than 'if not host in hostDict: raise Exception()'!!
Hope Lambda takes a look at this and edits his scrapers!
Maybe direct this post to the Ex**us section or PM Lambda on your findings....

Cheers

Electromanjim