You need to sign in or sign up before continuing.
Commit 1d1ff5f8 by zhiwei

提交新的js加密参数

parent 061bc022
......@@ -15,7 +15,7 @@
<dependency>
<groupId>com.zhiwei.crawler</groupId>
<artifactId>crawler-core</artifactId>
<version>0.5.2-SNAPSHOT</version>
<version>0.5.6.2-RELEASE</version>
<scope>provided</scope>
</dependency>
<dependency>
......
......@@ -56,14 +56,11 @@ public class Signature {
* @return
* @throws IOException
*/
private String getSign(String userId, String max_behot_time){
private String getSign(String userId, String maxBehotTime){
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("javascript");
String jsText = getJSText(); // 读取js文件
String str = "0";
if(userId!=null){
str = userId + max_behot_time;
}
String str = "https://www.toutiao.com/toutiao/api/pc/feed/?category=pc_profile_ugc&utm_source=toutiao&visit_user_id=" + userId + "&max_behot_time=" + maxBehotTime;
try {
engine.eval(jsText);
if(engine instanceof Invocable) {
......@@ -130,7 +127,6 @@ public class Signature {
/**
* 将二进制转换成16进制字符串
* @Title bytesToHexString
* @param buf
* @return String
*/
private static String bytesToHexString(byte bytes[]) {
......
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