mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-03 16:14:10 +01:00
Google: Fix false positives on embedded thumbnails (eg. Youtube results).
This commit is contained in:
parent
847e51a7ec
commit
aa2f9202ec
@ -75,8 +75,8 @@ class GoogleHTMLParser(HTMLParser):
|
||||
if tag in STACKED_TAGS:
|
||||
self.stack.append(tag)
|
||||
|
||||
if tag == 'a' and attrs['href'].startswith('/url?q='):
|
||||
assert self.state == ParserState.OUTSIDE, (self.state, self.current_title)
|
||||
if tag == 'a' and attrs['href'].startswith('/url?q=') \
|
||||
and self.state == ParserState.OUTSIDE:
|
||||
self.state = ParserState.IN_LINK
|
||||
href = attrs['href'][len('/url?q='):]
|
||||
self.current_link = utils.web.urlunquote(utils.web.htmlToText(href.split('&sa')[0]))
|
||||
|
Loading…
Reference in New Issue
Block a user