Compare commits

...

6 Commits

Author SHA1 Message Date
Faker
6dd13acc3b Update jd_indeps.sh 2025-01-22 09:39:33 +08:00
Faker
1e24b81f26 1 2025-01-21 09:42:27 +08:00
Faker
cc17878bc6 1 2025-01-19 13:49:13 +08:00
Faker
4eef47bd48 update 2025-01-19 01:32:05 +08:00
Faker
cdfb72b517 1 2025-01-17 14:55:50 +08:00
Faker
d3586e06af 1 2025-01-17 09:38:07 +08:00
21 changed files with 1763 additions and 1807 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,147 +4,149 @@ const got = require('got');
require('dotenv').config(); require('dotenv').config();
const { readFile } = require('fs/promises'); const { readFile } = require('fs/promises');
const path = require('path'); const path = require('path');
const qlDir = '/ql';
const fs = require('fs'); const fs = require('fs');
let Fileexists280 = fs.existsSync('/ql/data/db/keyv.sqlite');
let Fileexists = fs.existsSync('/ql/data/config/auth.json'); let Fileexists = fs.existsSync('/ql/data/config/auth.json');
let authFile=""; let authFile = "";
if (Fileexists) if (Fileexists280)
authFile="/ql/data/config/auth.json" authFile = "/ql/data/db/keyv.sqlite"
else if (Fileexists)
authFile = "/ql/data/config/auth.json"
else else
authFile="/ql/config/auth.json" authFile = "/ql/config/auth.json"
//const authFile = path.join(qlDir, 'config/auth.json');
const api = got.extend({ const api = got.extend({
prefixUrl: 'http://127.0.0.1:5600', prefixUrl: 'http://127.0.0.1:5600',
retry: { limit: 0 }, retry: { limit: 0 },
}); });
async function getToken() { async function getToken() {
const authConfig = JSON.parse(await readFile(authFile)); const authConfig = await readFile(authFile);
return authConfig.token; // console.log(authConfig.toString().match(/"token":"(.*?)",/)[1])
return authConfig.toString().match(/"token":"(.*?)",/)[1];
} }
// getToken()
module.exports.getEnvs = async () => { module.exports.getEnvs = async () => {
const token = await getToken(); const token = await getToken();
const body = await api({ const body = await api({
url: 'api/envs', url: 'api/envs',
searchParams: { searchParams: {
searchValue: 'JD_COOKIE', searchValue: 'JD_COOKIE',
t: Date.now(), t: Date.now(),
}, },
headers: { headers: {
Accept: 'application/json', Accept: 'application/json',
authorization: `Bearer ${token}`, authorization: `Bearer ${token}`,
}, },
}).json(); }).json();
return body.data; return body.data;
}; };
module.exports.getEnvsCount = async () => { module.exports.getEnvsCount = async () => {
const data = await this.getEnvs(); const data = await this.getEnvs();
return data.length; return data.length;
}; };
module.exports.addEnv = async (cookie, remarks) => { module.exports.addEnv = async (cookie, remarks) => {
const token = await getToken(); const token = await getToken();
const body = await api({ const body = await api({
method: 'post', method: 'post',
url: 'api/envs', url: 'api/envs',
params: { t: Date.now() }, params: { t: Date.now() },
json: [{ json: [{
name: 'JD_COOKIE', name: 'JD_COOKIE',
value: cookie, value: cookie,
remarks, remarks,
}], }],
headers: { headers: {
Accept: 'application/json', Accept: 'application/json',
authorization: `Bearer ${token}`, authorization: `Bearer ${token}`,
'Content-Type': 'application/json;charset=UTF-8', 'Content-Type': 'application/json;charset=UTF-8',
}, },
}).json(); }).json();
return body; return body;
}; };
module.exports.updateEnv = async (cookie, eid, remarks) => { module.exports.updateEnv = async (cookie, eid, remarks) => {
const token = await getToken(); const token = await getToken();
const body = await api({ const body = await api({
method: 'put', method: 'put',
url: 'api/envs', url: 'api/envs',
params: { t: Date.now() }, params: { t: Date.now() },
json: { json: {
name: 'JD_COOKIE', name: 'JD_COOKIE',
value: cookie, value: cookie,
_id: eid, _id: eid,
remarks, remarks,
}, },
headers: { headers: {
Accept: 'application/json', Accept: 'application/json',
authorization: `Bearer ${token}`, authorization: `Bearer ${token}`,
'Content-Type': 'application/json;charset=UTF-8', 'Content-Type': 'application/json;charset=UTF-8',
}, },
}).json(); }).json();
return body; return body;
}; };
module.exports.updateEnv11 = async (cookie, eid, remarks) => { module.exports.updateEnv11 = async (cookie, eid, remarks) => {
const token = await getToken(); const token = await getToken();
const body = await api({ const body = await api({
method: 'put', method: 'put',
url: 'api/envs', url: 'api/envs',
params: { t: Date.now() }, params: { t: Date.now() },
json: { json: {
name: 'JD_COOKIE', name: 'JD_COOKIE',
value: cookie, value: cookie,
id: eid, id: eid,
remarks, remarks,
}, },
headers: { headers: {
Accept: 'application/json', Accept: 'application/json',
authorization: `Bearer ${token}`, authorization: `Bearer ${token}`,
'Content-Type': 'application/json;charset=UTF-8', 'Content-Type': 'application/json;charset=UTF-8',
}, },
}).json(); }).json();
return body; return body;
}; };
module.exports.DisableCk = async (eid) => { module.exports.DisableCk = async (eid) => {
const token = await getToken(); const token = await getToken();
const body = await api({ const body = await api({
method: 'put', method: 'put',
url: 'api/envs/disable', url: 'api/envs/disable',
params: { t: Date.now() }, params: { t: Date.now() },
body: JSON.stringify([eid]), body: JSON.stringify([eid]),
headers: { headers: {
Accept: 'application/json', Accept: 'application/json',
authorization: `Bearer ${token}`, authorization: `Bearer ${token}`,
'Content-Type': 'application/json;charset=UTF-8', 'Content-Type': 'application/json;charset=UTF-8',
}, },
}).json(); }).json();
return body; return body;
}; };
module.exports.EnableCk = async (eid) => { module.exports.EnableCk = async (eid) => {
const token = await getToken(); const token = await getToken();
const body = await api({ const body = await api({
method: 'put', method: 'put',
url: 'api/envs/enable', url: 'api/envs/enable',
params: { t: Date.now() }, params: { t: Date.now() },
body: JSON.stringify([eid]), body: JSON.stringify([eid]),
headers: { headers: {
Accept: 'application/json', Accept: 'application/json',
authorization: `Bearer ${token}`, authorization: `Bearer ${token}`,
'Content-Type': 'application/json;charset=UTF-8', 'Content-Type': 'application/json;charset=UTF-8',
}, },
}).json(); }).json();
return body; return body;
}; };
module.exports.getstatus = async(eid) => { module.exports.getstatus = async (eid) => {
const envs = await this.getEnvs(); const envs = await this.getEnvs();
var tempid = 0; var tempid = 0;
for (let i = 0; i < envs.length; i++) { for (let i = 0; i < envs.length; i++) {
tempid = 0; tempid = 0;
if (envs[i]._id) { if (envs[i]._id) {
tempid = envs[i]._id; tempid = envs[i]._id;
} }
@ -158,7 +160,7 @@ module.exports.getstatus = async(eid) => {
return 99; return 99;
}; };
module.exports.getEnvById = async(eid) => { module.exports.getEnvById = async (eid) => {
const envs = await this.getEnvs(); const envs = await this.getEnvs();
var tempid = 0; var tempid = 0;
for (let i = 0; i < envs.length; i++) { for (let i = 0; i < envs.length; i++) {
@ -177,28 +179,28 @@ module.exports.getEnvById = async(eid) => {
}; };
module.exports.getEnvByPtPin = async (Ptpin) => { module.exports.getEnvByPtPin = async (Ptpin) => {
const envs = await this.getEnvs(); const envs = await this.getEnvs();
for (let i = 0; i < envs.length; i++) { for (let i = 0; i < envs.length; i++) {
var tempptpin = decodeURIComponent(envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/) && envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/)[1]); var tempptpin = decodeURIComponent(envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/) && envs[i].value.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
if(tempptpin==Ptpin){ if (tempptpin == Ptpin) {
return envs[i]; return envs[i];
} }
} }
return ""; return "";
}; };
module.exports.delEnv = async (eid) => { module.exports.delEnv = async (eid) => {
const token = await getToken(); const token = await getToken();
const body = await api({ const body = await api({
method: 'delete', method: 'delete',
url: 'api/envs', url: 'api/envs',
params: { t: Date.now() }, params: { t: Date.now() },
body: JSON.stringify([eid]), body: JSON.stringify([eid]),
headers: { headers: {
Accept: 'application/json', Accept: 'application/json',
authorization: `Bearer ${token}`, authorization: `Bearer ${token}`,
'Content-Type': 'application/json;charset=UTF-8', 'Content-Type': 'application/json;charset=UTF-8',
}, },
}).json(); }).json();
return body; return body;
}; };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

19
jd_dplh0117.js Normal file

File diff suppressed because one or more lines are too long

19
jd_dplh0121.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,46 +1,64 @@
#!/usr/bin/env bash #!/usr/bin/env bash
#依赖安装,运行一次就好 #依赖安装
#0 8 5 5 * jd_indeps.sh #0 8 5 5 * jd_indeps.sh
#new Env('依赖安装') #new Env('依赖安装');
#updatedate:20240903
# #
npm_ver=$(pnpm -v | awk -F. '{print $1}') DIR="$( pwd )"
if [[ $npm_ver -ge 7 ]]; then dir_root=/ql
dir_repo=$dir_root/repo
dir_deps=$dir_root/deps
if [[ $AUTOCFG == 'true' ]];then
if [[ -z "$(echo "$DIR"|grep 'main')" ]];then
dir_code=$dir_log/6dylan6_jdpro_jd_sharecode
repo='6dylan6_jdpro'
else
dir_code=$dir_log/6dylan6_jdpro_main_jd_sharecode
repo='6dylan6_jdpro_main'
fi
[[ -d $dir_root/data ]] && dir_data=$dir_root/data
[[ -d $dir_data/repo ]] && dir_repo=$dir_data/repo
[[ -d $dir_data/deps ]] && dir_deps=$dir_data/deps
cp $dir_repo/${repo}/sendNotify.js $dir_deps/ > /dev/null 2>&1
echo -e "\n已配置sendNotify.js文件到deps目录下再次执行订阅生效\n"
else
echo -e "\n如需自动配置sendNotify.js文件到desp目录下请配置变量AUTOCFG='true'\n"
fi
npm_ver=`pnpm -v|awk -F. '{print $1}'`
if [[ $npm_ver -ge 7 ]];then
export PNPM_HOME="/root/.local/share/pnpm" export PNPM_HOME="/root/.local/share/pnpm"
export PATH="$PNPM_HOME:$PATH" export PATH="$PNPM_HOME:$PATH"
fi fi
echo -e "安装脚本所需依赖,不一定一次全部安装成功,请自己检查\n" echo -e "安装所需依赖,不一定一次全部安装成功,完成请检查\n"
echo -e "开始安装............\n" echo -e "开始安装............\n"
#apk add g++ make pixman-dev pango-dev cairo-dev pkgconf --no-cache #apk add g++ make pixman-dev pango-dev cairo-dev pkgconf --no-cache
apk add g++ make --no-cache #apk add g++ make --no-cache
pnpm config set registry https://registry.npmmirror.com pnpm config set registry https://registry.npmmirror.com
pnpm install -g pnpm install -g
pnpm install -g adler-32 pnpm i -g tough-cookie
pnpm install -g png-js pnpm i -g ds@2.0.2
pnpm install -g date-fns pnpm i -g png-js@1.0.0
pnpm install -g axios@1.6.7 pnpm i -g date-fns@3.6.0
pnpm install -g crypto-js pnpm i -g axios@1.7.4
pnpm install -g ts-md5 pnpm i -g crypto-js@4.2.0
pnpm install -g tslib # pnpm install -g ts-md5@1.3.1
pnpm install -g global-agent # pnpm install -g tslib@2.6.3
pnpm install -g @types/node # pnpm install -g @types/node@22.4.0
pnpm install -g request pnpm i -g request@2.88.2
pnpm install -g jsdom pnpm i -g jsdom@24.1.1
pnpm install -g crc pnpm i -g moment@2.30.1
pnpm install -g qs pnpm i -g cheerio@1.0.0
pnpm install -g moment pnpm i -g tunnel
pnpm install -g cheerio # pnpm install -g tough-cookie@4.1.4
pnpm install -g dotenv pnpm i -g https-proxy-agent@7.0.5
pnpm install -g got@11.8.6 pip3 install -i https://pypi.doubanio.com/simple/ jieba
pnpm install -g sharp@0.32.6 pip3 install -i https://pypi.doubanio.com/simple/ requests
pnpm install -g tough-cookie
pnpm install -g https-proxy-agent@7.0.2
pnpm install -g http-cookie-agent
pnpm install -g console-table-printer@2.12.0
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ jieba
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ requests
rm -rf /usr/local/pnpm-global/5/node_modules/.pnpm/canvas* rm -rf /usr/local/pnpm-global/5/node_modules/.pnpm/canvas*
rm -rf /root/.local/share/pnpm/global/5/.pnpm/canvas* rm -rf /root/.local/share/pnpm/global/5/.pnpm/canvas*
pnpm i -g sharp@0.32.0
echo -e "\n所需依赖安装完成请检查有没有报错可尝试再次运行" echo -e "\n所需依赖安装完成请检查有没有报错可尝试再次运行"

File diff suppressed because one or more lines are too long

14
jd_opencard_0107.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -730,18 +730,20 @@ async function try_feedsList(tabId, page) {
} }
} }
async function h5stSign(body, appId, version = '5.0.3') { async function h5stSign(body, appId, version) {
const options = { const options = {
method: 'POST', method: 'POST',
url: `${args_xh.h5st_server}/h5st`, url: `${args_xh.h5st_server}/h5st`,
headers: { 'content-type': 'application/json' }, headers: { 'content-type': 'application/json' },
data: { data: {
version: version,
pin: $.UserName, pin: $.UserName,
ua: $.userAgent, ua: $.userAgent,
body, body,
appId, appId,
}, },
if (version) {
data.version = version;
}
}; };
const { data } = await axios.request(options); const { data } = await axios.request(options);
return data.body; return data.body;

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff