Commit 1d1ff5f8 by zhiwei

提交新的js加密参数

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