rsshub 1.0.0-master.b76ffa1 → 1.0.0-master.b77ea8a
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 +3 -0
- package/lib/middleware/access-control.ts +1 -1
- package/lib/routes/afdian/dynamic.ts +1 -1
- package/lib/routes/afdian/explore.ts +1 -1
- package/lib/routes/bilibili/bangumi.ts +45 -43
- package/lib/routes/bilibili/bilibili-recommend.ts +4 -4
- package/lib/routes/bilibili/coin.ts +4 -4
- package/lib/routes/bilibili/dynamic.ts +14 -14
- package/lib/routes/bilibili/fav.ts +4 -4
- package/lib/routes/bilibili/followings-dynamic.ts +25 -3
- package/lib/routes/bilibili/followings-video.ts +4 -4
- package/lib/routes/bilibili/like.ts +4 -4
- package/lib/routes/bilibili/page.ts +5 -4
- package/lib/routes/bilibili/partion-ranking.ts +4 -4
- package/lib/routes/bilibili/partion.ts +4 -4
- package/lib/routes/bilibili/popular.ts +6 -4
- package/lib/routes/bilibili/ranking.ts +4 -6
- package/lib/routes/bilibili/templates/description.art +12 -0
- package/lib/routes/bilibili/types.ts +52 -0
- package/lib/routes/bilibili/user-channel.ts +10 -17
- package/lib/routes/bilibili/user-collection.ts +10 -18
- package/lib/routes/bilibili/user-fav.ts +4 -4
- package/lib/routes/bilibili/utils.ts +111 -7
- package/lib/routes/bilibili/video-all.ts +8 -3
- package/lib/routes/bilibili/video.ts +5 -4
- package/lib/routes/bilibili/vsearch.ts +21 -5
- package/lib/routes/bilibili/watchlater.ts +4 -4
- package/lib/routes/bilibili/weekly-recommend.ts +4 -9
- package/lib/routes/bsky/posts.ts +2 -2
- package/lib/routes/bsky/templates/post.art +4 -2
- package/lib/routes/chinania/index.ts +240 -0
- package/lib/routes/chinania/namespace.ts +8 -0
- package/lib/routes/dedao/articles.ts +149 -0
- package/lib/routes/eshukan/academic.ts +134 -0
- package/lib/routes/eshukan/namespace.ts +8 -0
- package/lib/routes/eshukan/templates/description.art +7 -0
- package/lib/routes/follow/profile.ts +37 -3
- package/lib/routes/lovelive-anime/schedules.ts +4 -5
- package/lib/routes/lovelive-anime/topics.ts +88 -37
- package/lib/routes/mingpao/index.ts +7 -1
- package/lib/routes/nature/cover.ts +5 -3
- package/lib/routes/nature/research.ts +1 -1
- package/lib/routes/nature/siteindex.ts +25 -11
- package/lib/routes/nature/utils.ts +5 -7
- package/lib/routes/qq/pd/guild.ts +146 -0
- package/lib/routes/qq/pd/types.ts +82 -0
- package/lib/routes/qq/pd/utils.ts +119 -0
- package/lib/routes/reuters/common.ts +160 -159
- package/lib/routes/reuters/investigates.ts +3 -2
- package/lib/routes/rsshub/transform/html.ts +2 -2
- package/lib/routes/telegram/channel.ts +14 -5
- package/lib/routes/telegram/scripts/get-telegram-session.mjs +41 -0
- package/lib/routes/telegram/tglib/channel.ts +8 -4
- package/lib/routes/theinitium/app.ts +49 -27
- package/lib/routes/theinitium/templates/description.art +2 -2
- package/lib/routes/threads/index.ts +1 -1
- package/lib/routes/threads/utils.ts +19 -1
- package/lib/routes/twitter/api/mobile-api/login.ts +125 -127
- package/lib/routes/twitter/api/mobile-api/token.ts +2 -0
- package/lib/routes/twitter/home-latest.ts +4 -1
- package/lib/routes/twitter/home.ts +4 -1
- package/lib/routes/twitter/likes.ts +4 -1
- package/lib/routes/twitter/list.ts +4 -1
- package/lib/routes/twitter/namespace.ts +1 -0
- package/lib/routes/twitter/utils.ts +9 -3
- package/lib/routes/warthunder/news.ts +8 -8
- package/lib/routes/washingtonpost/app.ts +118 -0
- package/lib/routes/washingtonpost/namespace.ts +6 -0
- package/lib/routes/washingtonpost/templates/description.art +59 -0
- package/lib/routes/zhihu/daily.ts +30 -64
- package/package.json +12 -12
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{{ if content }}
|
|
2
|
+
{{ each content }}
|
|
3
|
+
{{ if $value.type == 'title' && $value.subtype != 'h1'}}
|
|
4
|
+
<{{ if $value.subtype }}{{ $value.subtype }}{{ else }}h2{{ /if }}>
|
|
5
|
+
{{ if $value.mime == 'text/html' }}{{@ $value.content }}{{ /if }}
|
|
6
|
+
{{ if $value.mime == 'text/plain' }}{{ $value.content }}{{ /if }}
|
|
7
|
+
</h{{ if $value.subhead_level }}{{ $value.subhead_level }}{{ else }}1{{ /if }}>
|
|
8
|
+
{{ /if }}
|
|
9
|
+
{{ if $value.type == 'sanitized_html' }}
|
|
10
|
+
{{ if $value.subtype == 'paragraph' }}<p>{{ else if $value.subtype == 'subhead' }}<h{{ if $value.subhead_level }}{{ $value.subhead_level }}{{ else }}4{{ /if }}>{{ /if }}
|
|
11
|
+
{{ if $value.mime == 'text/html' }}{{@ $value.content }}{{ /if }}
|
|
12
|
+
{{ if $value.mime == 'text/plain' }}{{ $value.content }}{{ /if }}
|
|
13
|
+
{{ if $value.oembed }}{{@ $value.oembed }}{{ /if }}
|
|
14
|
+
{{ if $value.subtype == 'paragraph' }}</p>{{ else if $value.subtype == 'subhead' }}</h{{ if $value.subhead_level }}{{ $value.subhead_level }}{{ else }}4{{ /if }}>{{ /if }}
|
|
15
|
+
{{ /if }}
|
|
16
|
+
{{ if $value.type == 'deck' }}
|
|
17
|
+
<blockquote><p>
|
|
18
|
+
{{ if $value.mime == 'text/html' }}{{@ $value.content }}{{ /if }}
|
|
19
|
+
{{ if $value.mime == 'text/plain' }}{{ $value.content }}{{ /if }}
|
|
20
|
+
</p></blockquote>
|
|
21
|
+
{{ /if }}
|
|
22
|
+
{{ if $value.type == 'image' }}
|
|
23
|
+
<figure><img src="{{ $value.imageURL }}" alt="{{ $value.blurb }}"><figcaption>{{ $value.fullcaption }}</figcaption></figure>
|
|
24
|
+
{{ /if }}
|
|
25
|
+
{{ if $value.type == 'video' }}
|
|
26
|
+
{{ if $value.content && $value.content.html }}{{@ $value.content.html }}
|
|
27
|
+
{{ else if $value.mediaURL }}
|
|
28
|
+
<figure>
|
|
29
|
+
<video controls
|
|
30
|
+
{{ if $value.imageURL }}poster="{{ $value.imageURL }}"{{ /if }}
|
|
31
|
+
>
|
|
32
|
+
<source src="{{ $value.mediaURL }}">
|
|
33
|
+
</video>
|
|
34
|
+
{{ if $value.fullcaption }}<figcaption>{{ $value.fullcaption }}</figcaption>{{ /if }}
|
|
35
|
+
</figure>
|
|
36
|
+
{{ /if }}
|
|
37
|
+
{{ /if }}
|
|
38
|
+
{{ if $value.type == 'list' }}
|
|
39
|
+
{{ if $value.subtype == 'ordered' }}<ol>{{ else }}<ul>{{ /if }}
|
|
40
|
+
{{ if $value.mime == 'text/html' }}{{ each $value.content }}<li>{{@ $value }}</li>{{ /each }}{{ /if }}
|
|
41
|
+
{{ if $value.mime == 'text/plain' }}{{ each $value.content }}<li>{{ $value }}</li>{{ /each }}{{ /if }}
|
|
42
|
+
{{ if $value.subtype == 'ordered' }}</ol>{{ else }}</ul>{{ /if }}
|
|
43
|
+
{{ /if }}
|
|
44
|
+
{{ if $value.type == 'divider' }}<br><hr><br>{{ /if }}
|
|
45
|
+
{{ if $value.type == 'byline' }}
|
|
46
|
+
{{ if $value.subtype == 'live-update' || $value.subtype == 'live-reporter-insight' }}
|
|
47
|
+
<p><i>
|
|
48
|
+
{{ if $value.mime == 'text/html' }}{{@ $value.content }}{{ /if }}
|
|
49
|
+
{{ if $value.mime == 'text/plain' }}{{ $value.content }}{{ /if }}
|
|
50
|
+
</i></p>
|
|
51
|
+
{{ /if}}
|
|
52
|
+
{{ /if }}
|
|
53
|
+
{{ if $value.type == 'date' }}
|
|
54
|
+
{{ if $value.subtype == 'live-update'}}
|
|
55
|
+
{{ if $value.content }}{{ $imports.dayjs.tz($value.content,"America/New_York").locale('en').format('dddd, MMMM D, YYYY h:mm A z') }}{{ /if }}
|
|
56
|
+
{{ /if }}
|
|
57
|
+
{{ /if }}
|
|
58
|
+
{{ /each }}
|
|
59
|
+
{{ /if }}
|
|
@@ -1,25 +1,7 @@
|
|
|
1
1
|
import { Route } from '@/types';
|
|
2
|
+
import ofetch from '@/utils/ofetch';
|
|
3
|
+
import { load } from 'cheerio';
|
|
2
4
|
import cache from '@/utils/cache';
|
|
3
|
-
import got from '@/utils/got';
|
|
4
|
-
import { header, processImage } from './utils';
|
|
5
|
-
import { parseDate } from '@/utils/parse-date';
|
|
6
|
-
|
|
7
|
-
// 参考:https://github.com/izzyleung/ZhihuDailyPurify/wiki/%E7%9F%A5%E4%B9%8E%E6%97%A5%E6%8A%A5-API-%E5%88%86%E6%9E%90
|
|
8
|
-
// 文章给出了v4版 api的信息,包含全文api
|
|
9
|
-
|
|
10
|
-
async function dohResolve(name) {
|
|
11
|
-
const response = await got('https://223.5.5.5/resolve', {
|
|
12
|
-
searchParams: {
|
|
13
|
-
name,
|
|
14
|
-
type: 'A',
|
|
15
|
-
edns_client_subnet: '223.5.5.5', // 使用国内的ip地址
|
|
16
|
-
},
|
|
17
|
-
headers: {
|
|
18
|
-
accept: 'application/dns-json',
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
return response.data.Answer.map((item) => item.data);
|
|
22
|
-
}
|
|
23
5
|
|
|
24
6
|
export const route: Route = {
|
|
25
7
|
path: '/daily',
|
|
@@ -40,60 +22,44 @@ export const route: Route = {
|
|
|
40
22
|
},
|
|
41
23
|
],
|
|
42
24
|
name: '知乎日报',
|
|
43
|
-
maintainers: ['DHPO'],
|
|
25
|
+
maintainers: ['DHPO', 'pseudoyu'],
|
|
44
26
|
handler,
|
|
45
27
|
url: 'daily.zhihu.com/*',
|
|
46
28
|
};
|
|
47
29
|
|
|
48
30
|
async function handler() {
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
await got(`${api}/latest`);
|
|
54
|
-
} catch {
|
|
55
|
-
address = (await dohResolve(HOST)).pop(); // 国外ip证书配置有误,解析到国内地址
|
|
56
|
-
}
|
|
57
|
-
const listRes = await got({
|
|
58
|
-
method: 'get',
|
|
59
|
-
url: `${api}/latest`,
|
|
60
|
-
headers: {
|
|
61
|
-
...header,
|
|
62
|
-
Referer: `${api}/latest`,
|
|
63
|
-
Host: address,
|
|
64
|
-
},
|
|
65
|
-
// host: address,
|
|
31
|
+
const key = 'zhihu:daily';
|
|
32
|
+
const response = await cache.tryGet(key, async () => {
|
|
33
|
+
const response = await ofetch('https://daily.zhihu.com/');
|
|
34
|
+
return response;
|
|
66
35
|
});
|
|
67
|
-
// 根据api的说明,过滤掉极个别站外链接
|
|
68
|
-
const storyList = listRes.data.stories.filter((el) => el.type === 0);
|
|
69
|
-
const date = listRes.data.date;
|
|
70
36
|
|
|
71
|
-
const
|
|
72
|
-
title: item.title,
|
|
73
|
-
pubDate: parseDate(date, 'YYYYMMDD'),
|
|
74
|
-
link: item.url,
|
|
75
|
-
guid: item.url,
|
|
76
|
-
storyId: item.id,
|
|
77
|
-
}));
|
|
37
|
+
const $ = load(response);
|
|
78
38
|
|
|
79
39
|
const items = await Promise.all(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
40
|
+
$('.box')
|
|
41
|
+
.toArray()
|
|
42
|
+
.map(async (item) => {
|
|
43
|
+
item = $(item);
|
|
44
|
+
const linkElem = item.find('.link-button');
|
|
45
|
+
const storyUrl = 'https://daily.zhihu.com' + linkElem.attr('href');
|
|
46
|
+
|
|
47
|
+
// Fetch full story content
|
|
48
|
+
const storyResponse = await cache.tryGet(storyUrl, async () => {
|
|
49
|
+
const response = await ofetch(storyUrl);
|
|
50
|
+
return response;
|
|
91
51
|
});
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
52
|
+
|
|
53
|
+
const $story = load(storyResponse);
|
|
54
|
+
const storyTitle = $story('.DailyHeader-title').text();
|
|
55
|
+
const storyContent = $story('.DailyRichText').html();
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
title: storyTitle,
|
|
59
|
+
description: storyContent,
|
|
60
|
+
link: storyUrl,
|
|
61
|
+
};
|
|
62
|
+
})
|
|
97
63
|
);
|
|
98
64
|
|
|
99
65
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rsshub",
|
|
3
|
-
"version": "1.0.0-master.
|
|
3
|
+
"version": "1.0.0-master.b77ea8a",
|
|
4
4
|
"description": "Make RSS Great Again!",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"RSS"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"*.yml": "eslint --cache --fix"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@hono/node-server": "1.13.
|
|
35
|
+
"@hono/node-server": "1.13.3",
|
|
36
36
|
"@hono/zod-openapi": "0.16.4",
|
|
37
37
|
"@notionhq/client": "2.2.15",
|
|
38
38
|
"@opentelemetry/api": "1.9.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@opentelemetry/semantic-conventions": "1.27.0",
|
|
45
45
|
"@postlight/parser": "2.2.3",
|
|
46
46
|
"@rss3/sdk": "0.0.23",
|
|
47
|
-
"@scalar/hono-api-reference": "0.5.
|
|
47
|
+
"@scalar/hono-api-reference": "0.5.157",
|
|
48
48
|
"@sentry/node": "7.119.1",
|
|
49
49
|
"@tonyrl/rand-user-agent": "2.0.81",
|
|
50
50
|
"aes-js": "3.1.2",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"fanfou-sdk": "5.0.0",
|
|
66
66
|
"form-data": "4.0.1",
|
|
67
67
|
"googleapis": "144.0.0",
|
|
68
|
-
"hono": "4.6.
|
|
68
|
+
"hono": "4.6.8",
|
|
69
69
|
"html-to-text": "9.0.5",
|
|
70
70
|
"http-cookie-agent": "6.0.6",
|
|
71
71
|
"https-proxy-agent": "7.0.5",
|
|
@@ -105,20 +105,20 @@
|
|
|
105
105
|
"telegram": "2.26.2",
|
|
106
106
|
"tiny-async-pool": "2.1.0",
|
|
107
107
|
"title": "3.5.3",
|
|
108
|
-
"tldts": "6.1.
|
|
108
|
+
"tldts": "6.1.57",
|
|
109
109
|
"tosource": "2.0.0-alpha.3",
|
|
110
110
|
"tough-cookie": "5.0.0",
|
|
111
|
-
"tsx": "4.19.
|
|
111
|
+
"tsx": "4.19.2",
|
|
112
112
|
"twitter-api-v2": "1.18.1",
|
|
113
113
|
"undici": "6.20.1",
|
|
114
|
-
"uuid": "
|
|
114
|
+
"uuid": "11.0.2",
|
|
115
115
|
"winston": "3.15.0",
|
|
116
116
|
"xxhash-wasm": "1.0.2",
|
|
117
117
|
"zod": "3.23.8"
|
|
118
118
|
},
|
|
119
119
|
"devDependencies": {
|
|
120
|
-
"@babel/preset-env": "7.
|
|
121
|
-
"@babel/preset-typescript": "7.
|
|
120
|
+
"@babel/preset-env": "7.26.0",
|
|
121
|
+
"@babel/preset-typescript": "7.26.0",
|
|
122
122
|
"@eslint/eslintrc": "3.1.0",
|
|
123
123
|
"@eslint/js": "9.13.0",
|
|
124
124
|
"@microsoft/eslint-formatter-sarif": "3.1.0",
|
|
@@ -139,14 +139,14 @@
|
|
|
139
139
|
"@types/mailparser": "3.4.5",
|
|
140
140
|
"@types/markdown-it": "14.1.2",
|
|
141
141
|
"@types/module-alias": "2.0.4",
|
|
142
|
-
"@types/node": "22.
|
|
142
|
+
"@types/node": "22.8.2",
|
|
143
143
|
"@types/sanitize-html": "2.13.0",
|
|
144
144
|
"@types/supertest": "6.0.2",
|
|
145
145
|
"@types/tiny-async-pool": "2.0.3",
|
|
146
146
|
"@types/title": "3.4.3",
|
|
147
147
|
"@types/uuid": "10.0.0",
|
|
148
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
149
|
-
"@typescript-eslint/parser": "8.
|
|
148
|
+
"@typescript-eslint/eslint-plugin": "8.12.1",
|
|
149
|
+
"@typescript-eslint/parser": "8.12.1",
|
|
150
150
|
"@vercel/nft": "0.27.5",
|
|
151
151
|
"@vitest/coverage-v8": "2.0.5",
|
|
152
152
|
"discord-api-types": "0.37.103",
|