rsshub 1.0.0-master.f72af1b → 1.0.0-master.f7347d9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/config.ts +18 -0
- package/lib/middleware/template.tsx +10 -2
- package/lib/routes/163/music/playlist.ts +2 -1
- package/lib/routes/5eplay/index.ts +1 -51
- package/lib/routes/a9vg/index.ts +214 -0
- package/lib/routes/a9vg/namespace.ts +1 -0
- package/lib/routes/a9vg/templates/description.art +17 -0
- package/lib/routes/aibase/discover.ts +388 -0
- package/lib/routes/aibase/namespace.ts +8 -0
- package/lib/routes/aibase/news.ts +118 -0
- package/lib/routes/aibase/templates/description.art +100 -0
- package/lib/routes/aibase/topic.ts +614 -0
- package/lib/routes/aibase/util.ts +114 -0
- package/lib/routes/apnews/api.ts +18 -3
- package/lib/routes/apnews/rss.ts +1 -1
- package/lib/routes/apnews/topics.ts +4 -3
- package/lib/routes/apple/podcast.ts +19 -15
- package/lib/routes/bangumi/templates/tv/subject.art +6 -0
- package/lib/routes/bangumi/tv/other/followrank.ts +19 -22
- package/lib/routes/bangumi/tv/user/collections.ts +172 -0
- package/lib/routes/bilibili/cache.ts +16 -8
- package/lib/routes/bilibili/utils.ts +85 -3
- package/lib/routes/bilibili/video.ts +7 -9
- package/lib/routes/bilibili/vsearch.ts +1 -1
- package/lib/routes/bjnews/cat.ts +9 -1
- package/lib/routes/cbpanet/index.ts +380 -0
- package/lib/routes/cbpanet/namespace.ts +8 -0
- package/lib/routes/ceph/blog.ts +72 -0
- package/lib/routes/ceph/namespace.ts +7 -0
- package/lib/routes/chinanews/index.ts +1 -1
- package/lib/routes/chinaventure/index.ts +1 -1
- package/lib/routes/cisia/index.ts +264 -0
- package/lib/routes/cisia/namespace.ts +8 -0
- package/lib/routes/cjlu/namespace.ts +10 -0
- package/lib/routes/cjlu/yjsy/index.ts +107 -0
- package/lib/routes/cnki/journals.ts +31 -2
- package/lib/routes/cohere/index.ts +54 -0
- package/lib/routes/cohere/namespace.ts +6 -0
- package/lib/routes/coolapk/dyh.ts +7 -1
- package/lib/routes/coolapk/hot.ts +7 -1
- package/lib/routes/coolapk/huati.ts +7 -1
- package/lib/routes/coolapk/namespace.ts +6 -0
- package/lib/routes/coolapk/toutiao.ts +7 -1
- package/lib/routes/coolapk/tuwen.ts +10 -5
- package/lib/routes/coolapk/user-dynamic.ts +7 -1
- package/lib/routes/damai/activity.ts +3 -2
- package/lib/routes/dcfever/trading.ts +3 -5
- package/lib/routes/dcfever/utils.ts +13 -4
- package/lib/routes/dealstreetasia/home.ts +72 -0
- package/lib/routes/dealstreetasia/namespace.ts +6 -0
- package/lib/routes/dealstreetasia/section.ts +57 -0
- package/lib/routes/dlsite/campaign.ts +1 -2
- package/lib/routes/dlsite/new.ts +1 -2
- package/lib/routes/dlsite/{index.ts → z-index/index.ts} +1 -1
- package/lib/routes/douban/other/topic.ts +10 -4
- package/lib/routes/douyin/types.ts +795 -0
- package/lib/routes/douyin/user.ts +51 -23
- package/lib/routes/douyin/utils.ts +1 -87
- package/lib/routes/dribbble/keyword.ts +1 -1
- package/lib/routes/dribbble/popular.ts +1 -1
- package/lib/routes/dribbble/user.ts +1 -1
- package/lib/routes/dribbble/utils.ts +16 -18
- package/lib/routes/famitsu/category.ts +1 -1
- package/lib/routes/fanbox/index.ts +1 -1
- package/lib/routes/fanbox/types.ts +1 -5
- package/lib/routes/fediverse/timeline.ts +21 -3
- package/lib/routes/follow/profile.ts +4 -2
- package/lib/routes/follow/types.ts +11 -1
- package/lib/routes/github/advisor.ts +97 -0
- package/lib/routes/github/discussions.ts +194 -0
- package/lib/routes/github/issue.ts +1 -1
- package/lib/routes/github/pulls.ts +1 -1
- package/lib/routes/gmcmonline/chinacustoms.ts +130 -0
- package/lib/routes/gmcmonline/namespace.ts +8 -0
- package/lib/routes/gov/csrc/csrc.ts +541 -0
- package/lib/routes/gov/customs/list.ts +5 -2
- package/lib/routes/gov/customs/namespace.ts +7 -0
- package/lib/routes/gov/jgjcndrc/index.ts +95 -66
- package/lib/routes/gov/moa/moa.ts +3 -3
- package/lib/routes/gov/moa/szcpxx.ts +115 -0
- package/lib/routes/gov/moa/zdscxx.ts +71 -21
- package/lib/routes/gov/ndrc/zfxxgk.ts +106 -0
- package/lib/routes/gov/pudong/zwgk.ts +65 -0
- package/lib/routes/gov/zj/search.ts +17 -12
- package/lib/routes/guancha/member.ts +1 -1
- package/lib/routes/hellogithub/index.ts +17 -67
- package/lib/routes/hellogithub/report.ts +1 -1
- package/lib/routes/hex-rays/index.ts +23 -29
- package/lib/routes/hfut/hf/notice.ts +43 -0
- package/lib/routes/hfut/hf/utils.ts +80 -0
- package/lib/routes/hfut/namespace.ts +6 -0
- package/lib/routes/hfut/xc/notice.ts +43 -0
- package/lib/routes/hfut/xc/utils.ts +73 -0
- package/lib/routes/hko/earthquake.ts +56 -0
- package/lib/routes/hko/namespace.ts +8 -0
- package/lib/routes/hko/weather.ts +56 -0
- package/lib/routes/huggingface/blog-zh.ts +1 -1
- package/lib/routes/hust/mse.ts +575 -0
- package/lib/routes/i-cable/namespace.ts +6 -0
- package/lib/routes/i-cable/news.ts +77 -0
- package/lib/routes/i-cable/templates/description.art +8 -0
- package/lib/routes/infoq/presentations.ts +203 -0
- package/lib/routes/infoq/templates/description.art +41 -0
- package/lib/routes/ipsw.dev/index.ts +64 -0
- package/lib/routes/ipsw.dev/namespace.ts +7 -0
- package/lib/routes/ipsw.dev/templates/description.art +20 -0
- package/lib/routes/ixigua/user-video.ts +18 -7
- package/lib/routes/javtiful/actress.ts +37 -0
- package/lib/routes/javtiful/channel.ts +37 -0
- package/lib/routes/javtiful/namespace.ts +6 -0
- package/lib/routes/javtiful/templates/description.art +7 -0
- package/lib/routes/javtiful/utils.ts +18 -0
- package/lib/routes/kisskiss/blog.ts +74 -0
- package/lib/routes/kisskiss/namespace.ts +6 -0
- package/lib/routes/ktown4u/artist-brandlist.ts +61 -0
- package/lib/routes/ktown4u/namespace.ts +6 -0
- package/lib/routes/lorientlejour/index.ts +186 -0
- package/lib/routes/lorientlejour/namespace.ts +7 -0
- package/lib/routes/lorientlejour/templates/description.art +18 -0
- package/lib/routes/lovelive-anime/namespace.ts +1 -1
- package/lib/routes/lovelive-anime/news.ts +56 -26
- package/lib/routes/lovelive-anime/schedules.ts +18 -6
- package/lib/routes/lovelive-anime/templates/description.art +1 -1
- package/lib/routes/lovelive-anime/templates/scheduleDesc.art +0 -1
- package/lib/routes/lovelive-anime/topics.ts +1 -1
- package/lib/routes/manhuagui/comic.ts +1 -1
- package/lib/routes/mi/crowdfunding.ts +43 -22
- package/lib/routes/mi/templates/crowdfunding.art +28 -0
- package/lib/routes/mi/types.ts +40 -0
- package/lib/routes/mi/utils.ts +80 -0
- package/lib/routes/misskey/utils.ts +1 -0
- package/lib/routes/misskon/namespace.ts +6 -0
- package/lib/routes/misskon/posts.ts +33 -0
- package/lib/routes/misskon/tag.ts +38 -0
- package/lib/routes/misskon/top.ts +67 -0
- package/lib/routes/misskon/utils.ts +41 -0
- package/lib/routes/natgeo/dailyphoto.ts +1 -1
- package/lib/routes/natgeo/dailyselection.ts +1 -1
- package/lib/routes/ncku/namespace.ts +1 -1
- package/lib/routes/ncku/phys.ts +95 -0
- package/lib/routes/news/namespace.ts +1 -1
- package/lib/routes/nikkei/cn/index.ts +12 -1
- package/lib/routes/nudt/yjszs.ts +33 -13
- package/lib/routes/nytimes/book.ts +11 -11
- package/lib/routes/nytimes/daily-briefing-chinese.ts +4 -4
- package/lib/routes/nytimes/namespace.ts +1 -1
- package/lib/routes/oncc/templates/article.art +1 -1
- package/lib/routes/papers/index.ts +7 -1
- package/lib/routes/parliament.uk/commonslibrary.ts +55 -0
- package/lib/routes/parliament.uk/lordslibrary.ts +55 -0
- package/lib/routes/parliament.uk/namespace.ts +6 -0
- package/lib/routes/picuki/profile.ts +50 -39
- package/lib/routes/pornhub/model.ts +3 -5
- package/lib/routes/pornhub/pornstar.ts +3 -5
- package/lib/routes/pornhub/users.ts +3 -5
- package/lib/routes/resonac/namespace.ts +6 -0
- package/lib/routes/resonac/products.ts +85 -0
- package/lib/routes/rsshub/transform/html.ts +114 -75
- package/lib/routes/rsshub/transform/json.ts +14 -8
- package/lib/routes/sciencenet/user.ts +3 -1
- package/lib/routes/scmp/utils.ts +2 -2
- package/lib/routes/skeb/following-creators.ts +52 -0
- package/lib/routes/skeb/following-works.ts +52 -0
- package/lib/routes/skeb/friend-works.ts +52 -0
- package/lib/routes/skeb/index.ts +131 -0
- package/lib/routes/skeb/namespace.ts +6 -0
- package/lib/routes/skeb/search.ts +77 -0
- package/lib/routes/skeb/templates/creator.art +8 -0
- package/lib/routes/skeb/templates/work.art +10 -0
- package/lib/routes/skeb/utils.ts +155 -0
- package/lib/routes/skeb/works.ts +88 -0
- package/lib/routes/skebetter/illust.ts +83 -0
- package/lib/routes/skebetter/index.ts +83 -0
- package/lib/routes/skebetter/manga.ts +65 -0
- package/lib/routes/skebetter/namespace.ts +6 -0
- package/lib/routes/skebetter/utils.ts +72 -0
- package/lib/routes/spankbang/namespace.ts +6 -0
- package/lib/routes/spankbang/new-videos.ts +90 -0
- package/lib/routes/spankbang/templates/video.art +7 -0
- package/lib/routes/straitstimes/index.ts +135 -0
- package/lib/routes/straitstimes/namespace.ts +7 -0
- package/lib/routes/straitstimes/templates/description.art +27 -0
- package/lib/routes/szftedu/dongtai.ts +62 -0
- package/lib/routes/szftedu/gonggao.ts +62 -0
- package/lib/routes/szftedu/namespace.ts +6 -0
- package/lib/routes/the/index.ts +1 -1
- package/lib/routes/tkww/index.ts +83 -0
- package/lib/routes/tkww/namespace.ts +6 -0
- package/lib/routes/ttv/index.ts +1 -1
- package/lib/routes/tvb/news.ts +2 -1
- package/lib/routes/twitter/api/mobile-api/login.ts +5 -0
- package/lib/routes/twitter/api/web-api/api.ts +16 -10
- package/lib/routes/twitter/api/web-api/constants.ts +1 -1
- package/lib/routes/twitter/api/web-api/utils.ts +94 -56
- package/lib/routes/twitter/list.ts +4 -12
- package/lib/routes/twitter/media.ts +13 -4
- package/lib/routes/twitter/user.ts +15 -6
- package/lib/routes/udn/breaking-news.ts +2 -2
- package/lib/routes/uestc/gr.ts +65 -37
- package/lib/routes/uestc/jwc.ts +49 -28
- package/lib/routes/wechat/ershcimi.ts +4 -2
- package/lib/routes/weibo/user.ts +10 -2
- package/lib/routes/xaut/index.ts +13 -20
- package/lib/routes/xaut/namespace.ts +1 -1
- package/lib/routes/xbookcn/blog.ts +66 -0
- package/lib/routes/xbookcn/namespace.ts +6 -0
- package/lib/routes/xiaoyuzhou/podcast.ts +35 -7
- package/lib/routes/xueqiu/cookies.ts +5 -3
- package/lib/routes/xueqiu/stock-info.ts +6 -12
- package/lib/routes/yande/namespace.ts +1 -1
- package/lib/routes/yande/post.ts +6 -6
- package/lib/routes/zaobao/util.ts +41 -43
- package/lib/routes/zhihu/activities.ts +2 -1
- package/lib/routes/zhihu/timeline.ts +6 -1
- package/lib/routes/zhihu/utils.ts +1 -1
- package/lib/routes/zjut/cs/index.ts +105 -0
- package/lib/routes/zjut/jwc/index.ts +117 -0
- package/lib/utils/cache/redis.ts +1 -1
- package/package.json +35 -36
- package/lib/routes/a9vg/a9vg.ts +0 -45
- package/lib/routes/gov/ndrc/zfxxgk/articles.ts +0 -73
- package/lib/routes-deprecated/hko/weather.js +0 -44
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { getCurrentPath } from '@/utils/helpers';
|
|
2
|
+
const __dirname = getCurrentPath(import.meta.url);
|
|
3
|
+
|
|
4
|
+
import ofetch from '@/utils/ofetch';
|
|
5
|
+
import { CheerioAPI } from 'cheerio';
|
|
6
|
+
import timezone from '@/utils/timezone';
|
|
7
|
+
import { parseDate } from '@/utils/parse-date';
|
|
8
|
+
import { art } from '@/utils/render';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
|
|
11
|
+
const defaultSrc = '_static/ee6af7e.js';
|
|
12
|
+
const defaultToken = 'djflkdsoisknfoklsyhownfrlewfknoiaewf';
|
|
13
|
+
|
|
14
|
+
const rootUrl = 'https://top.aibase.com';
|
|
15
|
+
const apiRootUrl = 'https://app.chinaz.com';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Converts a string to an array.
|
|
19
|
+
* If the string starts with '[', it is assumed to be a JSON array and is parsed accordingly.
|
|
20
|
+
* Otherwise, the string is wrapped in an array.
|
|
21
|
+
*
|
|
22
|
+
* @param str - The input string to convert to an array.
|
|
23
|
+
* @returns An array created from the input string.
|
|
24
|
+
*/
|
|
25
|
+
const strToArray = (str: string) => {
|
|
26
|
+
if (str.startsWith('[')) {
|
|
27
|
+
return JSON.parse(str);
|
|
28
|
+
}
|
|
29
|
+
return [str];
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
art.defaults.imports.strToArray = strToArray;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Retrieve a token asynchronously using a CheerioAPI instance.
|
|
36
|
+
* @param $ - The CheerioAPI instance.
|
|
37
|
+
* @returns A Promise that resolves to a string representing the token.
|
|
38
|
+
*/
|
|
39
|
+
const getToken = async ($: CheerioAPI): Promise<string> => {
|
|
40
|
+
const scriptUrl = new URL($('script[src]').last()?.prop('src') ?? defaultSrc, rootUrl).href;
|
|
41
|
+
|
|
42
|
+
const script = await ofetch(scriptUrl, {
|
|
43
|
+
responseType: 'text',
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
return script.match(/"\/(\w+)\/ai\/.*?\.aspx"/)?.[1] ?? defaultToken;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Build API URLs asynchronously using a CheerioAPI instance.
|
|
51
|
+
* @param $ - The CheerioAPI instance.
|
|
52
|
+
* @returns An object containing API URLs.
|
|
53
|
+
*/
|
|
54
|
+
const buildApiUrl = async ($: CheerioAPI) => {
|
|
55
|
+
const token = await getToken($);
|
|
56
|
+
|
|
57
|
+
const apiRecommListUrl = new URL(`${token}/ai/GetAIProcRecommList.aspx`, apiRootUrl).href;
|
|
58
|
+
const apiRecommProcUrl = new URL(`${token}/ai/GetAIProcListByRecomm.aspx`, apiRootUrl).href;
|
|
59
|
+
const apiTagProcUrl = new URL(`${token}/ai/GetAiProductOfTag.aspx`, apiRootUrl).href;
|
|
60
|
+
// AI 资讯列表
|
|
61
|
+
const apiInfoListUrl = new URL(`${token}/ai/GetAiInfoList.aspx`, apiRootUrl).href;
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
apiRecommListUrl,
|
|
65
|
+
apiRecommProcUrl,
|
|
66
|
+
apiTagProcUrl,
|
|
67
|
+
apiInfoListUrl,
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Process an array of items to generate a new array of processed items for RSS.
|
|
73
|
+
* @param items - An array of items to process.
|
|
74
|
+
* @returns An array of processed items.
|
|
75
|
+
*/
|
|
76
|
+
const processItems = (items: any[]): any[] =>
|
|
77
|
+
items.map((item) => {
|
|
78
|
+
const title = item.name;
|
|
79
|
+
const image = item.imgurl;
|
|
80
|
+
const description = art(path.join(__dirname, 'templates/description.art'), {
|
|
81
|
+
images: image
|
|
82
|
+
? [
|
|
83
|
+
{
|
|
84
|
+
src: image,
|
|
85
|
+
alt: title,
|
|
86
|
+
},
|
|
87
|
+
]
|
|
88
|
+
: undefined,
|
|
89
|
+
item,
|
|
90
|
+
});
|
|
91
|
+
const guid = `aibase-${item.zurl}`;
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
title,
|
|
95
|
+
description,
|
|
96
|
+
pubDate: timezone(parseDate(item.addtime), +8),
|
|
97
|
+
link: new URL(`tool/${item.zurl}`, rootUrl).href,
|
|
98
|
+
category: [...new Set([...strToArray(item.categories), ...strToArray(item.tags), item.catname, item.procattrname, item.procformname, item.proctypename])].filter(Boolean),
|
|
99
|
+
guid,
|
|
100
|
+
id: guid,
|
|
101
|
+
content: {
|
|
102
|
+
html: description,
|
|
103
|
+
text: item.desc,
|
|
104
|
+
},
|
|
105
|
+
image,
|
|
106
|
+
banner: image,
|
|
107
|
+
updated: parseDate(item.UpdTime),
|
|
108
|
+
enclosure_url: item.logo,
|
|
109
|
+
enclosure_type: item.logo ? `image/${item.logo.split(/\./).pop()}` : undefined,
|
|
110
|
+
enclosure_title: title,
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export { rootUrl, processItems, buildApiUrl };
|
package/lib/routes/apnews/api.ts
CHANGED
|
@@ -6,12 +6,27 @@ import { parseDate } from '@/utils/parse-date';
|
|
|
6
6
|
|
|
7
7
|
export const route: Route = {
|
|
8
8
|
path: '/api/:tags?',
|
|
9
|
-
categories: ['traditional-media'],
|
|
10
|
-
example: '/apnews/api/
|
|
9
|
+
categories: ['traditional-media', 'popular'],
|
|
10
|
+
example: '/apnews/api/apf-topnews',
|
|
11
11
|
view: ViewType.Articles,
|
|
12
12
|
parameters: {
|
|
13
13
|
tags: {
|
|
14
|
-
description: 'Getting a list of articles from a public API based on tags.
|
|
14
|
+
description: 'Getting a list of articles from a public API based on tags.',
|
|
15
|
+
options: [
|
|
16
|
+
{ value: 'apf-topnews', label: 'Top News' },
|
|
17
|
+
{ value: 'apf-sports', label: 'Sports' },
|
|
18
|
+
{ value: 'apf-politics', label: 'Politics' },
|
|
19
|
+
{ value: 'apf-entertainment', label: 'Entertainment' },
|
|
20
|
+
{ value: 'apf-usnews', label: 'US News' },
|
|
21
|
+
{ value: 'apf-oddities', label: 'Oddities' },
|
|
22
|
+
{ value: 'apf-Travel', label: 'Travel' },
|
|
23
|
+
{ value: 'apf-technology', label: 'Technology' },
|
|
24
|
+
{ value: 'apf-lifestyle', label: 'Lifestyle' },
|
|
25
|
+
{ value: 'apf-business', label: 'Business' },
|
|
26
|
+
{ value: 'apf-Health', label: 'Health' },
|
|
27
|
+
{ value: 'apf-science', label: 'Science' },
|
|
28
|
+
{ value: 'apf-intlnews', label: 'International News' },
|
|
29
|
+
],
|
|
15
30
|
default: 'apf-topnews',
|
|
16
31
|
},
|
|
17
32
|
},
|
package/lib/routes/apnews/rss.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { fetchArticle, removeDuplicateByKey } from './utils';
|
|
|
5
5
|
const HOME_PAGE = 'https://apnews.com';
|
|
6
6
|
|
|
7
7
|
export const route: Route = {
|
|
8
|
-
path: '/topics/:topic?',
|
|
8
|
+
path: ['/topics/:topic?', '/nav/:nav{.*}?'],
|
|
9
9
|
categories: ['traditional-media', 'popular'],
|
|
10
10
|
example: '/apnews/topics/apf-topnews',
|
|
11
11
|
view: ViewType.Articles,
|
|
@@ -35,8 +35,9 @@ export const route: Route = {
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
async function handler(ctx) {
|
|
38
|
-
const { topic = 'trending-news' } = ctx.req.param();
|
|
39
|
-
const
|
|
38
|
+
const { topic = 'trending-news', nav = '' } = ctx.req.param();
|
|
39
|
+
const useNav = ctx.req.routePath === '/apnews/nav/:nav{.*}?';
|
|
40
|
+
const url = useNav ? `${HOME_PAGE}/${nav}` : `${HOME_PAGE}/hub/${topic}`;
|
|
40
41
|
const response = await got(url);
|
|
41
42
|
const $ = load(response.data);
|
|
42
43
|
|
|
@@ -36,29 +36,33 @@ async function handler(ctx) {
|
|
|
36
36
|
|
|
37
37
|
const $ = load(response.data);
|
|
38
38
|
|
|
39
|
-
const
|
|
39
|
+
const serializedServerData = JSON.parse($('#serialized-server-data').text());
|
|
40
40
|
|
|
41
|
-
const
|
|
42
|
-
const
|
|
41
|
+
const seoEpisodes = serializedServerData[0].data.seoData.schemaContent.workExample;
|
|
42
|
+
const originEpisodes = serializedServerData[0].data.shelves.find((item) => item.contentType === 'episode').items;
|
|
43
|
+
const header = serializedServerData[0].data.shelves.find((item) => item.contentType === 'showHeaderRegular').items[0];
|
|
44
|
+
|
|
45
|
+
const episodes = originEpisodes.map((item) => {
|
|
46
|
+
// Try to keep line breaks in the description
|
|
47
|
+
const matchedSeoEpisode = seoEpisodes.find((seoEpisode) => seoEpisode.name === item.title) || null;
|
|
48
|
+
const episodeDescription = (matchedSeoEpisode ? matchedSeoEpisode.description : item.summary).replaceAll('\n', '<br>');
|
|
43
49
|
|
|
44
|
-
const episodes = data.relationships.episodes.data.map((item) => {
|
|
45
|
-
const attr = item.attributes;
|
|
46
50
|
return {
|
|
47
|
-
title:
|
|
48
|
-
enclosure_url:
|
|
49
|
-
itunes_duration: attr.durationInMilliseconds / 1000,
|
|
51
|
+
title: item.title,
|
|
52
|
+
enclosure_url: item.playAction.episodeOffer.streamUrl,
|
|
50
53
|
enclosure_type: 'audio/mp4',
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
itunes_duration: item.duration,
|
|
55
|
+
link: item.playAction.episodeOffer.storeUrl,
|
|
56
|
+
pubDate: parseDate(item.releaseDate),
|
|
57
|
+
description: episodeDescription,
|
|
54
58
|
};
|
|
55
59
|
});
|
|
56
60
|
|
|
57
61
|
return {
|
|
58
|
-
title:
|
|
59
|
-
link:
|
|
60
|
-
itunes_author:
|
|
62
|
+
title: header.title,
|
|
63
|
+
link: header.contextAction.podcastOffer.storeUrl,
|
|
64
|
+
itunes_author: header.contextAction.podcastOffer.author,
|
|
61
65
|
item: episodes,
|
|
62
|
-
description:
|
|
66
|
+
description: header.description.replaceAll('\n', ' '),
|
|
63
67
|
};
|
|
64
68
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{{ if routeSubjectType === 'all' }}类型:{{ subjectTypeName }} <br>{{ /if }}
|
|
2
|
+
{{ if subjectType === 2 }}看到:{{ epStatus }} / {{ subjectEps ? subjectEps: '???' }}<br>{{ /if }}
|
|
3
|
+
{{ if subjectType === 1 }}读到:{{ epStatus }} / {{ subjectEps ? subjectEps: '???' }}<br>{{ /if }}
|
|
4
|
+
评分:{{ score }}<br>
|
|
5
|
+
放送时间:{{ date ? date : '未知' }}<br>
|
|
6
|
+
<img src="{{ picUrl }}">
|
|
@@ -7,7 +7,7 @@ export const route: Route = {
|
|
|
7
7
|
path: '/:type/followrank',
|
|
8
8
|
categories: ['anime'],
|
|
9
9
|
example: '/bangumi/anime/followrank',
|
|
10
|
-
parameters: { type: '类型:anime -
|
|
10
|
+
parameters: { type: '类型:anime - 动画,book - 图书,music - 音乐,game - 游戏,real - 三次元' },
|
|
11
11
|
features: {
|
|
12
12
|
requireConfig: false,
|
|
13
13
|
requirePuppeteer: false,
|
|
@@ -23,7 +23,7 @@ export const route: Route = {
|
|
|
23
23
|
},
|
|
24
24
|
],
|
|
25
25
|
name: '成员关注榜',
|
|
26
|
-
maintainers: ['honue', 'zhoukuncheng'],
|
|
26
|
+
maintainers: ['honue', 'zhoukuncheng', 'NekoAria'],
|
|
27
27
|
handler,
|
|
28
28
|
};
|
|
29
29
|
|
|
@@ -42,25 +42,22 @@ async function handler(ctx) {
|
|
|
42
42
|
|
|
43
43
|
const $ = load(response);
|
|
44
44
|
|
|
45
|
-
const items =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
link: 'https://bgm.tv' + $(item).children('a').attr('href'),
|
|
62
|
-
})),
|
|
63
|
-
];
|
|
45
|
+
const items = $('.featuredItems .mainItem')
|
|
46
|
+
.map((_, item) => {
|
|
47
|
+
const $item = $(item);
|
|
48
|
+
const link = 'https://bgm.tv' + $item.find('a').first().attr('href');
|
|
49
|
+
const imageUrl = $item
|
|
50
|
+
.find('.image')
|
|
51
|
+
.attr('style')
|
|
52
|
+
?.match(/url\((.*?)\)/)?.[1];
|
|
53
|
+
const info = $item.find('small.grey').text();
|
|
54
|
+
return {
|
|
55
|
+
title: $item.find('.title').text().trim(),
|
|
56
|
+
link,
|
|
57
|
+
description: `<img src="${imageUrl}"><br>${info}`,
|
|
58
|
+
};
|
|
59
|
+
})
|
|
60
|
+
.toArray();
|
|
64
61
|
|
|
65
62
|
const RANK_TYPES = {
|
|
66
63
|
tv: '动画',
|
|
@@ -75,6 +72,6 @@ async function handler(ctx) {
|
|
|
75
72
|
title: `BangumiTV 成员关注${RANK_TYPES[type]}榜`,
|
|
76
73
|
link: url,
|
|
77
74
|
item: items,
|
|
78
|
-
description: `BangumiTV
|
|
75
|
+
description: `BangumiTV 首页 - 成员关注${RANK_TYPES[type]}榜`,
|
|
79
76
|
};
|
|
80
77
|
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { Route } from '@/types';
|
|
2
|
+
import got from '@/utils/got';
|
|
3
|
+
import timezone from '@/utils/timezone';
|
|
4
|
+
import { parseDate } from '@/utils/parse-date';
|
|
5
|
+
import { config } from '@/config';
|
|
6
|
+
import { art } from '@/utils/render';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
|
|
9
|
+
import { getCurrentPath } from '@/utils/helpers';
|
|
10
|
+
const __dirname = getCurrentPath(import.meta.url);
|
|
11
|
+
|
|
12
|
+
// 合并不同 subjectType 的 type 映射
|
|
13
|
+
const getTypeNames = (subjectType) => {
|
|
14
|
+
const commonTypeNames = {
|
|
15
|
+
1: '想看',
|
|
16
|
+
2: '看过',
|
|
17
|
+
3: '在看',
|
|
18
|
+
4: '搁置',
|
|
19
|
+
5: '抛弃',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
switch (subjectType) {
|
|
23
|
+
case '1': // 书籍
|
|
24
|
+
return {
|
|
25
|
+
1: '想读',
|
|
26
|
+
2: '读过',
|
|
27
|
+
3: '在读',
|
|
28
|
+
4: '搁置',
|
|
29
|
+
5: '抛弃',
|
|
30
|
+
};
|
|
31
|
+
case '2': // 动画
|
|
32
|
+
case '6': // 三次元
|
|
33
|
+
return commonTypeNames;
|
|
34
|
+
case '3': // 音乐
|
|
35
|
+
return {
|
|
36
|
+
1: '想听',
|
|
37
|
+
2: '听过',
|
|
38
|
+
3: '在听',
|
|
39
|
+
4: '搁置',
|
|
40
|
+
5: '抛弃',
|
|
41
|
+
};
|
|
42
|
+
case '4': // 游戏
|
|
43
|
+
return {
|
|
44
|
+
1: '想玩',
|
|
45
|
+
2: '玩过',
|
|
46
|
+
3: '在玩',
|
|
47
|
+
4: '搁置',
|
|
48
|
+
5: '抛弃',
|
|
49
|
+
};
|
|
50
|
+
default:
|
|
51
|
+
return commonTypeNames; // 默认使用通用的类型
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const route: Route = {
|
|
56
|
+
path: '/tv/user/collections/:id/:subjectType/:type',
|
|
57
|
+
categories: ['anime'],
|
|
58
|
+
example: '/bangumi/tv/user/collections/sai/1/1',
|
|
59
|
+
parameters: {
|
|
60
|
+
id: '用户 id, 在用户页面地址栏查看',
|
|
61
|
+
subjectType: {
|
|
62
|
+
description: '全部类别: `空`、book: `1`、anime: `2`、music: `3`、game: `4`、real: `6`',
|
|
63
|
+
options: [
|
|
64
|
+
{ value: 'ALL', label: 'all' },
|
|
65
|
+
{ value: 'book', label: '1' },
|
|
66
|
+
{ value: 'anime', label: '2' },
|
|
67
|
+
{ value: 'music', label: '3' },
|
|
68
|
+
{ value: 'game', label: '4' },
|
|
69
|
+
{ value: 'real', label: '6' },
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
type: {
|
|
73
|
+
description: '全部类别: `空`、想看: `1`、看过: `2`、在看: `3`、搁置: `4`、抛弃: `5`',
|
|
74
|
+
options: [
|
|
75
|
+
{ value: 'ALL', label: 'all' },
|
|
76
|
+
{ value: '想看', label: '1' },
|
|
77
|
+
{ value: '看过', label: '2' },
|
|
78
|
+
{ value: '在看', label: '3' },
|
|
79
|
+
{ value: '搁置', label: '4' },
|
|
80
|
+
{ value: '抛弃', label: '5' },
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
features: {
|
|
85
|
+
requireConfig: false,
|
|
86
|
+
requirePuppeteer: false,
|
|
87
|
+
antiCrawler: false,
|
|
88
|
+
supportBT: false,
|
|
89
|
+
supportPodcast: false,
|
|
90
|
+
supportScihub: false,
|
|
91
|
+
},
|
|
92
|
+
radar: [],
|
|
93
|
+
name: 'Bangumi 用户收藏列表',
|
|
94
|
+
maintainers: ['youyou-sudo'],
|
|
95
|
+
handler,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
async function handler(ctx) {
|
|
99
|
+
const userId = ctx.req.param('id');
|
|
100
|
+
const subjectType = ctx.req.param('subjectType') || '';
|
|
101
|
+
const type = ctx.req.param('type') || '';
|
|
102
|
+
|
|
103
|
+
const subjectTypeNames = {
|
|
104
|
+
1: '书籍',
|
|
105
|
+
2: '动画',
|
|
106
|
+
3: '音乐',
|
|
107
|
+
4: '游戏',
|
|
108
|
+
6: '三次元',
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const typeNames = getTypeNames(subjectType);
|
|
112
|
+
const typeName = typeNames[type] || '';
|
|
113
|
+
const subjectTypeName = subjectTypeNames[subjectType] || '';
|
|
114
|
+
|
|
115
|
+
let descriptionFields = '';
|
|
116
|
+
|
|
117
|
+
if (typeName && subjectTypeName) {
|
|
118
|
+
descriptionFields = `${typeName}的${subjectTypeName}列表`;
|
|
119
|
+
} else if (typeName) {
|
|
120
|
+
descriptionFields = `${typeName}的列表`;
|
|
121
|
+
} else if (subjectTypeName) {
|
|
122
|
+
descriptionFields = `收藏的${subjectTypeName}列表`;
|
|
123
|
+
} else {
|
|
124
|
+
descriptionFields = '的Bangumi收藏列表';
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const userDataUrl = `https://api.bgm.tv/v0/users/${userId}`;
|
|
128
|
+
const userData = await got(userDataUrl, {
|
|
129
|
+
method: 'get',
|
|
130
|
+
headers: {
|
|
131
|
+
'User-Agent': config.trueUA,
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
const collectionDataUrl = `https://api.bgm.tv/v0/users/${userId}/collections?${subjectType && subjectType !== 'all' ? `subject_type=${subjectType}` : ''}${type && type !== 'all' ? `&type=${type}` : ''}`;
|
|
136
|
+
const collectionData = await got(collectionDataUrl, {
|
|
137
|
+
method: 'get',
|
|
138
|
+
headers: {
|
|
139
|
+
'User-Agent': config.trueUA,
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
const userNickname = userData.data.nickname;
|
|
144
|
+
const items = collectionData.data.data.map((item) => {
|
|
145
|
+
const titles = item.subject.name_cn || item.subject.name;
|
|
146
|
+
const updateTime = item.updated_at;
|
|
147
|
+
const subjectId = item.subject_id;
|
|
148
|
+
|
|
149
|
+
return {
|
|
150
|
+
title: `${type === 'all' ? `${getTypeNames(item.subject_type)[item.type]}:` : ''}${titles}`,
|
|
151
|
+
description: art(path.join(__dirname, '../../templates/tv/subject.art'), {
|
|
152
|
+
routeSubjectType: subjectType,
|
|
153
|
+
subjectTypeName: subjectTypeNames[item.subject_type],
|
|
154
|
+
subjectType: item.subject_type,
|
|
155
|
+
subjectEps: item.subject.eps,
|
|
156
|
+
epStatus: item.ep_status,
|
|
157
|
+
score: item.subject.score,
|
|
158
|
+
date: item.subject.date,
|
|
159
|
+
picUrl: item.subject.images.large,
|
|
160
|
+
}),
|
|
161
|
+
link: `https://bgm.tv/subject/${subjectId}`,
|
|
162
|
+
pubDate: timezone(parseDate(updateTime), 0),
|
|
163
|
+
urls: `https://bgm.tv/subject/${subjectId}`,
|
|
164
|
+
};
|
|
165
|
+
});
|
|
166
|
+
return {
|
|
167
|
+
title: `${userNickname}${descriptionFields}`,
|
|
168
|
+
link: `https://bgm.tv/user/${userId}/collections`,
|
|
169
|
+
item: items,
|
|
170
|
+
description: `${userNickname}${descriptionFields}`,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
@@ -8,8 +8,18 @@ import puppeteer from '@/utils/puppeteer';
|
|
|
8
8
|
import { JSDOM } from 'jsdom';
|
|
9
9
|
|
|
10
10
|
let disableConfigCookie = false;
|
|
11
|
+
|
|
11
12
|
const getCookie = () => {
|
|
12
13
|
if (!disableConfigCookie && Object.keys(config.bilibili.cookies).length > 0) {
|
|
14
|
+
// Update b_lsid in cookies
|
|
15
|
+
for (const key of Object.keys(config.bilibili.cookies)) {
|
|
16
|
+
const cookie = config.bilibili.cookies[key];
|
|
17
|
+
if (cookie) {
|
|
18
|
+
const updatedCookie = cookie.replace(/b_lsid=[0-9A-F]+_[0-9A-F]+/, `b_lsid=${utils.lsid()}`);
|
|
19
|
+
config.bilibili.cookies[key] = updatedCookie;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
13
23
|
return config.bilibili.cookies[Object.keys(config.bilibili.cookies)[Math.floor(Math.random() * Object.keys(config.bilibili.cookies).length)]];
|
|
14
24
|
}
|
|
15
25
|
const key = 'bili-cookie';
|
|
@@ -22,7 +32,9 @@ const getCookie = () => {
|
|
|
22
32
|
page.on('requestfinished', async (request) => {
|
|
23
33
|
if (request.url() === 'https://api.bilibili.com/x/internal/gaia-gateway/ExClimbWuzhi') {
|
|
24
34
|
const cookies = await page.cookies();
|
|
25
|
-
|
|
35
|
+
let cookieString = cookies.map((cookie) => `${cookie.name}=${cookie.value}`).join('; ');
|
|
36
|
+
|
|
37
|
+
cookieString = cookieString.replace(/b_lsid=[0-9A-F]+_[0-9A-F]+/, `b_lsid=${utils.lsid()}`);
|
|
26
38
|
resolve(cookieString);
|
|
27
39
|
}
|
|
28
40
|
});
|
|
@@ -129,13 +141,9 @@ const getUsernameAndFaceFromUID = async (uid) => {
|
|
|
129
141
|
if (!name || !face) {
|
|
130
142
|
const cookie = await getCookie();
|
|
131
143
|
const wbiVerifyString = await getWbiVerifyString();
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
// Cookie: cookie,
|
|
136
|
-
// },
|
|
137
|
-
// });
|
|
138
|
-
const params = utils.addWbiVerifyInfo(`mid=${uid}&token=&platform=web&web_location=1550101`, wbiVerifyString);
|
|
144
|
+
const dmImgList = utils.getDmImgList();
|
|
145
|
+
const renderData = await getRenderData(uid);
|
|
146
|
+
const params = utils.addWbiVerifyInfo(utils.addRenderData(utils.addDmVerifyInfo(`mid=${uid}&token=&platform=web&web_location=1550101`, dmImgList), renderData), wbiVerifyString);
|
|
139
147
|
const { data: nameResponse } = await got(`https://api.bilibili.com/x/space/wbi/acc/info?${params}`, {
|
|
140
148
|
headers: {
|
|
141
149
|
Referer: `https://space.bilibili.com/${uid}/`,
|
|
@@ -95,8 +95,8 @@ function getDmImgList() {
|
|
|
95
95
|
const dmImgList = JSON.parse(config.bilibili.dmImgList);
|
|
96
96
|
return JSON.stringify([dmImgList[Math.floor(Math.random() * dmImgList.length)]]);
|
|
97
97
|
}
|
|
98
|
-
const x = Math.max(generateGaussianInteger(
|
|
99
|
-
const y = Math.max(generateGaussianInteger(
|
|
98
|
+
const x = Math.max(generateGaussianInteger(1245, 5), 0);
|
|
99
|
+
const y = Math.max(generateGaussianInteger(1285, 5), 0);
|
|
100
100
|
const path = [
|
|
101
101
|
{
|
|
102
102
|
x: 3 * x + 2 * y,
|
|
@@ -109,12 +109,92 @@ function getDmImgList() {
|
|
|
109
109
|
return JSON.stringify(path);
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
function
|
|
112
|
+
function getDmImgInter() {
|
|
113
|
+
if (config.bilibili.dmImgInter !== undefined) {
|
|
114
|
+
const dmImgInter = JSON.parse(config.bilibili.dmImgInter);
|
|
115
|
+
return JSON.stringify([dmImgInter[Math.floor(Math.random() * dmImgInter.length)]]);
|
|
116
|
+
}
|
|
117
|
+
const p1 = getDmImgInterWh(274, 601);
|
|
118
|
+
const s1 = getDmImgInterOf(134, 30);
|
|
119
|
+
const p2 = getDmImgInterWh(332, 64);
|
|
120
|
+
const s2 = getDmImgInterOf(1101, 338);
|
|
121
|
+
const of = getDmImgInterOf(0, 0);
|
|
122
|
+
const wh = getDmImgInterWh(1245, 1285);
|
|
123
|
+
const ds = [
|
|
124
|
+
{
|
|
125
|
+
t: getDmImgInterT('div'),
|
|
126
|
+
c: getDmImgInterC('clearfix g-search search-container'),
|
|
127
|
+
p: [p1[0], p1[2], p1[1]],
|
|
128
|
+
s: [s1[2], s1[0], s1[1]],
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
t: getDmImgInterT('div'),
|
|
132
|
+
c: getDmImgInterC('wrapper'),
|
|
133
|
+
p: [p2[0], p2[2], p2[1]],
|
|
134
|
+
s: [s2[2], s2[0], s2[1]],
|
|
135
|
+
},
|
|
136
|
+
];
|
|
137
|
+
return JSON.stringify({ ds, wh, of });
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function getDmImgInterT(tag: string) {
|
|
141
|
+
return {
|
|
142
|
+
a: 4,
|
|
143
|
+
article: 29,
|
|
144
|
+
button: 7,
|
|
145
|
+
div: 2,
|
|
146
|
+
em: 27,
|
|
147
|
+
form: 17,
|
|
148
|
+
h1: 11,
|
|
149
|
+
h2: 12,
|
|
150
|
+
h3: 13,
|
|
151
|
+
h4: 14,
|
|
152
|
+
h5: 15,
|
|
153
|
+
h6: 16,
|
|
154
|
+
img: 5,
|
|
155
|
+
input: 6,
|
|
156
|
+
label: 25,
|
|
157
|
+
li: 10,
|
|
158
|
+
ol: 9,
|
|
159
|
+
option: 20,
|
|
160
|
+
p: 3,
|
|
161
|
+
section: 28,
|
|
162
|
+
select: 19,
|
|
163
|
+
span: 1,
|
|
164
|
+
strong: 26,
|
|
165
|
+
table: 21,
|
|
166
|
+
td: 23,
|
|
167
|
+
textarea: 18,
|
|
168
|
+
th: 24,
|
|
169
|
+
tr: 22,
|
|
170
|
+
ul: 8,
|
|
171
|
+
}[tag];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function getDmImgInterC(className: string) {
|
|
175
|
+
return Buffer.from(className).toString('base64').slice(0, -2);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function getDmImgInterOf(top: number, left: number) {
|
|
179
|
+
const seed = Math.floor(514 * Math.random());
|
|
180
|
+
return [3 * top + 2 * left + seed, 4 * top - 4 * left + 2 * seed, seed];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function getDmImgInterWh(width: number, height: number) {
|
|
184
|
+
const seed = Math.floor(114 * Math.random());
|
|
185
|
+
return [2 * width + 2 * height + 3 * seed, 4 * width - height + seed, seed];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function addDmVerifyInfo(params: string, dmImgList: string) {
|
|
113
189
|
const dmImgStr = Buffer.from('no webgl').toString('base64').slice(0, -2);
|
|
114
190
|
const dmCoverImgStr = Buffer.from('no webgl').toString('base64').slice(0, -2);
|
|
115
191
|
return `${params}&dm_img_list=${dmImgList}&dm_img_str=${dmImgStr}&dm_cover_img_str=${dmCoverImgStr}`;
|
|
116
192
|
}
|
|
117
193
|
|
|
194
|
+
function addDmVerifyInfoWithInter(params: string, dmImgList: string, dmImgInter: string) {
|
|
195
|
+
return `${addDmVerifyInfo(params, dmImgList)}&dm_img_inter=${dmImgInter}`;
|
|
196
|
+
}
|
|
197
|
+
|
|
118
198
|
const bvidTime = 1_589_990_400;
|
|
119
199
|
|
|
120
200
|
export default {
|
|
@@ -124,7 +204,9 @@ export default {
|
|
|
124
204
|
hexsign,
|
|
125
205
|
addWbiVerifyInfo,
|
|
126
206
|
getDmImgList,
|
|
207
|
+
getDmImgInter,
|
|
127
208
|
addDmVerifyInfo,
|
|
209
|
+
addDmVerifyInfoWithInter,
|
|
128
210
|
bvidTime,
|
|
129
211
|
addRenderData,
|
|
130
212
|
};
|
|
@@ -25,7 +25,7 @@ export const route: Route = {
|
|
|
25
25
|
},
|
|
26
26
|
],
|
|
27
27
|
name: 'UP 主投稿',
|
|
28
|
-
maintainers: ['DIYgod'],
|
|
28
|
+
maintainers: ['DIYgod', 'Konano', 'pseudoyu'],
|
|
29
29
|
handler,
|
|
30
30
|
};
|
|
31
31
|
|
|
@@ -35,19 +35,17 @@ async function handler(ctx) {
|
|
|
35
35
|
const cookie = await cache.getCookie();
|
|
36
36
|
const wbiVerifyString = await cache.getWbiVerifyString();
|
|
37
37
|
const dmImgList = utils.getDmImgList();
|
|
38
|
+
const dmImgInter = utils.getDmImgInter();
|
|
38
39
|
const renderData = await cache.getRenderData(uid);
|
|
39
40
|
const [name, face] = await cache.getUsernameAndFaceFromUID(uid);
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// },
|
|
46
|
-
// });
|
|
47
|
-
const params = utils.addWbiVerifyInfo(utils.addRenderData(utils.addDmVerifyInfo(`mid=${uid}&ps=30&tid=0&pn=1&keyword=&order=pubdate&platform=web&web_location=1550101&order_avoided=true`, dmImgList), renderData), wbiVerifyString);
|
|
42
|
+
const params = utils.addWbiVerifyInfo(
|
|
43
|
+
utils.addRenderData(utils.addDmVerifyInfoWithInter(`mid=${uid}&ps=30&tid=0&pn=1&keyword=&order=pubdate&platform=web&web_location=1550101&order_avoided=true`, dmImgList, dmImgInter), renderData),
|
|
44
|
+
wbiVerifyString
|
|
45
|
+
);
|
|
48
46
|
const response = await got(`https://api.bilibili.com/x/space/wbi/arc/search?${params}`, {
|
|
49
47
|
headers: {
|
|
50
|
-
Referer: `https://space.bilibili.com/${uid}/video?tid=0&
|
|
48
|
+
Referer: `https://space.bilibili.com/${uid}/video?tid=0&pn=1&keyword=&order=pubdate`,
|
|
51
49
|
Cookie: cookie,
|
|
52
50
|
},
|
|
53
51
|
});
|