Commit 30c78e18 by yangchen

快咨询 的 自媒体号获取处理完成

parent 27063da5
...@@ -25,7 +25,7 @@ public class MediaSelfSource { ...@@ -25,7 +25,7 @@ public class MediaSelfSource {
public static void main(String[] args) { public static void main(String[] args) {
ProxyFactory.init("zookeeper://192.168.0.36:2181","local",GroupType.PROVIDER); ProxyFactory.init("zookeeper://192.168.0.36:2181","local",GroupType.PROVIDER);
List<String> urlList = new ArrayList<>(); List<String> urlList = new ArrayList<>();
urlList.add("https://tech.sina.cn/2019-07-30/detail-ihytcerm7194587.d.html"); urlList.add("http://www.360kuai.com/pc/965e4d0b2814eb5bc?cota=3&kuai_so=1&sign=360_e39369d1&refer_scene=so_3");
List<MediaSelfSourceBean> u = MediaSelfSource.getMediaSelfSource(urlList); List<MediaSelfSourceBean> u = MediaSelfSource.getMediaSelfSource(urlList);
for(MediaSelfSourceBean b : u) { for(MediaSelfSourceBean b : u) {
System.out.println(b.toString()); System.out.println(b.toString());
......
...@@ -399,7 +399,10 @@ public class MatchSource { ...@@ -399,7 +399,10 @@ public class MatchSource {
if(ma.find()) { if(ma.find()) {
String result = ma.group().replaceAll("window.__INITIAL_DATA__ =|\\</script\\>|", "").trim(); String result = ma.group().replaceAll("window.__INITIAL_DATA__ =|\\</script\\>|", "").trim();
JSONObject json = JSONObject.parseObject(result.substring(0,result.length()-1)); JSONObject json = JSONObject.parseObject(result.substring(0,result.length()-1));
source = json.getJSONObject("detail").getString("src"); 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){ if(Objects.nonNull(source) && source.length()>1){
......
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