From 5647c554c5361afc0e8f9e64137da4554292e798 Mon Sep 17 00:00:00 2001 From: zhiyu1998 Date: Sat, 11 Feb 2023 20:05:37 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20=E4=BF=AE=E5=A4=8Dtiktok?= =?UTF-8?q?=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/query.js | 10 ++++++++-- apps/tools.js | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/query.js b/apps/query.js index 4049d40..29f4c82 100644 --- a/apps/query.js +++ b/apps/query.js @@ -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) { diff --git a/apps/tools.js b/apps/tools.js index d2da078..3492d8f 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -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: {