Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0183e33
更新[万达电影]: 2021 年 6 月 signcode
morooi Jun 15, 2021
6fcfd44
Merge pull request #356 from morooi/master
chavyleung Jun 15, 2021
9be8c2d
修复[万达电影]: 2021 年 6 月 signcode
morooi Jun 17, 2021
74b4c44
Merge pull request #357 from morooi/master
chavyleung Jun 17, 2021
646e9c4
更新[万达电影]: 2021 年 7 月 signcode
morooi Jul 3, 2021
a7d3f75
Merge pull request #362 from morooi/master
chavyleung Jul 3, 2021
d934e01
更新[BoxJs]: 增加抹掉 http_backend 脚本
chavyleung Jul 7, 2021
f8b7dbc
Boxjs: Bug fixes.
NobyDa Jul 14, 2021
f191a1b
修复(BoxJs): 部分情况手动运行脚本异常
chavyleung Jul 14, 2021
d07474c
Merge pull request #364 from NobyDa/patch-1
chavyleung Jul 14, 2021
ef3390c
feat: remove unused scripts
gideonsenku Jul 24, 2021
790da5e
Merge branch 'master' of https://github.com/chavyleung/scripts
gideonsenku Jul 24, 2021
4a828a7
Update Env.js
dukecd33369 Jul 26, 2021
34e5f4e
Update Env.js
dukecd33369 Jul 26, 2021
0f16731
Update Env.min.js
dukecd33369 Jul 26, 2021
e9d37a1
Update Env.min.js
dukecd33369 Jul 26, 2021
46b8d8f
更新[EnvJs]: 格式化代码
chavyleung Jul 27, 2021
ccb53e7
Merge pull request #367 from dukecd33369/master
chavyleung Jul 27, 2021
022eed2
Merge pull request #1 from chavyleung/master
dukecd33369 Jul 27, 2021
ae64eba
Update feng.js
dukecd33369 Sep 3, 2021
2961e16
Update README.md
dukecd33369 Sep 3, 2021
6f1ed1b
Merge pull request #371 from dukecd33369/master
chavyleung Sep 3, 2021
b5c9e4c
更新[喜马拉雅]: 获取 Cookie 正则及 hostname
chavyleung Sep 24, 2021
1f527f3
修改电信接口地址
HarryWang29 Sep 27, 2021
e97dab8
Update chavy.boxjs.json
HarryWang29 Sep 27, 2021
6e35917
Merge pull request #373 from HarryWang29/master
chavyleung Sep 27, 2021
48534c9
更新[EnvJs]: 支持QX点击通知复制设定内容
id77 Nov 24, 2021
5c63d66
Merge pull request #375 from id77/master
chavyleung Nov 24, 2021
35c0e3e
Update Env.js
qhq Dec 4, 2021
24d55be
Merge pull request #378 from qhq/patch-1
chavyleung Dec 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 10000/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
wapside.189.cn:9001

[Script]
http-request ^https:\/\/wapside.189.cn:9001\/api\/home\/homeInfo script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.cookie.js, requires-body=true
http-request ^https:\/\/wapside.189.cn:9001\/jt-sign\/api\/home\/homeInfo script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.cookie.js, requires-body=true
cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.js
```

Expand Down
19 changes: 12 additions & 7 deletions Env.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function Env(name, opts) {
this.isMute = false
this.isNeedRewrite = false
this.logSeparator = '\n'
this.encoding = 'utf-8'
this.startTime = new Date().getTime()
Object.assign(this, opts)
this.log('', `🔔${this.name}, 开始!`)
Expand Down Expand Up @@ -290,6 +291,7 @@ function Env(name, opts) {
(err) => callback(err)
)
} else if (this.isNode()) {
let iconv = require('iconv-lite')
this.initGotEnv(opts)
this.got(opts)
.on('redirect', (resp, nextOpts) => {
Expand All @@ -308,12 +310,12 @@ function Env(name, opts) {
})
.then(
(resp) => {
const { statusCode: status, statusCode, headers, body } = resp
callback(null, { status, statusCode, headers, body }, body)
const { statusCode: status, statusCode, headers, rawBody } = resp
callback(null, { status, statusCode, headers, rawBody }, iconv.decode(rawBody, this.encoding))
},
(err) => {
const { message: error, response: resp } = err
callback(error, resp, resp && resp.body)
callback(error, resp, resp && iconv.decode(resp.rawBody, this.encoding))
}
)
}
Expand Down Expand Up @@ -352,16 +354,17 @@ function Env(name, opts) {
(err) => callback(err)
)
} else if (this.isNode()) {
let iconv = require('iconv-lite')
this.initGotEnv(opts)
const { url, ..._opts } = opts
this.got[method](url, _opts).then(
(resp) => {
const { statusCode: status, statusCode, headers, body } = resp
callback(null, { status, statusCode, headers, body }, body)
const { statusCode: status, statusCode, headers, rawBody } = resp
callback(null, { status, statusCode, headers, rawBody }, iconv.decode(rawBody, this.encoding))
},
(err) => {
const { message: error, response: resp } = err
callback(error, resp, resp && resp.body)
callback(error, resp, resp && iconv.decode(resp.rawBody, this.encoding))
}
)
}
Expand Down Expand Up @@ -426,7 +429,9 @@ function Env(name, opts) {
} else if (this.isQuanX()) {
let openUrl = rawopts['open-url'] || rawopts.url || rawopts.openUrl
let mediaUrl = rawopts['media-url'] || rawopts.mediaUrl
return { 'open-url': openUrl, 'media-url': mediaUrl }
let updatePasteboard =
rawopts['update-pasteboard'] || rawopts.updatePasteboard
return { 'open-url': openUrl, 'media-url': mediaUrl, 'update-pasteboard': updatePasteboard }
} else if (this.isSurge()) {
let openUrl = rawopts.url || rawopts.openUrl || rawopts['open-url']
return { url: openUrl }
Expand Down
2 changes: 1 addition & 1 deletion Env.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading