Fix parsing thumbnail url

This commit is contained in:
seven332 committed 2019-04-03 19:37:55 +08:00
1 parent 3530faabf1
commit 24612b7d14
1 file changed
+10 -2
@@ -16,6 +16,7 @@
package com.hippo.ehviewer.client.parser;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.NonNull;
import com.hippo.ehviewer.EhDB;
@@ -181,7 +182,14 @@ public class GalleryListParser {
gi.thumbHeight = 0;
}
// Thumb url
gi.thumb = EhUtils.handleThumbUrlResolution(img.attr("src"));
String url = img.attr("data-src");
if (TextUtils.isEmpty(url)) {
url = img.attr("src");
}
if (TextUtils.isEmpty(url)) {
url = null;
}
gi.thumb = EhUtils.handleThumbUrlResolution(url);
}
// Pages
@@ -306,7 +314,7 @@ public class GalleryListParser {
//noinspection unchecked
result.galleryInfoList = Collections.EMPTY_LIST;
return result;
} else if (body.contains("Currently Popular Recent Galleries")) {
} else if (d.getElementsByClass("ptt").isEmpty()) {
result.pages = 1;
} else {
result.pages = Integer.MAX_VALUE;