🐞 fix: 修复tiktok链接

This commit is contained in:
zhiyu1998 2023-02-11 20:05:37 +08:00
parent 50887e767e
commit 5647c554c5
2 changed files with 9 additions and 3 deletions

View File

@ -168,7 +168,7 @@ export class query extends plugin {
let url = 'https://api.vvhan.com/api/hotlist?type='
switch (keyword) {
case '虎扑':
url += 'hupu'
url += 'huPu'
break
case '知乎':
url += 'zhihuHot'
@ -211,7 +211,13 @@ export class query extends plugin {
nickname: this.e.sender.card || this.e.user_id, user_id: this.e.user_id
}
let msg = []
await fetch(url)
await fetch(url, {
headers: {
"User-Agent":
"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Mobile Safari/537.36",
"Content-Type": "application/json",
}
})
.then((resp) => resp.json())
.then((resp) => {
for (let element of resp.data) {

View File

@ -139,7 +139,7 @@ export class tools extends plugin {
}
const idVideo = await this.getIdVideo(url)
// API链接
const API_URL = `https://api19-core-useast5.us.tiktokv.com/aweme/v1/feed/?aweme_id=${ idVideo }&version_code=262&app_name=musical_ly&channel=App&device_id=null&os_version=14.4.2&device_platform=iphone&device_type=iPhone9`;
const API_URL = `https://api16-normal-c-useast1a.tiktokv.com/aweme/v1/feed/?aweme_id=${ idVideo }&version_code=262&app_name=musical_ly&channel=App&device_id=null&os_version=14.4.2&device_platform=iphone&device_type=iPhone9`;
await axios.get(API_URL, {
headers: {