Skip to content

Commit 1272dd2

Browse files
committed
更新[人人视频]: 修复报错, 需重取Cookie, 接入BoxJs
1 parent a3919ea commit 1272dd2

2 files changed

Lines changed: 41 additions & 13 deletions

File tree

‎box/chavy.boxjs.json‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,15 @@
345345
"repo": "https://github.com/chavyleung/scripts/tree/master/ximalaya",
346346
"icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/ximalaya.png", "https://raw.githubusercontent.com/Orz-3/task/master/ximalaya.png"],
347347
"script": "https://raw.githubusercontent.com/chavyleung/scripts/master/ximalaya/ximalaya.js"
348+
},
349+
{
350+
"id": "rrtv",
351+
"name": "人人视频",
352+
"keys": ["chavy_cookie_rrtv"],
353+
"author": "@chavyleung",
354+
"repo": "https://github.com/chavyleung/scripts/tree/master/rrtv",
355+
"icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/rrtv.png", "https://raw.githubusercontent.com/Orz-3/task/master/rrtv.png"],
356+
"script": "https://raw.githubusercontent.com/chavyleung/scripts/master/rrtv/rrtv.js"
348357
}
349358
]
350359
}

‎rrtv/rrtv.js‎

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,21 @@ let VAL_signcookie = chavy.getdata(KEY_signcookie)
1414
await answerquestion()
1515
await getquestion()
1616
}
17-
await openbox('copperbox', '铜宝箱', 'simpleBody=nUuymDQ/BcC2Q6QH21Tjww23J7qtVaDlUN17k1/KY%2BXGDsRVwDRJ8YfjAMraptIL%0D%0A4t2g56kUpDGFsn9z6%2BofyiL5QwfBYZBZOTw9stNt9mc%3D')
18-
await openbox('silverbox', '银宝箱', 'simpleBody=nUuymDQ/BcC2Q6QH21Tjww23J7qtVaDlUN17k1/KY%2BXGDsRVwDRJ8YfjAMraptIL%0D%0ADPPhFllL7eBnJs52RODWxxe9rquyWdYcDcbyirN6KiE%3D')
19-
await openbox('goldenbox', '金宝箱', 'simpleBody=3abxJMn7LwEdH8u1Xpe2qN6AtFpDhBrmviLyoU%2BunKwnS1IGS7DIfS0HiKtt03G0%0D%0A/zVCARFyXUFFrOxLRrgAS4m/u4BiQYWJzTUeUqLAFZk%3D')
17+
await openbox(
18+
'copperbox',
19+
'铜宝箱',
20+
'simpleBody=nUuymDQ/BcC2Q6QH21Tjww23J7qtVaDlUN17k1/KY%2BXGDsRVwDRJ8YfjAMraptIL%0D%0A4t2g56kUpDGFsn9z6%2BofyiL5QwfBYZBZOTw9stNt9mc%3D'
21+
)
22+
await openbox(
23+
'silverbox',
24+
'银宝箱',
25+
'simpleBody=nUuymDQ/BcC2Q6QH21Tjww23J7qtVaDlUN17k1/KY%2BXGDsRVwDRJ8YfjAMraptIL%0D%0ADPPhFllL7eBnJs52RODWxxe9rquyWdYcDcbyirN6KiE%3D'
26+
)
27+
await openbox(
28+
'goldenbox',
29+
'金宝箱',
30+
'simpleBody=3abxJMn7LwEdH8u1Xpe2qN6AtFpDhBrmviLyoU%2BunKwnS1IGS7DIfS0HiKtt03G0%0D%0A/zVCARFyXUFFrOxLRrgAS4m/u4BiQYWJzTUeUqLAFZk%3D'
31+
)
2032
await getinfo()
2133
showmsg()
2234
chavy.done()
@@ -28,15 +40,16 @@ function signdaily() {
2840
url.headers['clientType'] = `ios_rrsp_jzsp`
2941
url.headers['Accept-Encoding'] = `gzip, deflate, br`
3042
url.headers['Connection'] = `keep-alive`
31-
url.headers['clientVersion'] = `4.3.5`
43+
url.headers['clientVersion'] = `4.10.1`
3244
url.headers['Content-Type'] = `application/x-www-form-urlencoded; charset=UTF-8`
3345
url.headers['Origin'] = `https://mobile.rr.tv`
3446
url.headers['Referer'] = `https://mobile.rr.tv/`
3547
url.headers['Accept'] = `application/json, text/plain, */*`
3648
url.headers['Host'] = `api.rr.tv`
3749
url.headers['Accept-Language'] = `zh-cn`
3850
url.headers['Content-Length'] = `12`
39-
url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 App/RRSPApp platform/iPhone AppVersion/4.3.5'
51+
url.headers['User-Agent'] =
52+
'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 App/RRSPApp platform/iPhone AppVersion/4.10.1'
4053
chavy.post(url, (error, response, data) => {
4154
try {
4255
signinfo.signdaily = JSON.parse(data)
@@ -65,7 +78,8 @@ function signwelfare() {
6578
url.headers['Host'] = `api.rr.tv`
6679
url.headers['Accept-Language'] = `zh-cn`
6780
url.headers['Content-Length'] = `45`
68-
url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 App/RRSPApp platform/iPhone AppVersion/4.3.5'
81+
url.headers['User-Agent'] =
82+
'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 App/RRSPApp platform/iPhone AppVersion/4.10.1'
6983
chavy.post(url, (error, response, data) => {
7084
try {
7185
signinfo.signwelfare = JSON.parse(data)
@@ -86,15 +100,16 @@ function getinfo() {
86100
url.headers['clientType'] = `ios_rrsp_jzsp`
87101
url.headers['Accept-Encoding'] = `gzip, deflate, br`
88102
url.headers['Connection'] = `keep-alive`
89-
url.headers['clientVersion'] = `4.3.5`
103+
url.headers['clientVersion'] = `4.10.1`
90104
url.headers['Content-Type'] = `application/x-www-form-urlencoded; charset=UTF-8`
91105
url.headers['Origin'] = `https://mobile.rr.tv`
92106
url.headers['Referer'] = `https://mobile.rr.tv/`
93107
url.headers['Accept'] = `application/json, text/plain, */*`
94108
url.headers['Host'] = `api.rr.tv`
95109
url.headers['Accept-Language'] = `zh-cn`
96110
url.headers['Content-Length'] = `0`
97-
url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 App/RRSPApp platform/iPhone AppVersion/4.3.5'
111+
url.headers['User-Agent'] =
112+
'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 App/RRSPApp platform/iPhone AppVersion/4.10.1'
98113
chavy.post(url, (error, response, data) => {
99114
try {
100115
signinfo.userinfo = JSON.parse(data)
@@ -115,17 +130,19 @@ function getquestion() {
115130
url.headers['clientType'] = `ios_rrsp_jzsp`
116131
url.headers['Accept-Encoding'] = `gzip, deflate, br`
117132
url.headers['Connection'] = `keep-alive`
118-
url.headers['clientVersion'] = `4.3.5`
133+
url.headers['clientVersion'] = `4.10.1`
119134
url.headers['Content-Type'] = `application/x-www-form-urlencoded; charset=UTF-8`
120135
url.headers['Origin'] = `https://mobile.rr.tv`
121136
url.headers['Referer'] = `https://mobile.rr.tv/`
122137
url.headers['Accept'] = `application/json, text/plain, */*`
123138
url.headers['Host'] = `api.rr.tv`
124139
url.headers['Accept-Language'] = `zh-cn`
125140
url.headers['Content-Length'] = `0`
126-
url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 App/RRSPApp platform/iPhone AppVersion/4.3.5'
141+
url.headers['User-Agent'] =
142+
'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 App/RRSPApp platform/iPhone AppVersion/4.10.1'
127143
chavy.post(url, (error, response, data) => {
128144
try {
145+
console.log(data)
129146
signinfo.question = JSON.parse(data)
130147
signinfo.questionopts = {}
131148
for (opt of signinfo.question.data.question.optionViewList) {
@@ -156,15 +173,16 @@ function answerquestion() {
156173
url.headers['clientType'] = `ios_rrsp_jzsp`
157174
url.headers['Accept-Encoding'] = `gzip, deflate, br`
158175
url.headers['Connection'] = `keep-alive`
159-
url.headers['clientVersion'] = `4.3.5`
176+
url.headers['clientVersion'] = `4.10.1`
160177
url.headers['Content-Type'] = `application/x-www-form-urlencoded; charset=UTF-8`
161178
url.headers['Origin'] = `https://mobile.rr.tv`
162179
url.headers['Referer'] = `https://mobile.rr.tv/`
163180
url.headers['Accept'] = `application/json, text/plain, */*`
164181
url.headers['Host'] = `api.rr.tv`
165182
url.headers['Accept-Language'] = `zh-cn`
166183
url.headers['Content-Length'] = `0`
167-
url.headers['User-Agent'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 App/RRSPApp platform/iPhone AppVersion/4.3.5'
184+
url.headers['User-Agent'] =
185+
'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 App/RRSPApp platform/iPhone AppVersion/4.10.1'
168186
chavy.post(url, (error, response, data) => {
169187
try {
170188
signinfo.answerquestion = JSON.parse(data)
@@ -243,7 +261,8 @@ function showmsg() {
243261
if (signinfo.question.data.question) {
244262
detail += `\n查看答题详情`
245263
detail += `\n\n问题: ${signinfo.question.data.question.questionStr}`
246-
for (key in signinfo.questionopts) detail += `\n选项: ${signinfo.questionopts[key].optionStr}, 回答人数: ${signinfo.questionopts[key].answererCount} (${signinfo.questionopts[key].percent})`
264+
for (key in signinfo.questionopts)
265+
detail += `\n选项: ${signinfo.questionopts[key].optionStr}, 回答人数: ${signinfo.questionopts[key].answererCount} (${signinfo.questionopts[key].percent})`
247266
if (signinfo.selectId) {
248267
detail += `\n最佳回答: ${signinfo.answeropt.optionStr}`
249268
detail += `\n我的回答: ${signinfo.questionopts[signinfo.selectId].optionStr}`

0 commit comments

Comments
 (0)