Skip to content

Commit

Permalink
optimize: risk control
Browse files Browse the repository at this point in the history
  • Loading branch information
snowtafir committed Sep 20, 2024
1 parent 9d5d9de commit 3230366
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yz-yuki-plugin",
"version": "2.0.4-4",
"version": "2.0.4-5",
"description": "优纪插件,yunzaijs 关于 微博推送、B站推送 等功能的拓展插件",
"author": "snowtafir",
"type": "module",
Expand Down
7 changes: 4 additions & 3 deletions src/models/bilibili/bilibili.query.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import moment from "moment";
import { Bot, Segment } from "yunzai";
import { readSyncCookie } from "@/models/bilibili/bilibili.models";
import { cookieWithBiliTicket, readSyncCookie } from "@/models/bilibili/bilibili.models";
import { BiliApi } from "@/models/bilibili/bilibili.api";
import axios from "axios";
import lodash from "lodash";
Expand Down Expand Up @@ -234,10 +234,11 @@ export class BiliQuery {
* @returns {Json} 完整的B站文章内容json数据
*/
static async getFullArticleContent(postUrl: string) {
const Cookie = await readSyncCookie();
let { cookie } = await readSyncCookie();
cookie = await cookieWithBiliTicket(cookie);
try {
const response = await axios.get(postUrl, {
headers: lodash.merge(BiliApi.BILIBILI_ARTICLE_HEADERS, { "Cookie": `${Cookie}`, "Host": "www.bilibili.com" }),
headers: lodash.merge(BiliApi.BILIBILI_ARTICLE_HEADERS, { "Cookie": `${cookie}`, "Host": "www.bilibili.com" }),
responseType: 'text'
});
const text = response.data;
Expand Down

0 comments on commit 3230366

Please sign in to comment.