rule34: fix
parent
78dccb1ec8
commit
3203eae258
|
@ -25,13 +25,13 @@ def rule34(phenny, input):
|
||||||
|
|
||||||
doc = lxml.html.fromstring(req)
|
doc = lxml.html.fromstring(req)
|
||||||
doc.make_links_absolute('http://rule34.xxx/')
|
doc.make_links_absolute('http://rule34.xxx/')
|
||||||
thumb = doc.find_class('thumb')
|
thumbs = doc.find_class('thumb')
|
||||||
if len(thumb) <= 0:
|
if len(thumbs) <= 0:
|
||||||
phenny.reply("You just broke Rule 34! Better start uploading...")
|
phenny.reply("You just broke Rule 34! Better start uploading...")
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
link = thumb.find('a').attrib['href']
|
link = thumbs[0].find('a').attrib['href']
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
phenny.say("THE INTERNET IS FUCKING BROKEN. Please try again later.")
|
phenny.say("THE INTERNET IS FUCKING BROKEN. Please try again later.")
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue