From 05cfabae10413357e2bec31a6210a4acb2bcb88a Mon Sep 17 00:00:00 2001 From: seven332 Date: Sun, 29 Jun 2014 02:37:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20gid=20token=20=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/hippo/ehviewer/ehclient/DetailParser.java | 9 +++++++-- src/com/hippo/ehviewer/ehclient/EhClient.java | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/com/hippo/ehviewer/ehclient/DetailParser.java b/src/com/hippo/ehviewer/ehclient/DetailParser.java index 569a72929..e405e55fc 100644 --- a/src/com/hippo/ehviewer/ehclient/DetailParser.java +++ b/src/com/hippo/ehviewer/ehclient/DetailParser.java @@ -24,12 +24,10 @@ import java.util.LinkedList; import java.util.regex.Matcher; import java.util.regex.Pattern; -import com.hippo.ehviewer.ListUrls; import com.hippo.ehviewer.data.Comment; import com.hippo.ehviewer.data.LargePreviewList; import com.hippo.ehviewer.data.NormalPreviewList; import com.hippo.ehviewer.data.PreviewList; -import com.hippo.ehviewer.util.Log; import com.hippo.ehviewer.util.Util; public class DetailParser { @@ -46,11 +44,13 @@ public class DetailParser { public static final int COMMENT = 0x10; public static final int OFFENSIVE = 0x20; public static final int PINING = 0x40; + public static final int ERROR = 0x80; private static final CommentSort cs = new CommentSort(); private int mMode; + public String eMesg; public String thumb; public String title; public String title_jpn; @@ -81,6 +81,11 @@ public class DetailParser { Pattern p; Matcher m; + if (!body.contains("<")) { + eMesg = body; + return ERROR; + } + if (body.contains(OFFENSIVE_STRING)) { return OFFENSIVE; } diff --git a/src/com/hippo/ehviewer/ehclient/EhClient.java b/src/com/hippo/ehviewer/ehclient/EhClient.java index 2e4ccdc71..2d78e4f25 100644 --- a/src/com/hippo/ehviewer/ehclient/EhClient.java +++ b/src/com/hippo/ehviewer/ehclient/EhClient.java @@ -438,6 +438,8 @@ public class EhClient { md.previewLists[0] = parser.previewList; md.comments = parser.comments; listener.onSuccess(md); + } else if (result == DetailParser.ERROR) { + listener.onFailure(parser.eMesg); } else { listener.onFailure(mAppContext.getString(R.string.em_parser_error)); }