|
|
|
|
@ -154,7 +154,7 @@ public class ParseJob implements ParseCallback { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void checkResult(Map<String, String> headers, String url, String from, boolean error) { |
|
|
|
|
if (isPass(headers, url)) { |
|
|
|
|
if (url.length() > 40) { |
|
|
|
|
onParseSuccess(headers, url, from); |
|
|
|
|
} else if (error) { |
|
|
|
|
onParseError(); |
|
|
|
|
@ -168,16 +168,6 @@ public class ParseJob implements ParseCallback { |
|
|
|
|
else onParseSuccess(result.getHeaders(), result.getUrl().v(), result.getJxFrom()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean isPass(Map<String, String> headers, String url) { |
|
|
|
|
try { |
|
|
|
|
if (url.length() < 40) return false; |
|
|
|
|
int code = OkHttp.newCall(url, Headers.of(headers)).execute().code(); |
|
|
|
|
return code == 200 || code == 302; |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void startWeb(List<Parse> items, String webUrl) { |
|
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
|
for (Parse item : items) sb.append(item.getUrl()).append(";"); |
|
|
|
|
|