Commit 8c8442e6 by chenweiyang

冲突处理

parent bb108a86
......@@ -428,6 +428,20 @@ public class MatchSource {
}
}
}
if(source.length() < 1 && html.contains("window.__INITIAL_DATA__ =")) {
Matcher ma = Pattern.compile("window.__INITIAL_DATA__ =[\\s\\S]+?}}").matcher(html);
if(ma.find()) {
String result = ma.group().replaceAll("window.__INITIAL_DATA__ =|\\</script\\>|", "").trim();
if(result.contains("window.autohomePVDDWhiteList")) {
result = result.split("window.autohomePVDDWhiteList")[0];
}
JSONObject json = JSONObject.parseObject(result.trim());
source = json.getJSONObject("detail").getString("sec_src");
if(Objects.isNull(source) || source.length() < 1) {
source = json.getJSONObject("detail").getString("src");
}
}
}
if(Objects.nonNull(source) && source.length()>1){
source = "快资讯-" + source;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment