|
@@ -166,7 +166,7 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
|
|
|
kuaishouVideoService.saveOrUpdate(video);
|
|
|
}
|
|
|
}
|
|
|
- if (feeds.getPcursor() == null || !feeds.getPcursor().equals("no_more")) {
|
|
|
+ if (feeds.getPcursor() == null || !"no_more".equals(feeds.getPcursor())) {
|
|
|
Thread.sleep((int) Math.random() * 5000 + 10000);
|
|
|
getVedioList(principalId, feeds.getPcursor(), ttf, ++times);
|
|
|
}
|
|
@@ -186,6 +186,7 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
public void adkuaishouWebLogin(String phone, String password) {
|
|
|
// System.getProperties().setProperty("webdriver.chrome.driver", "D:/chromedriver.exe");
|
|
|
System.getProperties().setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver");
|
|
@@ -243,6 +244,7 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
public void getVideoList(String uid) {
|
|
|
// System.getProperties().setProperty("webdriver.chrome.driver", "D:/chromedriver.exe");
|
|
|
System.getProperties().setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver");
|
|
@@ -295,28 +297,29 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
|
|
|
BasicClientCookie cookie = new BasicClientCookie("clientid", "3");
|
|
|
cookie.setDomain("live.kuaishou.com"); //设置范围
|
|
|
cookie.setPath("/");
|
|
|
- cookie.setExpiryDate(new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 365));
|
|
|
+ cookie.setExpiryDate(new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 24 * 365));
|
|
|
HttpUtils2.cookieStore.addCookie(cookie);
|
|
|
|
|
|
BasicClientCookie cookie1 = new BasicClientCookie("did", "web_1615d3ad757d4fb8558ed4d7dbecf5fc");
|
|
|
cookie1.setDomain("live.kuaishou.com"); //设置范围web_a5735c4f9f02ad9ee48677499927341c
|
|
|
cookie1.setPath("/");
|
|
|
- cookie1.setExpiryDate(new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 365));
|
|
|
+ cookie1.setExpiryDate(new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 24 * 365));
|
|
|
HttpUtils2.cookieStore.addCookie(cookie1);
|
|
|
|
|
|
BasicClientCookie cookie2 = new BasicClientCookie("client_key", "65890b29");
|
|
|
cookie2.setDomain("live.kuaishou.com"); //设置范围
|
|
|
cookie2.setPath("/");
|
|
|
- cookie2.setExpiryDate(new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 365));
|
|
|
+ cookie2.setExpiryDate(new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 24 * 365));
|
|
|
HttpUtils2.cookieStore.addCookie(cookie2);
|
|
|
|
|
|
BasicClientCookie cookie3 = new BasicClientCookie("kuaishou.live.bfb1s", "3e261140b0cf7444a0ba411c6f227d88");
|
|
|
cookie3.setDomain("live.kuaishou.com"); //设置范围
|
|
|
cookie3.setPath("/");
|
|
|
- cookie3.setExpiryDate(new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 365));
|
|
|
+ cookie3.setExpiryDate(new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 24 * 365));
|
|
|
HttpUtils2.cookieStore.addCookie(cookie3);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
public String checkKuaishouUser(String videoUrl) {
|
|
|
String html = HttpUtils2.httpGetRequest(videoUrl);
|
|
|
HttpUtils2.cookieStore.clear();
|
|
@@ -326,7 +329,7 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
|
|
|
|
|
|
while (m.find()) {
|
|
|
uid = m.group().replace("/profile/", "").replace("\"", "");
|
|
|
- if (uid != null && !uid.equals("") && !uid.equals("null")) {
|
|
|
+ if (uid != null && !"".equals(uid) && !"null".equals(uid)) {
|
|
|
return uid;
|
|
|
}
|
|
|
}
|
|
@@ -373,7 +376,7 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
|
|
|
Long commentId = commentNode.get("comment_id").asLong();
|
|
|
deleteCommentById(photoId, commentId, headers);
|
|
|
}
|
|
|
- if (pcursor != null && !pcursor.equals("no_more")) {
|
|
|
+ if (pcursor != null && !"no_more".equals(pcursor)) {
|
|
|
deletePhotoComment(photoId, pcursor, headers);
|
|
|
}
|
|
|
}
|
|
@@ -382,6 +385,7 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
public void deleteAllComment(Map<String, String> pcursorMap) {
|
|
|
try {
|
|
|
Map<String, String> headers = new HashMap<>();
|
|
@@ -405,7 +409,7 @@ public class KuaishouWebInterfaceServiceImpl implements IKuaishouWebInterfaceSer
|
|
|
Long photoId = photoNode.get("photoId").asLong();
|
|
|
deletePhotoComment(photoId, "", headers);
|
|
|
}
|
|
|
- if (pcursor != null && !pcursor.equals("no_more")) {
|
|
|
+ if (pcursor != null && !"no_more".equals(pcursor)) {
|
|
|
pcursorMap = mapper.readValue(node.get("pcursorMap").toString(), new TypeReference<Map<String, String>>() {
|
|
|
});
|
|
|
deleteAllComment(pcursorMap);
|