Fix parse category of gallery detail

This commit is contained in:
seven332 committed 2019-03-19 20:54:57 +08:00
1 parent b101ae142d
commit b0ccfe4793
1 file changed
+5 -3
@@ -167,9 +167,11 @@ public class GalleryDetailParser {
// Category
Element gdc = gm.getElementById("gdc");
try {
String href = gdc.child(0).attr("href");
String category = href.substring(href.lastIndexOf('/') + 1);
gd.category = EhUtils.getCategory(category);
Element ce = JsoupUtils.getElementByClass(gdc, "cn");
if (ce == null) {
ce = JsoupUtils.getElementByClass(gdc, "cs");
}
gd.category = EhUtils.getCategory(ce.text());
} catch (Throwable e) {
ExceptionUtils.throwIfFatal(e);
gd.category = EhUtils.UNKNOWN;