mirror of
https://github.com/okyyds/yyds.git
synced 2026-07-13 01:01:17 +08:00
update
This commit is contained in:
40
jd_live.js
40
jd_live.js
@@ -134,12 +134,10 @@ function getTaskList() {
|
||||
|
||||
async function getauthorId(liveId) {
|
||||
let functionId = `liveDetailV910`
|
||||
let body = escape(JSON.stringify({"liveId":liveId,"fromId":"","liveList":[],"sku":"","source":"17","d":"","direction":"","isNeedVideo":1}))
|
||||
let uuid = randomString(16)
|
||||
let sign = await getSign(functionId, decodeURIComponent(body), uuid)
|
||||
let url = `https://api.m.jd.com/client.action?functionId=${functionId}&build=167774&client=apple&clientVersion=10.1.0&uuid=${uuid}&${sign}`
|
||||
let body = {"liveId":liveId,"fromId":"","liveList":[],"sku":"","source":"17","d":"","direction":"","isNeedVideo":1}
|
||||
let sign = await getSign(functionId, body)
|
||||
return new Promise(resolve => {
|
||||
$.post(taskPostUrl(functionId, body, url), async (err, resp, data) => {
|
||||
$.post(taskPostUrl(functionId, sign), async (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(`${JSON.stringify(err)}`)
|
||||
@@ -160,12 +158,10 @@ async function getauthorId(liveId) {
|
||||
|
||||
async function superTask(liveId, authorId) {
|
||||
let functionId = `liveChannelReportDataV912`
|
||||
let body = escape(JSON.stringify({"liveId":liveId,"type":"viewTask","authorId":authorId,"extra":{"time":60}}))
|
||||
let uuid = randomString(16)
|
||||
let sign = await getSign(functionId, decodeURIComponent(body), uuid)
|
||||
let url = `https://api.m.jd.com/client.action?functionId=${functionId}&build=167774&client=apple&clientVersion=10.1.0&uuid=${uuid}&${sign}`
|
||||
let body = {"liveId":liveId,"type":"viewTask","authorId":authorId,"extra":{"time":60}}
|
||||
let sign = await getSign(functionId, body)
|
||||
return new Promise(resolve => {
|
||||
$.post(taskPostUrl(functionId, body, url), async (err, resp, data) => {
|
||||
$.post(taskPostUrl(functionId, sign), async (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(`${JSON.stringify(err)}`)
|
||||
@@ -282,14 +278,13 @@ function sign() {
|
||||
})
|
||||
}
|
||||
|
||||
function getSign(functionid, body, uuid) {
|
||||
function getSign(functionId, body) {
|
||||
return new Promise(async resolve => {
|
||||
let data = {
|
||||
"functionId":functionid,
|
||||
"body":body,
|
||||
"uuid":uuid,
|
||||
"client":"apple",
|
||||
"clientVersion":"10.1.0"
|
||||
functionId,
|
||||
body: JSON.stringify(body),
|
||||
client: "apple",
|
||||
clientVersion: "10.3.0"
|
||||
}
|
||||
let HostArr = ['jdsign.cf', 'signer.nz.lu']
|
||||
let Host = HostArr[Math.floor((Math.random() * HostArr.length))]
|
||||
@@ -319,12 +314,10 @@ function getSign(functionid, body, uuid) {
|
||||
})
|
||||
}
|
||||
|
||||
function taskPostUrl(function_id, body = {}, url=null) {
|
||||
if (url && (function_id === "liveChannelReportDataV912" || function_id === "liveDetailV910")) body = `body=${body}`
|
||||
if(!url) url = `https://api.m.jd.com/client.action?functionId=${function_id}`
|
||||
function taskPostUrl(function_id, body = "") {
|
||||
return {
|
||||
url: url,
|
||||
body: body,
|
||||
url: `https://api.m.jd.com/client.action?functionId=${function_id}`,
|
||||
body,
|
||||
headers: {
|
||||
"Host": "api.m.jd.com",
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
@@ -332,8 +325,7 @@ function taskPostUrl(function_id, body = {}, url=null) {
|
||||
"Referer": "",
|
||||
"Cookie": cookie,
|
||||
"Origin": "https://h5.m.jd.com",
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
"Content-Length": "996",
|
||||
"Content-Type": 'application/x-www-form-urlencoded',
|
||||
"User-Agent": "JD4iPhone/167774 (iPhone; iOS 14.7.1; Scale/3.00)",
|
||||
"Accept-Language": "zh-Hans-CN;q=1",
|
||||
"Accept-Encoding": "gzip, deflate, br"
|
||||
@@ -342,7 +334,7 @@ function taskPostUrl(function_id, body = {}, url=null) {
|
||||
}
|
||||
function taskUrl(function_id, body = {}) {
|
||||
return {
|
||||
url: `${JD_API_HOST}?functionId=${function_id}&appid=h5-live&body=${escape(JSON.stringify(body))}&v=${new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000}&uuid=${uuid}`,
|
||||
url: `${JD_API_HOST}?functionId=${function_id}&appid=h5-live&body=${encodeURIComponent(JSON.stringify(body))}&v=${new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000}&uuid=${uuid}`,
|
||||
headers: {
|
||||
"Host": "api.m.jd.com",
|
||||
"Accept": "application/json, text/plain, */*",
|
||||
|
||||
Reference in New Issue
Block a user