Fixed batoto search bug.
authorFredrik Tolf <fredrik@dolda2000.com>
Wed, 11 Dec 2013 01:08:59 +0000 (02:08 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Wed, 11 Dec 2013 01:08:59 +0000 (02:08 +0100)
manga/batoto.py

index 6869973..cab29b5 100644 (file)
@@ -144,6 +144,9 @@ class library(lib.library):
             page = soup(resp.read())
         finally:
             resp.close()
+        none = page.find("p", attrs={"class": "no_messages"})
+        if none is not None and u"No results" in none.text:
+            return []
         ret = []
         for child in page.find("div", id="search_results").ol.childGenerator():
             if isinstance(child, BeautifulSoup.Tag) and child.name == u"li":