Ejemplo n.º 1
0
 public BKBook getBKBook(String url) {
   String content = hc.getAsString(url);
   Document document = Jsoup.parse(content);
   BKBook bb = new BKBook();
   bb.title = url;
   bb.dxid = StringUtils.substringBetween(url, "dxNumber=", "&");
   bb.title = BaokuDownload.normalize(document.select("#topsw").val());
   bb.status = 0;
   return bb;
 }
Ejemplo n.º 2
0
 public String getBaokuUrl(BKBook bb) {
   String content = hc.getAsString(bb.url);
   if (content.contains("我们检测到您的操作可能有异常"))
     throw new IllegalStateException("我们检测到您的操作可能有异常 " + bb.url);
   for (Element e : Jsoup.parse(content, bb.url).select(".btn a")) {
     if (e.text().equals("包库全文阅读")) {
       return e.absUrl("href");
     }
   }
   return null;
 }