Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
toutiao
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhiwei
toutiao
Commits
1d1ff5f8
Commit
1d1ff5f8
authored
Dec 19, 2019
by
zhiwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交新的js加密参数
parent
061bc022
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
pom.xml
+1
-1
src/main/java/com/zhiwei/toutiao/bean/Signature.java
+2
-6
No files found.
pom.xml
View file @
1d1ff5f8
...
@@ -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>
...
...
src/main/java/com/zhiwei/toutiao/bean/Signature.java
View file @
1d1ff5f8
...
@@ -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
max
BehotTime
){
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
[])
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment