Skip to content

Commit

Permalink
add hook path
Browse files Browse the repository at this point in the history
  • Loading branch information
nondanee committed Feb 24, 2019
1 parent cffa03f commit 4f25718
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ hook.target.path = [
'/api/v1/search/get',
'/api/cloudsearch/pc',
'/api/v1/playlist/manipulate/tracks',
'/api/song/like'
'/api/song/like',
'/api/v1/play/record',
'/api/playlist/v4/detail'
]

hook.http.before = ctx => {
Expand Down Expand Up @@ -114,6 +116,7 @@ hook.http.after = ctx => {
netease.encrypted = true
netease.jsonBody = JSON.parse(crypto.eapi.decrypt(buffer).toString())
}

if(netease.path.includes('manipulate') && [401, 512].includes(netease.jsonBody.code))
return tryCollect(ctx)
else if(netease.path == '/api/song/like' && [401, 512].includes(netease.jsonBody.code))
Expand Down

0 comments on commit 4f25718

Please sign in to comment.