Skip to content

Commit 43502e5

Browse files
committed
更新[腾讯视频]签到脚本&说明 Cookie改为从APP中获取, Cookie有效期待观察
1 parent fc1723c commit 43502e5

2 files changed

Lines changed: 22 additions & 19 deletions

File tree

‎videoqq/README.md‎

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# 腾讯视频 (Surge & QuanX 二合一签到脚本)
22

3-
**由于获取的 Cookie 只有 2 小时有效期,目前此脚本使用意义不大,先弃坑**
3+
**2020.1.6** **~~从 网页 获取 Cookie 只有 2 小时有效期,使用意义不大,先弃坑~~**
44

5-
**由于获取的 Cookie 只有 2 小时有效期,目前此脚本使用意义不大,先弃坑**
6-
7-
**由于获取的 Cookie 只有 2 小时有效期,目前此脚本使用意义不大,先弃坑**
5+
**2020.1.7 从 APP 获取 Cookie,目测有效期能撑一段时间 (需要观察)**
86

97
> 代码已同时兼容 Surge & QuanX, 使用同一份签到脚本即可
108
@@ -14,37 +12,35 @@
1412

1513
```properties
1614
[MITM]
17-
v.qq.com
15+
vip.video.qq.com
1816

1917
[Script]
20-
http-request ^https:\/\/v\.qq\.com\/?.? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/videoqq/videoqq.cookie.js
18+
http-request ^https:\/\/vip\.video\.qq\.com\/?.? script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/videoqq/videoqq.cookie.js
2119
cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/videoqq/videoqq.js
2220
```
2321

2422
## 配置 (QuanX)
2523

2624
```properties
2725
[MITM]
28-
v.qq.com
26+
vip.video.qq.com
2927

3028
[rewrite_local]
31-
^https:\/\/v\.qq\.com\/?.? url script-response-body videoqq.cookie.js
29+
^https:\/\/vip\.video\.qq\.com\/?.? url script-response-body videoqq.cookie.js
3230

3331
[task_local]
3432
1 0 * * * videoqq.js
3533
```
3634

3735
## 说明
3836

39-
1. 先在浏览器登录 `(先登录! 先登录! 先登录!)`
40-
- 可以随便找个 vip 视频触发登录: https://m.v.qq.com/x/cover/r/rj8uc45tm8a17wm.html
41-
2. 先把`v.qq.com`加到`[MITM]`
42-
3. 再配置重写规则:
37+
1. 先把`vip.video.qq.com`加到`[MITM]`
38+
2. 再配置重写规则:
4339
- Surge: 把两条远程脚本放到`[Script]`
4440
- QuanX: 把`videoqq.cookie.js`和`videoqq.js`传到`On My iPhone - Quantumult X - Scripts` (传到 iCloud 相同目录也可, 注意要打开 quanx 的 iCloud 开关)
45-
4. 打开浏览器访问: https://v.qq.com
46-
5. 系统提示: `获取Cookie: 成功`
47-
6. 最后就可以把第 1 条脚本注释掉了
41+
3. 打开 APP, 访问下`个人中心`
42+
4. 系统提示: `获取Cookie: 成功` (如果不提示获取成功, 尝试杀进程再进个人中心)
43+
5. 最后就可以把第 1 条脚本注释掉了
4844

4945
> 第 1 条脚本是用来获取 cookie 的, 用浏览器访问一次获取 cookie 成功后就可以删掉或注释掉了, 但请确保在`登录成功`后再获取 cookie.
5046

‎videoqq/videoqq.js‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function sign() {
1717
let subTitle = ''
1818
let detail = ''
1919
if (result.ret == 0) {
20-
getexp()
20+
getexp(result)
2121
} else if (result.ret == -10006) {
2222
subTitle = '签到结果: 失败'
2323
detail = `原因: 未登录, 说明: ${result.msg}`
@@ -35,16 +35,23 @@ function sign() {
3535
chavy.done()
3636
}
3737

38-
function getexp() {
38+
function getexp(signresult) {
3939
const timestamp = Date.parse(new Date())
4040
let url = { url: `https://vip.video.qq.com/fcgi-bin/comm_cgi?name=spp_PropertyNum&cmd=1&growth_value=1&otype=json&_=${timestamp}`, headers: { Cookie: cookieVal } }
4141
url.headers['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15'
4242
chavy.get(url, (error, response, data) => {
4343
chavy.log(`${cookieName}, data: ${data}`)
4444
let result = JSON.parse(data.match(/QZOutputJson=\(([^\)]*)\)/)[1])
4545
const title = `${cookieName}`
46-
let subTitle = '签到结果: 成功'
47-
let detail = `V力值: ${result.GrowthValue.num}, 观影券: ${result.MovieTicket.num}, 赠片资格: ${result.GiveMovie.num}`
46+
let subTitle = ''
47+
let detail = ''
48+
if (signresult.checkin_score) {
49+
subTitle = '签到结果: 成功'
50+
detail = `V力值: ${result.GrowthValue.num} (+${signresult.checkin_score}), 观影券: ${result.MovieTicket.num}, 赠片资格: ${result.GiveMovie.num}`
51+
} else {
52+
subTitle = '签到结果: 成功 (重复签到)'
53+
detail = `V力值: ${result.GrowthValue.num}, 观影券: ${result.MovieTicket.num}, 赠片资格: ${result.GiveMovie.num}`
54+
}
4855
chavy.msg(title, subTitle, detail)
4956
})
5057
}

0 commit comments

Comments
 (0)