rsshub 1.0.0-master.e5d191c → 1.0.0-master.e5fc2b2
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/README.md +11 -46
- package/lib/api/radar/rules/all.ts +3 -6
- package/lib/api/radar/rules/one.ts +3 -6
- package/lib/config.ts +30 -22
- package/lib/errors/index.test.ts +1 -1
- package/lib/errors/index.tsx +2 -2
- package/lib/index.ts +1 -1
- package/lib/middleware/anti-hotlink.test.ts +191 -6
- package/lib/middleware/anti-hotlink.ts +28 -0
- package/lib/middleware/logger.ts +2 -2
- package/lib/middleware/parameter.test.ts +22 -5
- package/lib/middleware/parameter.ts +47 -17
- package/lib/registry.test.ts +8 -0
- package/lib/registry.ts +2 -0
- package/lib/router.js +1 -4
- package/lib/routes/141jav/index.ts +25 -21
- package/lib/routes/141ppv/index.ts +24 -20
- package/lib/routes/51read/article.ts +82 -0
- package/lib/routes/51read/namespace.ts +6 -0
- package/lib/routes/5eplay/utils.ts +5 -3
- package/lib/routes/abc/index.ts +2 -2
- package/lib/routes/agri/index.ts +307 -0
- package/lib/routes/agri/namespace.ts +8 -0
- package/lib/routes/agri/templates/description.art +21 -0
- package/lib/routes/aljazeera/index.ts +2 -2
- package/lib/routes/apnews/api.ts +62 -0
- package/lib/routes/apnews/rss.ts +1 -1
- package/lib/routes/apnews/sitemap.ts +99 -0
- package/lib/routes/apnews/topics.ts +2 -2
- package/lib/routes/apnews/utils.ts +7 -5
- package/lib/routes/bestblogs/feeds.ts +107 -0
- package/lib/routes/bestblogs/namespace.ts +6 -0
- package/lib/routes/bilibili/api-interface.d.ts +1 -0
- package/lib/routes/bilibili/bilibili-recommend.ts +42 -0
- package/lib/routes/bilibili/cache.ts +25 -1
- package/lib/routes/bilibili/dynamic.ts +103 -101
- package/lib/routes/bilibili/followings-video.ts +9 -3
- package/lib/routes/bilibili/utils.ts +5 -0
- package/lib/routes/bilibili/video.ts +2 -1
- package/lib/routes/binance/announcement.ts +168 -0
- package/lib/routes/binance/types.ts +26 -0
- package/lib/routes/bing/daily-wallpaper.ts +1 -1
- package/lib/routes/bitget/announcement.ts +200 -0
- package/lib/routes/bitget/namespace.ts +6 -0
- package/lib/routes/bitget/type.ts +26 -0
- package/lib/routes/bjnews/cat.ts +43 -0
- package/lib/routes/bjnews/column.ts +43 -0
- package/lib/routes/bjnews/namespace.ts +6 -0
- package/lib/routes/bjnews/utils.ts +19 -0
- package/lib/routes/bjx/fd.ts +35 -26
- package/lib/routes/buaa/jiaowu.ts +1 -1
- package/lib/routes/buaa/lib/space/newbook.ts +171 -0
- package/lib/routes/buaa/lib/space/templates/newbook.art +44 -0
- package/lib/routes/bupt/jwc.ts +130 -0
- package/lib/routes/cccfna/index.ts +2 -2
- package/lib/routes/cctv/category.ts +16 -12
- package/lib/routes/cctv/xwlb.ts +32 -10
- package/lib/routes/cdu/jwgg.ts +79 -0
- package/lib/routes/cdu/namespace.ts +6 -0
- package/lib/routes/cffex/announcement.ts +73 -0
- package/lib/routes/cffex/namespace.ts +6 -0
- package/lib/routes/chikubi/index.ts +75 -0
- package/lib/routes/chikubi/namespace.ts +6 -0
- package/lib/routes/chikubi/utils.ts +82 -0
- package/lib/routes/chlinlearn/daily-blog.ts +7 -0
- package/lib/routes/copymanga/comic.ts +3 -1
- package/lib/routes/devolverdigital/blog.ts +59 -42
- package/lib/routes/digitalcameraworld/news.ts +1 -1
- package/lib/routes/discord/channel.ts +10 -10
- package/lib/routes/discord/discord-api.ts +27 -32
- package/lib/routes/discord/templates/message.art +15 -0
- package/lib/routes/discourse/notifications.ts +2 -1
- package/lib/routes/discourse/official.ts +55 -0
- package/lib/routes/douban/movie/coming.ts +68 -0
- package/lib/routes/douban/templates/movie_coming.art +27 -0
- package/lib/routes/eastmoney/report/index.ts +63 -15
- package/lib/routes/eastmoney/templates/stock_description.art +36 -0
- package/lib/routes/eastmoney/utils.ts +35 -0
- package/lib/routes/easynomad/joblist.ts +56 -0
- package/lib/routes/easynomad/namespace.ts +6 -0
- package/lib/routes/fediverse/timeline.ts +35 -18
- package/lib/routes/flashcat/blog.ts +61 -0
- package/lib/routes/flashcat/namespace.ts +6 -0
- package/lib/routes/follow/namespace.ts +6 -0
- package/lib/routes/follow/profile.ts +69 -0
- package/lib/routes/follow/types.ts +38 -0
- package/lib/routes/ftm/index.ts +60 -0
- package/lib/routes/ftm/namespace.ts +6 -0
- package/lib/routes/galxe/index.ts +94 -0
- package/lib/routes/galxe/namespace.ts +9 -0
- package/lib/routes/gamersky/ent.ts +57 -0
- package/lib/routes/gamersky/namespace.ts +10 -0
- package/lib/routes/gamersky/news.ts +91 -0
- package/lib/routes/gamersky/review.ts +80 -0
- package/lib/routes/gamersky/utils.ts +94 -0
- package/lib/routes/gdut/oa-news.ts +12 -17
- package/lib/routes/geekpark/index.ts +219 -0
- package/lib/routes/geekpark/namespace.ts +8 -0
- package/lib/routes/geekpark/templates/description.art +21 -0
- package/lib/routes/gisreportsonline/index.ts +60 -0
- package/lib/routes/gisreportsonline/namespace.ts +6 -0
- package/lib/routes/github/activity.ts +2 -1
- package/lib/routes/github/search.ts +20 -18
- package/lib/routes/go/mhlw/pdf.ts +87 -0
- package/lib/routes/go/namespace.ts +8 -0
- package/lib/routes/go/niid/idwr-dl.ts +104 -0
- package/lib/routes/google/research.ts +45 -0
- package/lib/routes/gov/cbirc/index.ts +371 -0
- package/lib/routes/gov/chongqing/sydwgkzp.ts +4 -4
- package/lib/routes/gov/lswz/index.ts +289 -0
- package/lib/routes/gov/zj/ningbogzw-notice.ts +50 -0
- package/lib/routes/gov/zj/ningborsjnotice.ts +50 -0
- package/lib/routes/gq/news.ts +1 -1
- package/lib/routes/gs/developer/blog.ts +58 -0
- package/lib/routes/gs/namespace.ts +9 -0
- package/lib/routes/healthz.ts +8 -0
- package/lib/routes/hket/index.ts +80 -76
- package/lib/routes/hottoys/index.ts +63 -0
- package/lib/routes/hottoys/namespace.ts +6 -0
- package/lib/routes/hust/gs.ts +281 -0
- package/lib/routes/hust/namespace.ts +1 -1
- package/lib/routes/imhcg/blog.ts +47 -0
- package/lib/routes/imhcg/namespace.ts +7 -0
- package/lib/routes/imop/namespace.ts +10 -0
- package/lib/routes/imop/tianshu.ts +53 -0
- package/lib/routes/infzm/hot.ts +39 -0
- package/lib/routes/infzm/index.ts +3 -30
- package/lib/routes/infzm/utils.ts +34 -0
- package/lib/routes/inspirehep/author.ts +46 -0
- package/lib/routes/inspirehep/literature.ts +42 -0
- package/lib/routes/inspirehep/namespace.ts +7 -0
- package/lib/routes/inspirehep/types.ts +210 -0
- package/lib/routes/inspirehep/utils.ts +15 -0
- package/lib/routes/iwara/subscriptions.ts +1 -1
- package/lib/routes/javdb/actors.ts +6 -2
- package/lib/routes/jjwxc/book.ts +18 -14
- package/lib/routes/joins/chinese.ts +218 -0
- package/lib/routes/joins/namespace.ts +8 -0
- package/lib/routes/joins/templates/description.art +17 -0
- package/lib/routes/juejin/dynamic.ts +114 -0
- package/lib/routes/kakuyomu/namespace.ts +6 -0
- package/lib/routes/kakuyomu/types.ts +6 -0
- package/lib/routes/kakuyomu/works.ts +73 -0
- package/lib/routes/kaopu/news.ts +3 -3
- package/lib/routes/keylol/index.ts +56 -11
- package/lib/routes/kurogames/namespace.ts +7 -0
- package/lib/routes/kurogames/wutheringwaves/news.ts +59 -0
- package/lib/routes/link3/events.ts +86 -0
- package/lib/routes/link3/namespace.ts +6 -0
- package/lib/routes/link3/profile.ts +143 -0
- package/lib/routes/lmu/jobs.ts +96 -0
- package/lib/routes/lmu/namespace.ts +17 -0
- package/lib/routes/lmu/templates/jobPosting.art +11 -0
- package/lib/routes/lofter/user.ts +1 -1
- package/lib/routes/luma/index.ts +92 -0
- package/lib/routes/luma/namespace.ts +6 -0
- package/lib/routes/malaysiakini/index.ts +179 -0
- package/lib/routes/malaysiakini/namespace.ts +11 -0
- package/lib/routes/mcmod/index.ts +105 -0
- package/lib/routes/mcmod/namespace.ts +6 -0
- package/lib/routes/mcmod/templates/mod.art +13 -0
- package/lib/routes/meishichina/index.ts +1997 -0
- package/lib/routes/meishichina/namespace.ts +8 -0
- package/lib/routes/misskey/user-timeline.ts +42 -0
- package/lib/routes/misskey/utils.ts +41 -1
- package/lib/routes/nationalgeographic/latest-stories.ts +1 -1
- package/lib/routes/nationalgeographic/templates/stories.art +1 -1
- package/lib/routes/newyorker/news.ts +24 -17
- package/lib/routes/oschina/news.ts +2 -0
- package/lib/routes/pconline/focus.ts +143 -0
- package/lib/routes/pconline/namespace.ts +10 -0
- package/lib/routes/people/index.ts +8 -2
- package/lib/routes/picnob/user.ts +11 -3
- package/lib/routes/pixiv/search.ts +20 -1
- package/lib/routes/pixiv/utils.ts +3 -3
- package/lib/routes/pku/bbs/hot.ts +1 -1
- package/lib/routes/psyche/topic.ts +1 -1
- package/lib/routes/psyche/type.ts +1 -1
- package/lib/routes/psyche/utils.ts +1 -1
- package/lib/routes/questn/community.ts +76 -0
- package/lib/routes/questn/events.ts +101 -0
- package/lib/routes/questn/namespace.ts +6 -0
- package/lib/routes/questn/util.ts +16 -0
- package/lib/routes/rebase/geekdaily.ts +35 -0
- package/lib/routes/rebase/namespace.ts +6 -0
- package/lib/routes/rss3/index.ts +22 -13
- package/lib/routes/rss3/interfaces/metadata.ts +67 -0
- package/lib/routes/rsshub/routes.ts +18 -12
- package/lib/routes/samd/news.ts +2 -2
- package/lib/routes/sara/index.ts +1 -1
- package/lib/routes/scut/gzic/media.ts +71 -0
- package/lib/routes/scut/gzic/news.ts +65 -0
- package/lib/routes/scut/gzic/notice.ts +88 -0
- package/lib/routes/shiep/config.ts +4 -10
- package/lib/routes/shiep/index.ts +9 -9
- package/lib/routes/showstart/artist.ts +5 -4
- package/lib/routes/showstart/brand.ts +5 -4
- package/lib/routes/showstart/event.ts +8 -7
- package/lib/routes/showstart/search.ts +43 -9
- package/lib/routes/showstart/service.ts +81 -53
- package/lib/routes/showstart/site.ts +41 -0
- package/lib/routes/showstart/utils.ts +9 -8
- package/lib/routes/sis001/author.ts +52 -0
- package/lib/routes/sis001/common.ts +38 -0
- package/lib/routes/sis001/forum.ts +2 -29
- package/lib/routes/sjtu/jwc.ts +4 -1
- package/lib/routes/sjtu/namespace.ts +1 -1
- package/lib/routes/sjtu/seiee/index.ts +97 -0
- package/lib/routes/smzdm/product.ts +86 -0
- package/lib/routes/spotify/show.ts +1 -1
- package/lib/routes/springer/journal.ts +10 -12
- package/lib/routes/sse/sselawsrules.ts +370 -0
- package/lib/routes/sspai/author.ts +1 -1
- package/lib/routes/sspai/column.ts +1 -1
- package/lib/routes/sspai/index.ts +3 -3
- package/lib/routes/sspai/matrix.ts +1 -1
- package/lib/routes/sspai/series-update.ts +1 -1
- package/lib/routes/sspai/tag.ts +1 -1
- package/lib/routes/sspai/topic.ts +1 -1
- package/lib/routes/sustainabilitymag/articles.ts +2 -0
- package/lib/routes/szse/rule.ts +315 -42
- package/lib/routes/t66y/index.ts +29 -7
- package/lib/routes/taoguba/blog.ts +1 -1
- package/lib/routes/taoguba/index.ts +1 -1
- package/lib/routes/techcrunch/news.ts +20 -29
- package/lib/routes/techcrunch/templates/description.art +7 -0
- package/lib/routes/telegram/channel.ts +34 -1
- package/lib/routes/test/index.ts +50 -43
- package/lib/routes/the/index.ts +211 -0
- package/lib/routes/the/namespace.ts +8 -0
- package/lib/routes/the/templates/description.art +27 -0
- package/lib/routes/the/util.ts +307 -0
- package/lib/routes/theblockbeats/index.ts +10 -5
- package/lib/routes/towardsdatascience/latest.ts +67 -0
- package/lib/routes/towardsdatascience/namespace.ts +6 -0
- package/lib/routes/tvb/news.ts +1 -0
- package/lib/routes/twitter/api/index.ts +2 -0
- package/lib/routes/twitter/api/mobile-api/login.ts +1 -1
- package/lib/routes/twitter/api/web-api/api.ts +18 -0
- package/lib/routes/twitter/api/web-api/constants.ts +16 -13
- package/lib/routes/twitter/api/web-api/login.ts +68 -0
- package/lib/routes/twitter/api/web-api/utils.ts +54 -29
- package/lib/routes/twitter/home-latest.ts +60 -0
- package/lib/routes/twitter/home.ts +1 -1
- package/lib/routes/twitter/tweet.ts +1 -0
- package/lib/routes/twitter/user.ts +1 -1
- package/lib/routes/twitter/utils.ts +4 -1
- package/lib/routes/uber/blog.ts +1 -1
- package/lib/routes/ustc/scms.ts +97 -0
- package/lib/routes/wchscu/namespace.ts +6 -0
- package/lib/routes/wchscu/recruit.ts +73 -0
- package/lib/routes/weibo/super-index.ts +23 -11
- package/lib/routes/weibo/utils.ts +0 -4
- package/lib/routes/xiaohongshu/notes.ts +10 -2
- package/lib/routes/xiaohongshu/user.ts +27 -5
- package/lib/routes/xiaohongshu/util.ts +3 -1
- package/lib/routes/xidian/cs.ts +143 -0
- package/lib/routes/xidian/gr.ts +289 -0
- package/lib/routes/xidian/jwc.ts +1 -0
- package/lib/routes/xidian/namespace.ts +1 -1
- package/lib/routes/xueqiu/cookies.ts +14 -1
- package/lib/routes/xueqiu/favorite.ts +16 -2
- package/lib/routes/yahoo/news/index.ts +1 -0
- package/lib/routes/yahoo/news/listid.ts +67 -0
- package/lib/routes/yahoo/news/utils.ts +8 -2
- package/lib/routes/yicai/carousel.ts +48 -0
- package/lib/routes/yicai/utils.ts +23 -17
- package/lib/routes/youtube/subscriptions.ts +1 -0
- package/lib/routes/yystv/docs.ts +28 -19
- package/lib/routes/zaobao/util.ts +1 -1
- package/lib/routes/zhihu/answers.ts +5 -1
- package/lib/routes/zhihu/execlib/x-zse-96-v3.ts +2 -0
- package/lib/routes/zhihu/namespace.ts +3 -0
- package/lib/routes/zhihu/utils.ts +18 -3
- package/lib/routes/zhihu/zhuanlan.ts +8 -7
- package/lib/routes/zsxq/types.ts +9 -0
- package/lib/routes/zsxq/utils.ts +4 -3
- package/lib/setup.test.ts +1 -1
- package/lib/types.ts +6 -0
- package/lib/utils/cache/index.ts +8 -0
- package/lib/utils/camelcase-keys.spec.ts +127 -0
- package/lib/utils/camelcase-keys.ts +27 -0
- package/lib/utils/common-utils.ts +1 -0
- package/lib/utils/otel/metric.ts +3 -2
- package/lib/views/error.tsx +3 -3
- package/lib/views/index.tsx +7 -9
- package/lib/views/json.ts +1 -1
- package/lib/views/layout.tsx +1 -1
- package/package.json +45 -43
- package/lib/routes/sse/lawandrules.ts +0 -68
- package/lib/routes-deprecated/bjnews/news.js +0 -44
- package/lib/routes-deprecated/gamersky/ent.js +0 -89
- package/lib/routes-deprecated/gamersky/news.js +0 -34
- package/lib/routes-deprecated/geekpark/breakingnews.js +0 -25
|
@@ -32,7 +32,7 @@ const resolveRelativeLink = ($: CheerioAPI, elem: Element, attr: string, baseUrl
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
const
|
|
35
|
+
const getAiCompletion = async (prompt: string, text: string) => {
|
|
36
36
|
const apiUrl = `${config.openai.endpoint}/chat/completions`;
|
|
37
37
|
const response = await ofetch(apiUrl, {
|
|
38
38
|
method: 'POST',
|
|
@@ -40,8 +40,8 @@ const summarizeArticle = async (articleText: string) => {
|
|
|
40
40
|
model: config.openai.model,
|
|
41
41
|
max_tokens: config.openai.maxTokens,
|
|
42
42
|
messages: [
|
|
43
|
-
{ role: 'system', content:
|
|
44
|
-
{ role: 'user', content:
|
|
43
|
+
{ role: 'system', content: prompt },
|
|
44
|
+
{ role: 'user', content: text },
|
|
45
45
|
],
|
|
46
46
|
temperature: config.openai.temperature,
|
|
47
47
|
},
|
|
@@ -327,23 +327,53 @@ const middleware: MiddlewareHandler = async (ctx, next) => {
|
|
|
327
327
|
if (ctx.req.query('chatgpt') && config.openai.apiKey) {
|
|
328
328
|
data.item = await Promise.all(
|
|
329
329
|
data.item.map(async (item) => {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
const summary_md = await summarizeArticle(text);
|
|
338
|
-
return md.render(summary_md);
|
|
330
|
+
try {
|
|
331
|
+
// handle description
|
|
332
|
+
if (config.openai.inputOption === 'description' && item.description) {
|
|
333
|
+
const description = await cache.tryGet(`openai:description:${item.link}`, async () => {
|
|
334
|
+
const description = convert(item.description!);
|
|
335
|
+
const descriptionMd = await getAiCompletion(config.openai.promptDescription, description);
|
|
336
|
+
return md.render(descriptionMd);
|
|
339
337
|
});
|
|
340
|
-
//
|
|
341
|
-
if (
|
|
342
|
-
item.description =
|
|
338
|
+
// add it to the description
|
|
339
|
+
if (description !== '') {
|
|
340
|
+
item.description = description + '<hr/><br/>' + item.description;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
// handle title
|
|
344
|
+
else if (config.openai.inputOption === 'title' && item.title) {
|
|
345
|
+
const title = await cache.tryGet(`openai:title:${item.link}`, async () => {
|
|
346
|
+
const title = convert(item.title!);
|
|
347
|
+
return await getAiCompletion(config.openai.promptTitle, title);
|
|
348
|
+
});
|
|
349
|
+
// replace the title
|
|
350
|
+
if (title !== '') {
|
|
351
|
+
item.title = title + '';
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
// handle both
|
|
355
|
+
else if (config.openai.inputOption === 'both' && item.title && item.description) {
|
|
356
|
+
const title = await cache.tryGet(`openai:title:${item.link}`, async () => {
|
|
357
|
+
const title = convert(item.title!);
|
|
358
|
+
return await getAiCompletion(config.openai.promptTitle, title);
|
|
359
|
+
});
|
|
360
|
+
// replace the title
|
|
361
|
+
if (title !== '') {
|
|
362
|
+
item.title = title + '';
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
const description = await cache.tryGet(`openai:description:${item.link}`, async () => {
|
|
366
|
+
const description = convert(item.description!);
|
|
367
|
+
const descriptionMd = await getAiCompletion(config.openai.promptDescription, description);
|
|
368
|
+
return md.render(descriptionMd);
|
|
369
|
+
});
|
|
370
|
+
// add it to the description
|
|
371
|
+
if (description !== '') {
|
|
372
|
+
item.description = description + '<hr/><br/>' + item.description;
|
|
343
373
|
}
|
|
344
|
-
} catch {
|
|
345
|
-
// when openai failed, return default description and not write cache
|
|
346
374
|
}
|
|
375
|
+
} catch {
|
|
376
|
+
// when openai failed, return default content and not write cache
|
|
347
377
|
}
|
|
348
378
|
return item;
|
|
349
379
|
})
|
package/lib/registry.test.ts
CHANGED
|
@@ -29,4 +29,12 @@ describe('registry', () => {
|
|
|
29
29
|
const response = await app.request('/favicon.ico');
|
|
30
30
|
expect(response.status).toBe(200);
|
|
31
31
|
});
|
|
32
|
+
|
|
33
|
+
// healthz
|
|
34
|
+
it('/healthz', async () => {
|
|
35
|
+
const response = await app.request('/healthz');
|
|
36
|
+
expect(response.status).toBe(200);
|
|
37
|
+
expect(response.headers.get('cache-control')).toBe('no-cache');
|
|
38
|
+
expect(await response.text()).toBe('ok');
|
|
39
|
+
});
|
|
32
40
|
});
|
package/lib/registry.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { serveStatic } from '@hono/node-server/serve-static';
|
|
|
7
7
|
import { config } from '@/config';
|
|
8
8
|
|
|
9
9
|
import index from '@/routes/index';
|
|
10
|
+
import healthz from '@/routes/healthz';
|
|
10
11
|
import robotstxt from '@/routes/robots.txt';
|
|
11
12
|
import metrics from '@/routes/metrics';
|
|
12
13
|
|
|
@@ -100,6 +101,7 @@ for (const namespace in namespaces) {
|
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
app.get('/', index);
|
|
104
|
+
app.get('/healthz', healthz);
|
|
103
105
|
app.get('/robots.txt', robotstxt);
|
|
104
106
|
if (config.debugInfo) {
|
|
105
107
|
// Only enable tracing in debug mode
|
package/lib/router.js
CHANGED
|
@@ -66,9 +66,6 @@ router.get('/konachan.net/post/popular_recent/:period', lazyloadRouteHandler('./
|
|
|
66
66
|
// EZTV
|
|
67
67
|
router.get('/eztv/torrents/:imdb_id', lazyloadRouteHandler('./routes/eztv/imdb'));
|
|
68
68
|
|
|
69
|
-
// 新京报
|
|
70
|
-
router.get('/bjnews/:cat', lazyloadRouteHandler('./routes/bjnews/news'));
|
|
71
|
-
|
|
72
69
|
// 米哈游
|
|
73
70
|
router.get('/mihoyo/bh3/:type', lazyloadRouteHandler('./routes/mihoyo/bh3'));
|
|
74
71
|
router.get('/mihoyo/bh2/:type', lazyloadRouteHandler('./routes/mihoyo/bh2'));
|
|
@@ -364,7 +361,7 @@ router.get('/ltaaa/:category?', lazyloadRouteHandler('./routes/ltaaa/index'));
|
|
|
364
361
|
router.get('/autotrader/:query', lazyloadRouteHandler('./routes/autotrader'));
|
|
365
362
|
|
|
366
363
|
// 极客公园
|
|
367
|
-
router.get('/geekpark/breakingnews', lazyloadRouteHandler('./routes/geekpark/breakingnews'));
|
|
364
|
+
// router.get('/geekpark/breakingnews', lazyloadRouteHandler('./routes/geekpark/breakingnews'));
|
|
368
365
|
|
|
369
366
|
// 搜狗
|
|
370
367
|
// router.get('/sogou/doodles', lazyloadRouteHandler('./routes/sogou/doodles'));
|
|
@@ -10,49 +10,53 @@ import { art } from '@/utils/render';
|
|
|
10
10
|
import path from 'node:path';
|
|
11
11
|
|
|
12
12
|
export const route: Route = {
|
|
13
|
-
path: '
|
|
13
|
+
path: '/:type/:keyword{.*}?',
|
|
14
14
|
categories: ['multimedia'],
|
|
15
15
|
name: '通用',
|
|
16
16
|
maintainers: ['cgkings', 'nczitzk'],
|
|
17
|
+
parameters: { type: '类型,可查看下表的类型说明', keyword: '关键词,可查看下表的关键词说明' },
|
|
18
|
+
handler,
|
|
17
19
|
description: `**类型**
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
| 最新 | 热门 | 随机 | 指定演员 | 指定标签 | 日期 |
|
|
22
|
+
| ---- | ------- | ------ | -------- | -------- | ---- |
|
|
23
|
+
| new | popular | random | actress | tag | date |
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
**关键词**
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
| 空 | 日期范围 | 演员名 | 标签名 | 年月日 |
|
|
28
|
+
| -- | ----------- | ------------ | -------------- | ---------- |
|
|
29
|
+
| | 7 / 30 / 60 | Yua%20Mikami | Adult%20Awards | 2020/07/30 |
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
**示例说明**
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
- \`/141jav/new\`
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
仅当类型为 \`new\` \`popular\` 或 \`random\` 时关键词为 **空**
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
- \`/141jav/popular/30\`
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
\`popular\` \`random\` 类型的关键词可填写 \`7\` \`30\` 或 \`60\` 三个 **日期范围** 之一,分别对应 **7 天**、**30 天** 或 **60 天内**
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
- \`/141jav/actress/Yua%20Mikami\`
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
\`actress\` 类型的关键词必须填写 **演员名** ,可在 [此处](https://141jav.com/actress/) 演员单页链接中获取
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
- \`/141jav/tag/Adult%20Awards\`
|
|
44
46
|
|
|
45
|
-
|
|
47
|
+
\`tag\` 类型的关键词必须填写 **标签名** 且标签中的 \`/\` 必须替换为 \`%2F\` ,可在 [此处](https://141jav.com/tag/) 标签单页链接中获取
|
|
46
48
|
|
|
47
|
-
|
|
49
|
+
- \`/141jav/date/2020/07/30\`
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
handler,
|
|
51
|
+
\`date\` 类型的关键词必须填写 **日期(年/月/日)**`,
|
|
51
52
|
};
|
|
52
53
|
|
|
53
54
|
async function handler(ctx) {
|
|
54
55
|
const rootUrl = 'https://www.141jav.com';
|
|
55
|
-
const
|
|
56
|
+
const type = ctx.req.param('type');
|
|
57
|
+
const keyword = ctx.req.param('keyword') ?? '';
|
|
58
|
+
|
|
59
|
+
const currentUrl = `${rootUrl}/${type}${keyword ? `/${keyword}` : ''}`;
|
|
56
60
|
|
|
57
61
|
const response = await got({
|
|
58
62
|
method: 'get',
|
|
@@ -10,49 +10,53 @@ import { art } from '@/utils/render';
|
|
|
10
10
|
import path from 'node:path';
|
|
11
11
|
|
|
12
12
|
export const route: Route = {
|
|
13
|
-
path: '
|
|
13
|
+
path: '/:type/:keyword{.*}?',
|
|
14
14
|
categories: ['multimedia'],
|
|
15
15
|
name: '通用',
|
|
16
16
|
maintainers: ['cgkings', 'nczitzk'],
|
|
17
|
+
parameters: { type: '类型,可查看下表的类型说明', keyword: '关键词,可查看下表的关键词说明' },
|
|
17
18
|
handler,
|
|
18
19
|
description: `**类型**
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
| 最新 | 热门 | 随机 | 指定演员 | 指定标签 | 日期 |
|
|
22
|
+
| ---- | ------- | ------ | -------- | -------- | ---- |
|
|
23
|
+
| new | popular | random | actress | tag | date |
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
**关键词**
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
| 空 | 日期范围 | 演员名 | 标签名 | 年月日 |
|
|
28
|
+
| -- | ----------- | ------------ | -------------- | ---------- |
|
|
29
|
+
| | 7 / 30 / 60 | Yua%20Mikami | Adult%20Awards | 2020/07/30 |
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
**示例说明**
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
- \`/141ppv/new\`
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
仅当类型为 \`new\` \`popular\` 或 \`random\` 时关键词为 **空**
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
- \`/141ppv/popular/30\`
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
\`popular\` \`random\` 类型的关键词可填写 \`7\` \`30\` 或 \`60\` 三个 **日期范围** 之一,分别对应 **7 天**、**30 天** 或 **60 天内**
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
- \`/141ppv/actress/Yua%20Mikami\`
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
\`actress\` 类型的关键词必须填写 **演员名** ,可在 [此处](https://141ppv.com/actress/) 演员单页链接中获取
|
|
43
44
|
|
|
44
|
-
|
|
45
|
+
- \`/141ppv/tag/Adult%20Awards\`
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
\`tag\` 类型的关键词必须填写 **标签名** 且标签中的 \`/\` 必须替换为 \`%2F\` ,可在 [此处](https://141ppv.com/tag/) 标签单页链接中获取
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
- \`/141ppv/date/2020/07/30\`
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
\`date\` 类型的关键词必须填写 **日期(年/月/日)**`,
|
|
51
52
|
};
|
|
52
53
|
|
|
53
54
|
async function handler(ctx) {
|
|
54
55
|
const rootUrl = 'https://www.141ppv.com';
|
|
55
|
-
const
|
|
56
|
+
const type = ctx.req.param('type');
|
|
57
|
+
const keyword = ctx.req.param('keyword') ?? '';
|
|
58
|
+
|
|
59
|
+
const currentUrl = `${rootUrl}/${type}${keyword ? `/${keyword}` : ''}`;
|
|
56
60
|
|
|
57
61
|
const response = await got({
|
|
58
62
|
method: 'get',
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { load } from 'cheerio';
|
|
2
|
+
import cache from '@/utils/cache';
|
|
3
|
+
import ofetch from '@/utils/ofetch';
|
|
4
|
+
import type { Route, DataItem } from '@/types';
|
|
5
|
+
|
|
6
|
+
export const route: Route = {
|
|
7
|
+
path: '/article/:id',
|
|
8
|
+
name: '章节',
|
|
9
|
+
url: 'm.51read.org',
|
|
10
|
+
maintainers: ['lazwa34'],
|
|
11
|
+
example: '/51read/article/152685',
|
|
12
|
+
parameters: { id: '小说 id, 可在对应小说页 URL 中找到' },
|
|
13
|
+
categories: ['reading'],
|
|
14
|
+
features: {
|
|
15
|
+
requireConfig: false,
|
|
16
|
+
requirePuppeteer: false,
|
|
17
|
+
antiCrawler: false,
|
|
18
|
+
supportBT: false,
|
|
19
|
+
supportPodcast: false,
|
|
20
|
+
supportScihub: false,
|
|
21
|
+
},
|
|
22
|
+
radar: [
|
|
23
|
+
{
|
|
24
|
+
source: ['m.51read.org/xiaoshuo/:id'],
|
|
25
|
+
target: '/article/:id',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
source: ['51read.org/xiaoshuo/:id'],
|
|
29
|
+
target: '/article/:id',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
handler,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
async function handler(ctx) {
|
|
36
|
+
const { id } = ctx.req.param();
|
|
37
|
+
const link = `https://m.51read.org/xiaoshuo/${id}`;
|
|
38
|
+
const $book = load(await ofetch(link));
|
|
39
|
+
|
|
40
|
+
const chapter = `https://m.51read.org/zhangjiemulu/${id}`;
|
|
41
|
+
const $chapter = load(await ofetch(chapter));
|
|
42
|
+
|
|
43
|
+
const pageLength = $chapter('.ml-page select')
|
|
44
|
+
.find('option')
|
|
45
|
+
.map((_, option) => option.attribs.value)
|
|
46
|
+
.toArray().length;
|
|
47
|
+
|
|
48
|
+
const item = await createItem(chapter, pageLength);
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
title: $book('h1').text(),
|
|
52
|
+
description: $book('.bi-cot p').text(),
|
|
53
|
+
link,
|
|
54
|
+
item,
|
|
55
|
+
image: $book('.bi-img img').attr('src'),
|
|
56
|
+
author: $book('.bi-wt a').text(),
|
|
57
|
+
language: 'zh-cn',
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const createItem = async (baseUrl: string, page: number) => {
|
|
62
|
+
const url = `${baseUrl}/${page}`;
|
|
63
|
+
const $latest = load(await ofetch(url));
|
|
64
|
+
const item = await Promise.all(
|
|
65
|
+
$latest('.kb-jp li>a')
|
|
66
|
+
.map((_, chapter) => buildItem(chapter.attribs.href))
|
|
67
|
+
.toArray()
|
|
68
|
+
.toReversed()
|
|
69
|
+
);
|
|
70
|
+
return item;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const buildItem = (url: string) =>
|
|
74
|
+
cache.tryGet(url, async () => {
|
|
75
|
+
const $ = load(await ofetch(url));
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
title: $('h1').text(),
|
|
79
|
+
description: $('.kb-cot').html() || '',
|
|
80
|
+
link: url,
|
|
81
|
+
};
|
|
82
|
+
}) as Promise<DataItem>;
|
|
@@ -13,10 +13,12 @@ const getAcwScV2ByArg1 = (arg1) => {
|
|
|
13
13
|
}
|
|
14
14
|
return res;
|
|
15
15
|
};
|
|
16
|
-
const unsbox = function (str) {
|
|
16
|
+
const unsbox = function (str: string) {
|
|
17
17
|
const code = [15, 35, 29, 24, 33, 16, 1, 38, 10, 9, 19, 31, 40, 27, 22, 23, 25, 13, 6, 11, 39, 18, 20, 8, 14, 21, 32, 26, 2, 30, 7, 4, 17, 5, 3, 28, 34, 37, 12, 36];
|
|
18
|
-
const res = [];
|
|
19
|
-
|
|
18
|
+
const res: string[] = [];
|
|
19
|
+
// eslint-disable-next-line unicorn/no-for-loop
|
|
20
|
+
for (let i = 0; i < str.length; i++) {
|
|
21
|
+
const cur = str[i];
|
|
20
22
|
for (const [j, element] of code.entries()) {
|
|
21
23
|
if (element === i + 1) {
|
|
22
24
|
res[j] = cur;
|
package/lib/routes/abc/index.ts
CHANGED
|
@@ -82,8 +82,8 @@ async function handler(ctx) {
|
|
|
82
82
|
}),
|
|
83
83
|
author: i.newsBylineProps?.authors?.map((a) => a.name).join('/') ?? undefined,
|
|
84
84
|
guid: `abc-${i.id}`,
|
|
85
|
-
pubDate: parseDate(i.
|
|
86
|
-
updated: i.
|
|
85
|
+
pubDate: parseDate(i.dates.firstPublished),
|
|
86
|
+
updated: i.dates.lastUpdated ? parseDate(i.dates.lastUpdated) : undefined,
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
if (i.mediaIndicator) {
|