feedscout 1.8.0 → 2.0.0-beta.1
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 +1 -1
- package/dist/blogrolls/extractors.d.ts +2 -2
- package/dist/blogrolls/extractors.js +2 -2
- package/dist/blogrolls/index.js +4 -5
- package/dist/blogrolls.d.ts +2 -2
- package/dist/blogrolls.js +2 -2
- package/dist/common/discover/defaults.d.ts +6 -0
- package/dist/common/discover/defaults.js +44 -0
- package/dist/common/discover/index.js +2 -2
- package/dist/common/discover/utils.d.ts +3 -6
- package/dist/common/discover/utils.js +1 -28
- package/dist/common/locales.js +214 -10
- package/dist/common/types.d.ts +3 -2
- package/dist/common/uris/feed/types.d.ts +2 -2
- package/dist/common/uris/html/types.d.ts +4 -4
- package/dist/common/utils.d.ts +6 -4
- package/dist/common/utils.js +13 -11
- package/dist/favicons/extractors.d.ts +2 -2
- package/dist/favicons/extractors.js +2 -2
- package/dist/favicons/index.js +4 -5
- package/dist/favicons.d.ts +2 -2
- package/dist/favicons.js +2 -2
- package/dist/feeds/defaults.d.ts +2 -1
- package/dist/feeds/defaults.js +116 -9
- package/dist/feeds/extractors.d.ts +2 -2
- package/dist/feeds/extractors.js +6 -6
- package/dist/feeds/index.js +4 -5
- package/dist/feeds/platform/handlers/acast.js +26 -0
- package/dist/feeds/platform/handlers/ameblo.js +36 -0
- package/dist/feeds/platform/handlers/applePodcasts.js +1 -1
- package/dist/feeds/platform/handlers/arena.js +42 -0
- package/dist/feeds/platform/handlers/artstation.js +52 -0
- package/dist/feeds/platform/handlers/audioboom.js +23 -0
- package/dist/feeds/platform/handlers/bearblog.js +45 -0
- package/dist/feeds/platform/handlers/behance.js +7 -0
- package/dist/feeds/platform/handlers/blogspot.js +38 -2
- package/dist/feeds/platform/handlers/bookwyrm.js +48 -0
- package/dist/feeds/platform/handlers/buttondown.js +43 -0
- package/dist/feeds/platform/handlers/buzzsprout.js +22 -0
- package/dist/feeds/platform/handlers/codeberg.js +5 -5
- package/dist/feeds/platform/handlers/dailymotion.js +16 -0
- package/dist/feeds/platform/handlers/deviantart.js +25 -6
- package/dist/feeds/platform/handlers/devto.js +8 -0
- package/dist/feeds/platform/handlers/discourse.js +70 -0
- package/dist/feeds/platform/handlers/dreamwidth.js +48 -0
- package/dist/feeds/platform/handlers/exblog.js +35 -0
- package/dist/feeds/platform/handlers/fireside.js +24 -0
- package/dist/feeds/platform/handlers/friendica.js +44 -0
- package/dist/feeds/platform/handlers/ghost.js +30 -0
- package/dist/feeds/platform/handlers/github.js +6 -0
- package/dist/feeds/platform/handlers/githubGist.js +16 -5
- package/dist/feeds/platform/handlers/gitlab.js +31 -13
- package/dist/feeds/platform/handlers/goodreads.js +18 -8
- package/dist/feeds/platform/handlers/hackernews.js +21 -0
- package/dist/feeds/platform/handlers/hashnode.js +1 -1
- package/dist/feeds/platform/handlers/hatenablog.js +4 -1
- package/dist/feeds/platform/handlers/hearthis.js +32 -0
- package/dist/feeds/platform/handlers/heyWorld.js +18 -0
- package/dist/feeds/platform/handlers/insanejournal.js +69 -0
- package/dist/feeds/platform/handlers/itchio.js +24 -1
- package/dist/feeds/platform/handlers/lemmy.js +46 -4
- package/dist/feeds/platform/handlers/letterboxd.js +4 -0
- package/dist/feeds/platform/handlers/libsyn.js +25 -0
- package/dist/feeds/platform/handlers/listed.js +20 -0
- package/dist/feeds/platform/handlers/livejournal.js +68 -0
- package/dist/feeds/platform/handlers/mastodon.js +32 -0
- package/dist/feeds/platform/handlers/mataroa.js +16 -0
- package/dist/feeds/platform/handlers/medium.js +2 -2
- package/dist/feeds/platform/handlers/microblog.js +55 -0
- package/dist/feeds/platform/handlers/misskey.js +40 -0
- package/dist/feeds/platform/handlers/myanimelist.js +43 -0
- package/dist/feeds/platform/handlers/naverBlog.js +21 -0
- package/dist/feeds/platform/handlers/nebula.js +68 -0
- package/dist/feeds/platform/handlers/note.js +53 -0
- package/dist/feeds/platform/handlers/observable.js +34 -0
- package/dist/feeds/platform/handlers/odysee.js +20 -0
- package/dist/feeds/platform/handlers/pagecord.js +16 -0
- package/dist/feeds/platform/handlers/paragraph.js +1 -2
- package/dist/feeds/platform/handlers/pika.js +35 -0
- package/dist/feeds/platform/handlers/pinterest.js +13 -0
- package/dist/feeds/platform/handlers/pixelfed.js +46 -0
- package/dist/feeds/platform/handlers/pleroma.js +34 -0
- package/dist/feeds/platform/handlers/podbean.js +29 -0
- package/dist/feeds/platform/handlers/podigee.js +29 -0
- package/dist/feeds/platform/handlers/posthaven.js +24 -0
- package/dist/feeds/platform/handlers/prose.js +26 -0
- package/dist/feeds/platform/handlers/qiita.js +58 -0
- package/dist/feeds/platform/handlers/reddit.js +83 -9
- package/dist/feeds/platform/handlers/rssCom.js +20 -0
- package/dist/feeds/platform/handlers/seesaa.js +22 -0
- package/dist/feeds/platform/handlers/sourceforge.js +37 -4
- package/dist/feeds/platform/handlers/spreaker.js +21 -0
- package/dist/feeds/platform/handlers/stackExchange.js +26 -2
- package/dist/feeds/platform/handlers/steam.js +7 -0
- package/dist/feeds/platform/handlers/tildes.js +41 -0
- package/dist/feeds/platform/handlers/tistory.js +16 -0
- package/dist/feeds/platform/handlers/transistor.js +29 -0
- package/dist/feeds/platform/handlers/velog.js +24 -0
- package/dist/feeds/platform/handlers/vimeo.js +6 -0
- package/dist/feeds/platform/handlers/weblogLol.js +26 -0
- package/dist/feeds/platform/handlers/weebly.js +25 -0
- package/dist/feeds/platform/handlers/wordpress.js +173 -28
- package/dist/feeds/platform/handlers/writeas.js +51 -0
- package/dist/feeds/platform/handlers/ximalaya.js +1 -1
- package/dist/feeds/platform/handlers/youtube.js +4 -1
- package/dist/feeds/platform/handlers/zenn.js +54 -0
- package/dist/feeds.d.ts +3 -3
- package/dist/feeds.js +3 -3
- package/dist/hubs/discover/index.js +3 -3
- package/dist/hubs/feed/index.js +2 -2
- package/dist/hubs/headers/index.js +2 -2
- package/dist/hubs/html/index.js +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/utils.d.ts +2 -1
- package/package.json +24 -64
- package/dist/blogrolls/defaults.cjs +0 -51
- package/dist/blogrolls/defaults.d.cts +0 -17
- package/dist/blogrolls/extractors.cjs +0 -21
- package/dist/blogrolls/extractors.d.cts +0 -7
- package/dist/blogrolls/index.cjs +0 -26
- package/dist/blogrolls/index.d.cts +0 -7
- package/dist/blogrolls/types.d.cts +0 -6
- package/dist/blogrolls.cjs +0 -13
- package/dist/blogrolls.d.cts +0 -4
- package/dist/common/discover/index.cjs +0 -105
- package/dist/common/discover/utils.cjs +0 -130
- package/dist/common/discover/utils.d.cts +0 -8
- package/dist/common/locales.cjs +0 -144
- package/dist/common/types.cjs +0 -10
- package/dist/common/types.d.cts +0 -89
- package/dist/common/uris/feed/index.cjs +0 -12
- package/dist/common/uris/feed/index.d.cts +0 -6
- package/dist/common/uris/feed/types.d.cts +0 -9
- package/dist/common/uris/guess/index.cjs +0 -8
- package/dist/common/uris/guess/index.d.cts +0 -7
- package/dist/common/uris/guess/types.d.cts +0 -10
- package/dist/common/uris/guess/utils.cjs +0 -42
- package/dist/common/uris/guess/utils.d.cts +0 -8
- package/dist/common/uris/headers/index.cjs +0 -26
- package/dist/common/uris/headers/index.d.cts +0 -6
- package/dist/common/uris/headers/types.d.cts +0 -9
- package/dist/common/uris/html/handlers.cjs +0 -45
- package/dist/common/uris/html/index.cjs +0 -19
- package/dist/common/uris/html/index.d.cts +0 -6
- package/dist/common/uris/html/types.d.cts +0 -12
- package/dist/common/uris/index.cjs +0 -32
- package/dist/common/uris/platform/index.cjs +0 -10
- package/dist/common/uris/platform/index.d.cts +0 -7
- package/dist/common/uris/platform/types.d.cts +0 -13
- package/dist/common/utils.cjs +0 -97
- package/dist/common/utils.d.cts +0 -10
- package/dist/favicons/defaults.cjs +0 -65
- package/dist/favicons/defaults.d.cts +0 -18
- package/dist/favicons/extractors.cjs +0 -25
- package/dist/favicons/extractors.d.cts +0 -7
- package/dist/favicons/index.cjs +0 -30
- package/dist/favicons/index.d.cts +0 -7
- package/dist/favicons/platform/handlers/bluesky.cjs +0 -27
- package/dist/favicons/platform/handlers/codeberg.cjs +0 -19
- package/dist/favicons/platform/handlers/deviantart.cjs +0 -29
- package/dist/favicons/platform/handlers/devto.cjs +0 -31
- package/dist/favicons/platform/handlers/github.cjs +0 -19
- package/dist/favicons/platform/handlers/githubGist.cjs +0 -19
- package/dist/favicons/platform/handlers/gitlab.cjs +0 -38
- package/dist/favicons/platform/handlers/lobsters.cjs +0 -21
- package/dist/favicons/platform/handlers/mastodon.cjs +0 -40
- package/dist/favicons/platform/handlers/reddit.cjs +0 -42
- package/dist/favicons/platform/handlers/sourceforge.cjs +0 -21
- package/dist/favicons/platform/handlers/tumblr.cjs +0 -16
- package/dist/favicons/types.d.cts +0 -4
- package/dist/favicons/utils.cjs +0 -10
- package/dist/favicons.cjs +0 -12
- package/dist/favicons.d.cts +0 -4
- package/dist/feeds/defaults.cjs +0 -178
- package/dist/feeds/defaults.d.cts +0 -20
- package/dist/feeds/extractors.cjs +0 -46
- package/dist/feeds/extractors.d.cts +0 -7
- package/dist/feeds/index.cjs +0 -27
- package/dist/feeds/index.d.cts +0 -7
- package/dist/feeds/platform/handlers/applePodcasts.cjs +0 -26
- package/dist/feeds/platform/handlers/behance.cjs +0 -49
- package/dist/feeds/platform/handlers/blogspot.cjs +0 -36
- package/dist/feeds/platform/handlers/bluesky.cjs +0 -20
- package/dist/feeds/platform/handlers/codeberg.cjs +0 -69
- package/dist/feeds/platform/handlers/csdn.cjs +0 -20
- package/dist/feeds/platform/handlers/dailymotion.cjs +0 -70
- package/dist/feeds/platform/handlers/deviantart.cjs +0 -66
- package/dist/feeds/platform/handlers/devto.cjs +0 -50
- package/dist/feeds/platform/handlers/douban.cjs +0 -56
- package/dist/feeds/platform/handlers/github.cjs +0 -116
- package/dist/feeds/platform/handlers/githubGist.cjs +0 -45
- package/dist/feeds/platform/handlers/gitlab.cjs +0 -80
- package/dist/feeds/platform/handlers/goodreads.cjs +0 -39
- package/dist/feeds/platform/handlers/hashnode.cjs +0 -16
- package/dist/feeds/platform/handlers/hatenablog.cjs +0 -53
- package/dist/feeds/platform/handlers/itchio.cjs +0 -88
- package/dist/feeds/platform/handlers/kickstarter.cjs +0 -22
- package/dist/feeds/platform/handlers/lemmy.cjs +0 -46
- package/dist/feeds/platform/handlers/letterboxd.cjs +0 -42
- package/dist/feeds/platform/handlers/lobsters.cjs +0 -57
- package/dist/feeds/platform/handlers/mastodon.cjs +0 -42
- package/dist/feeds/platform/handlers/medium.cjs +0 -68
- package/dist/feeds/platform/handlers/paragraph.cjs +0 -21
- package/dist/feeds/platform/handlers/pinterest.cjs +0 -44
- package/dist/feeds/platform/handlers/producthunt.cjs +0 -29
- package/dist/feeds/platform/handlers/reddit.cjs +0 -75
- package/dist/feeds/platform/handlers/soundcloud.cjs +0 -39
- package/dist/feeds/platform/handlers/sourceforge.cjs +0 -20
- package/dist/feeds/platform/handlers/stackExchange.cjs +0 -40
- package/dist/feeds/platform/handlers/steam.cjs +0 -28
- package/dist/feeds/platform/handlers/substack.cjs +0 -23
- package/dist/feeds/platform/handlers/tumblr.cjs +0 -24
- package/dist/feeds/platform/handlers/v2ex.cjs +0 -35
- package/dist/feeds/platform/handlers/vimeo.cjs +0 -69
- package/dist/feeds/platform/handlers/wordpress.cjs +0 -64
- package/dist/feeds/platform/handlers/wpengine.cjs +0 -10
- package/dist/feeds/platform/handlers/ximalaya.cjs +0 -20
- package/dist/feeds/platform/handlers/youtube.cjs +0 -94
- package/dist/feeds/types.d.cts +0 -9
- package/dist/feeds.cjs +0 -15
- package/dist/feeds.d.cts +0 -4
- package/dist/hubs/discover/index.cjs +0 -30
- package/dist/hubs/discover/index.d.cts +0 -7
- package/dist/hubs/discover/types.d.cts +0 -15
- package/dist/hubs/feed/index.cjs +0 -32
- package/dist/hubs/headers/index.cjs +0 -17
- package/dist/hubs/html/index.cjs +0 -28
- package/dist/hubs.cjs +0 -0
- package/dist/hubs.d.cts +0 -2
- package/dist/index.cjs +0 -12
- package/dist/index.d.cts +0 -7
- package/dist/methods.cjs +0 -15
- package/dist/methods.d.cts +0 -7
- package/dist/utils.cjs +0 -9
- package/dist/utils.d.cts +0 -2
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/wordpress.ts
|
|
3
|
-
const categoryRegex = /^\/category\/([^/]+)/;
|
|
4
|
-
const tagRegex = /^\/tag\/([^/]+)/;
|
|
5
|
-
const authorRegex = /^\/author\/([^/]+)/;
|
|
6
|
-
const wordpressHandler = {
|
|
7
|
-
match: (url) => {
|
|
8
|
-
return require_utils.isSubdomainOf(url, "wordpress.com");
|
|
9
|
-
},
|
|
10
|
-
resolve: (url) => {
|
|
11
|
-
const { origin, pathname } = new URL(url);
|
|
12
|
-
const uris = [];
|
|
13
|
-
const categoryMatch = pathname.match(categoryRegex);
|
|
14
|
-
if (categoryMatch?.[1]) uris.push({
|
|
15
|
-
uri: [`${origin}/category/${categoryMatch[1]}/feed/`, `${origin}/category/${categoryMatch[1]}/?feed=rss`],
|
|
16
|
-
hint: require_utils.composeHint("wordpress:category")
|
|
17
|
-
});
|
|
18
|
-
const tagMatch = pathname.match(tagRegex);
|
|
19
|
-
if (tagMatch?.[1]) uris.push({
|
|
20
|
-
uri: [`${origin}/tag/${tagMatch[1]}/feed/`, `${origin}/tag/${tagMatch[1]}/?feed=rss`],
|
|
21
|
-
hint: require_utils.composeHint("wordpress:tag")
|
|
22
|
-
});
|
|
23
|
-
const authorMatch = pathname.match(authorRegex);
|
|
24
|
-
if (authorMatch?.[1]) uris.push({
|
|
25
|
-
uri: [`${origin}/author/${authorMatch[1]}/feed/`, `${origin}/author/${authorMatch[1]}/?feed=rss`],
|
|
26
|
-
hint: require_utils.composeHint("wordpress:author")
|
|
27
|
-
});
|
|
28
|
-
uris.push({
|
|
29
|
-
uri: [`${origin}/feed/`, `${origin}/?feed=rss`],
|
|
30
|
-
hint: require_utils.composeHint("wordpress:posts-rss2")
|
|
31
|
-
});
|
|
32
|
-
uris.push({
|
|
33
|
-
uri: [`${origin}/feed/rss2/`, `${origin}/?feed=rss2`],
|
|
34
|
-
hint: require_utils.composeHint("wordpress:posts-rss2-alt")
|
|
35
|
-
});
|
|
36
|
-
uris.push({
|
|
37
|
-
uri: [`${origin}/feed/rdf/`, `${origin}/?feed=rdf`],
|
|
38
|
-
hint: require_utils.composeHint("wordpress:posts-rdf")
|
|
39
|
-
});
|
|
40
|
-
uris.push({
|
|
41
|
-
uri: [`${origin}/feed/atom/`, `${origin}/?feed=atom`],
|
|
42
|
-
hint: require_utils.composeHint("wordpress:posts-atom")
|
|
43
|
-
});
|
|
44
|
-
uris.push({
|
|
45
|
-
uri: [`${origin}/comments/feed/`, `${origin}/?feed=comments-rss2`],
|
|
46
|
-
hint: require_utils.composeHint("wordpress:comments")
|
|
47
|
-
});
|
|
48
|
-
uris.push({
|
|
49
|
-
uri: [`${origin}/comments/feed/rss2/`, `${origin}/?feed=comments-rss2`],
|
|
50
|
-
hint: require_utils.composeHint("wordpress:comments-rss2")
|
|
51
|
-
});
|
|
52
|
-
uris.push({
|
|
53
|
-
uri: [`${origin}/comments/feed/rdf/`, `${origin}/?feed=comments-rdf`],
|
|
54
|
-
hint: require_utils.composeHint("wordpress:comments-rdf")
|
|
55
|
-
});
|
|
56
|
-
uris.push({
|
|
57
|
-
uri: [`${origin}/comments/feed/atom/`, `${origin}/?feed=comments-atom`],
|
|
58
|
-
hint: require_utils.composeHint("wordpress:comments-atom")
|
|
59
|
-
});
|
|
60
|
-
return uris;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
//#endregion
|
|
64
|
-
exports.wordpressHandler = wordpressHandler;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/wpengine.ts
|
|
3
|
-
const wpengineHandler = {
|
|
4
|
-
match: (url) => {
|
|
5
|
-
return require_utils.isSubdomainOf(url, ["wpenginepowered.com", "wpengine.com"]);
|
|
6
|
-
},
|
|
7
|
-
resolve: require("./wordpress.cjs").wordpressHandler.resolve
|
|
8
|
-
};
|
|
9
|
-
//#endregion
|
|
10
|
-
exports.wpengineHandler = wpengineHandler;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/ximalaya.ts
|
|
3
|
-
const albumRegex = /^\/album\/(\d+)/;
|
|
4
|
-
const hosts = ["www.ximalaya.com", "ximalaya.com"];
|
|
5
|
-
const ximalayaHandler = {
|
|
6
|
-
match: (url) => {
|
|
7
|
-
return require_utils.isHostOf(url, hosts);
|
|
8
|
-
},
|
|
9
|
-
resolve: (url) => {
|
|
10
|
-
const { pathname } = new URL(url);
|
|
11
|
-
const id = pathname.match(albumRegex)?.[1];
|
|
12
|
-
if (!id) return [];
|
|
13
|
-
return [{
|
|
14
|
-
uri: `https://www.ximalaya.com/album/${id}.xml`,
|
|
15
|
-
hint: require_utils.composeHint("ximalaya:album")
|
|
16
|
-
}];
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
//#endregion
|
|
20
|
-
exports.ximalayaHandler = ximalayaHandler;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../../common/utils.cjs");
|
|
2
|
-
//#region src/feeds/platform/handlers/youtube.ts
|
|
3
|
-
const channelIdRegex = /"(?:channelId|externalId)":"(UC[a-zA-Z0-9_-]+)"/;
|
|
4
|
-
const channelRegex = /^\/channel\/(UC[a-zA-Z0-9_-]+)/;
|
|
5
|
-
const handleRegex = /^\/@([^/]+)/;
|
|
6
|
-
const userRegex = /^\/user\/([^/]+)/;
|
|
7
|
-
const customRegex = /^\/c\/([^/]+)/;
|
|
8
|
-
const channelPrefixRegex = /^UC/;
|
|
9
|
-
const hosts = [
|
|
10
|
-
"youtube.com",
|
|
11
|
-
"www.youtube.com",
|
|
12
|
-
"m.youtube.com",
|
|
13
|
-
"youtu.be",
|
|
14
|
-
"www.youtu.be"
|
|
15
|
-
];
|
|
16
|
-
const extractChannelIdFromContent = (content) => {
|
|
17
|
-
return content.match(channelIdRegex)?.[1];
|
|
18
|
-
};
|
|
19
|
-
const playlistPrefix = (prefix, channelId) => {
|
|
20
|
-
return channelId.replace(channelPrefixRegex, prefix);
|
|
21
|
-
};
|
|
22
|
-
const feedUrl = (param, value) => {
|
|
23
|
-
return `https://www.youtube.com/feeds/videos.xml?${param}=${value}`;
|
|
24
|
-
};
|
|
25
|
-
const pushChannelUris = (uris, channelId) => {
|
|
26
|
-
uris.push({
|
|
27
|
-
uri: [feedUrl("channel_id", channelId), feedUrl("playlist_id", playlistPrefix("UU", channelId))],
|
|
28
|
-
hint: require_utils.composeHint("youtube:all")
|
|
29
|
-
});
|
|
30
|
-
uris.push({
|
|
31
|
-
uri: feedUrl("playlist_id", playlistPrefix("UULF", channelId)),
|
|
32
|
-
hint: require_utils.composeHint("youtube:videos")
|
|
33
|
-
});
|
|
34
|
-
uris.push({
|
|
35
|
-
uri: feedUrl("playlist_id", playlistPrefix("UUSH", channelId)),
|
|
36
|
-
hint: require_utils.composeHint("youtube:shorts")
|
|
37
|
-
});
|
|
38
|
-
uris.push({
|
|
39
|
-
uri: feedUrl("playlist_id", playlistPrefix("UULV", channelId)),
|
|
40
|
-
hint: require_utils.composeHint("youtube:live")
|
|
41
|
-
});
|
|
42
|
-
uris.push({
|
|
43
|
-
uri: feedUrl("playlist_id", playlistPrefix("UULP", channelId)),
|
|
44
|
-
hint: require_utils.composeHint("youtube:popular-videos")
|
|
45
|
-
});
|
|
46
|
-
uris.push({
|
|
47
|
-
uri: feedUrl("playlist_id", playlistPrefix("UUPS", channelId)),
|
|
48
|
-
hint: require_utils.composeHint("youtube:popular-shorts")
|
|
49
|
-
});
|
|
50
|
-
uris.push({
|
|
51
|
-
uri: feedUrl("playlist_id", playlistPrefix("UUPV", channelId)),
|
|
52
|
-
hint: require_utils.composeHint("youtube:popular-live")
|
|
53
|
-
});
|
|
54
|
-
uris.push({
|
|
55
|
-
uri: feedUrl("playlist_id", playlistPrefix("UUMO", channelId)),
|
|
56
|
-
hint: require_utils.composeHint("youtube:member-videos")
|
|
57
|
-
});
|
|
58
|
-
uris.push({
|
|
59
|
-
uri: feedUrl("playlist_id", playlistPrefix("UUMS", channelId)),
|
|
60
|
-
hint: require_utils.composeHint("youtube:member-shorts")
|
|
61
|
-
});
|
|
62
|
-
uris.push({
|
|
63
|
-
uri: feedUrl("playlist_id", playlistPrefix("UUMV", channelId)),
|
|
64
|
-
hint: require_utils.composeHint("youtube:member-live")
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
const youtubeHandler = {
|
|
68
|
-
match: (url) => {
|
|
69
|
-
return require_utils.isHostOf(url, hosts);
|
|
70
|
-
},
|
|
71
|
-
resolve: (url, content) => {
|
|
72
|
-
const parsedUrl = new URL(url);
|
|
73
|
-
const uris = [];
|
|
74
|
-
const channelMatch = parsedUrl.pathname.match(channelRegex);
|
|
75
|
-
if (channelMatch?.[1]) {
|
|
76
|
-
const channelId = channelMatch[1];
|
|
77
|
-
pushChannelUris(uris, channelId);
|
|
78
|
-
}
|
|
79
|
-
const playlistId = parsedUrl.searchParams.get("list");
|
|
80
|
-
if (playlistId) uris.push({
|
|
81
|
-
uri: feedUrl("playlist_id", playlistId),
|
|
82
|
-
hint: require_utils.composeHint("youtube:playlist")
|
|
83
|
-
});
|
|
84
|
-
if (uris.length === 0 && content) {
|
|
85
|
-
if (parsedUrl.searchParams.has("v") || parsedUrl.hostname.includes("youtu.be") && parsedUrl.pathname.length > 1 || parsedUrl.pathname.match(handleRegex) || parsedUrl.pathname.match(userRegex) || parsedUrl.pathname.match(customRegex)) {
|
|
86
|
-
const channelId = extractChannelIdFromContent(content);
|
|
87
|
-
if (channelId) pushChannelUris(uris, channelId);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return uris;
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
//#endregion
|
|
94
|
-
exports.youtubeHandler = youtubeHandler;
|
package/dist/feeds/types.d.cts
DELETED
package/dist/feeds.cjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_defaults = require("./feeds/defaults.cjs");
|
|
3
|
-
const require_extractors = require("./feeds/extractors.cjs");
|
|
4
|
-
exports.anchorLabels = require_defaults.anchorLabels;
|
|
5
|
-
exports.defaultExtractor = require_extractors.defaultExtractor;
|
|
6
|
-
exports.defaultGuessOptions = require_defaults.defaultGuessOptions;
|
|
7
|
-
exports.defaultHeadersOptions = require_defaults.defaultHeadersOptions;
|
|
8
|
-
exports.defaultHtmlOptions = require_defaults.defaultHtmlOptions;
|
|
9
|
-
exports.defaultPlatformOptions = require_defaults.defaultPlatformOptions;
|
|
10
|
-
exports.ignoredUris = require_defaults.ignoredUris;
|
|
11
|
-
exports.linkSelectors = require_defaults.linkSelectors;
|
|
12
|
-
exports.mimeTypes = require_defaults.mimeTypes;
|
|
13
|
-
exports.urisBalanced = require_defaults.urisBalanced;
|
|
14
|
-
exports.urisComprehensive = require_defaults.urisComprehensive;
|
|
15
|
-
exports.urisMinimal = require_defaults.urisMinimal;
|
package/dist/feeds.d.cts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { anchorLabels, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal } from "./feeds/defaults.cjs";
|
|
2
|
-
import { FeedResult } from "./feeds/types.cjs";
|
|
3
|
-
import { defaultExtractor } from "./feeds/extractors.cjs";
|
|
4
|
-
export { FeedResult, anchorLabels, defaultExtractor, defaultGuessOptions, defaultHeadersOptions, defaultHtmlOptions, defaultPlatformOptions, ignoredUris, linkSelectors, mimeTypes, urisBalanced, urisComprehensive, urisMinimal };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../common/utils.cjs");
|
|
2
|
-
const require_utils$1 = require("../../common/discover/utils.cjs");
|
|
3
|
-
const require_index = require("../feed/index.cjs");
|
|
4
|
-
const require_index$1 = require("../headers/index.cjs");
|
|
5
|
-
const require_index$2 = require("../html/index.cjs");
|
|
6
|
-
//#region src/hubs/discover/index.ts
|
|
7
|
-
const discoverHubs = async (input, options = {}) => {
|
|
8
|
-
const { methods = [
|
|
9
|
-
"headers",
|
|
10
|
-
"feed",
|
|
11
|
-
"html"
|
|
12
|
-
], fetchFn = require_utils$1.defaultFetchFn, resolveUrlFn = require_utils.resolveUrl } = options;
|
|
13
|
-
const normalizedInput = await require_utils$1.normalizeInput(input, fetchFn);
|
|
14
|
-
const results = [];
|
|
15
|
-
if (methods.includes("headers") && normalizedInput.headers) {
|
|
16
|
-
const headerHubs = require_index$1.discoverHubsFromHeaders(normalizedInput.headers, normalizedInput.url, resolveUrlFn);
|
|
17
|
-
results.push(...headerHubs);
|
|
18
|
-
}
|
|
19
|
-
if (methods.includes("feed") && normalizedInput.content) {
|
|
20
|
-
const feedHubs = require_index.discoverHubsFromFeed(normalizedInput.content, normalizedInput.url, resolveUrlFn);
|
|
21
|
-
results.push(...feedHubs);
|
|
22
|
-
}
|
|
23
|
-
if (methods.includes("html") && normalizedInput.content) {
|
|
24
|
-
const htmlHubs = require_index$2.discoverHubsFromHtml(normalizedInput.content, normalizedInput.url, resolveUrlFn);
|
|
25
|
-
results.push(...htmlHubs);
|
|
26
|
-
}
|
|
27
|
-
return results;
|
|
28
|
-
};
|
|
29
|
-
//#endregion
|
|
30
|
-
exports.discoverHubs = discoverHubs;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DiscoverInput } from "../../common/types.cjs";
|
|
2
|
-
import { DiscoverHubsOptions, HubResult } from "./types.cjs";
|
|
3
|
-
|
|
4
|
-
//#region src/hubs/discover/index.d.ts
|
|
5
|
-
declare const discoverHubs: (input: DiscoverInput, options?: DiscoverHubsOptions) => Promise<Array<HubResult>>;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { discoverHubs };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DiscoverFetchFn, DiscoverResolveUrlFn } from "../../common/types.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/hubs/discover/types.d.ts
|
|
4
|
-
type HubResult = {
|
|
5
|
-
hub: string;
|
|
6
|
-
topic: string;
|
|
7
|
-
};
|
|
8
|
-
type DiscoverHubsMethodsConfig = Array<'headers' | 'html' | 'feed'>;
|
|
9
|
-
type DiscoverHubsOptions = {
|
|
10
|
-
methods?: DiscoverHubsMethodsConfig;
|
|
11
|
-
fetchFn?: DiscoverFetchFn;
|
|
12
|
-
resolveUrlFn?: DiscoverResolveUrlFn;
|
|
13
|
-
};
|
|
14
|
-
//#endregion
|
|
15
|
-
export { DiscoverHubsMethodsConfig, DiscoverHubsOptions, HubResult };
|
package/dist/hubs/feed/index.cjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../common/utils.cjs");
|
|
2
|
-
let feedsmith = require("feedsmith");
|
|
3
|
-
//#region src/hubs/feed/index.ts
|
|
4
|
-
const getLinksWithRel = (links, rel) => {
|
|
5
|
-
return links?.filter((link) => link.rel === rel && link.href).map((link) => link.href) ?? [];
|
|
6
|
-
};
|
|
7
|
-
const discoverHubsFromFeed = (content, baseUrl, resolveUrlFn = require_utils.resolveUrl) => {
|
|
8
|
-
try {
|
|
9
|
-
const { format, feed } = (0, feedsmith.parseFeed)(content);
|
|
10
|
-
if (format === "json") {
|
|
11
|
-
const hubs = feed.hubs ?? [];
|
|
12
|
-
const topic = feed.feed_url ? resolveUrlFn(feed.feed_url, baseUrl) ?? feed.feed_url : baseUrl;
|
|
13
|
-
return hubs.filter((hub) => hub.url).map((hub) => ({
|
|
14
|
-
hub: resolveUrlFn(hub.url, baseUrl) ?? hub.url,
|
|
15
|
-
topic
|
|
16
|
-
}));
|
|
17
|
-
}
|
|
18
|
-
const links = format === "atom" ? feed.links : feed.atom?.links;
|
|
19
|
-
const hubUris = getLinksWithRel(links, "hub");
|
|
20
|
-
if (hubUris.length > 0) {
|
|
21
|
-
const selfUris = getLinksWithRel(links, "self");
|
|
22
|
-
const topic = selfUris[0] ? resolveUrlFn(selfUris[0], baseUrl) ?? selfUris[0] : baseUrl;
|
|
23
|
-
return hubUris.map((hub) => ({
|
|
24
|
-
hub: resolveUrlFn(hub, baseUrl) ?? hub,
|
|
25
|
-
topic
|
|
26
|
-
}));
|
|
27
|
-
}
|
|
28
|
-
} catch {}
|
|
29
|
-
return [];
|
|
30
|
-
};
|
|
31
|
-
//#endregion
|
|
32
|
-
exports.discoverHubsFromFeed = discoverHubsFromFeed;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../common/utils.cjs");
|
|
2
|
-
const require_index = require("../../common/uris/headers/index.cjs");
|
|
3
|
-
//#region src/hubs/headers/index.ts
|
|
4
|
-
const hubSelector = [{ rel: "hub" }];
|
|
5
|
-
const selfSelector = [{ rel: "self" }];
|
|
6
|
-
const discoverHubsFromHeaders = (headers, baseUrl, resolveUrlFn = require_utils.resolveUrl) => {
|
|
7
|
-
const hubUris = require_index.discoverUrisFromHeaders(headers, { linkSelectors: hubSelector });
|
|
8
|
-
if (hubUris.length === 0) return [];
|
|
9
|
-
const selfUris = require_index.discoverUrisFromHeaders(headers, { linkSelectors: selfSelector });
|
|
10
|
-
const topic = selfUris[0] ? resolveUrlFn(selfUris[0], baseUrl) ?? selfUris[0] : baseUrl;
|
|
11
|
-
return hubUris.map((hub) => ({
|
|
12
|
-
hub: resolveUrlFn(hub, baseUrl) ?? hub,
|
|
13
|
-
topic
|
|
14
|
-
}));
|
|
15
|
-
};
|
|
16
|
-
//#endregion
|
|
17
|
-
exports.discoverHubsFromHeaders = discoverHubsFromHeaders;
|
package/dist/hubs/html/index.cjs
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const require_utils = require("../../common/utils.cjs");
|
|
2
|
-
const require_index = require("../../common/uris/html/index.cjs");
|
|
3
|
-
//#region src/hubs/html/index.ts
|
|
4
|
-
const hubSelector = [{ rel: "hub" }];
|
|
5
|
-
const selfSelector = [{ rel: "self" }];
|
|
6
|
-
const htmlOptions = {
|
|
7
|
-
anchorUris: [],
|
|
8
|
-
anchorIgnoredUris: [],
|
|
9
|
-
anchorLabels: []
|
|
10
|
-
};
|
|
11
|
-
const discoverHubsFromHtml = (content, baseUrl, resolveUrlFn = require_utils.resolveUrl) => {
|
|
12
|
-
const hubUris = require_index.discoverUrisFromHtml(content, {
|
|
13
|
-
...htmlOptions,
|
|
14
|
-
linkSelectors: hubSelector
|
|
15
|
-
});
|
|
16
|
-
if (hubUris.length === 0) return [];
|
|
17
|
-
const selfUris = require_index.discoverUrisFromHtml(content, {
|
|
18
|
-
...htmlOptions,
|
|
19
|
-
linkSelectors: selfSelector
|
|
20
|
-
});
|
|
21
|
-
const topic = selfUris[0] ? resolveUrlFn(selfUris[0], baseUrl) ?? selfUris[0] : baseUrl;
|
|
22
|
-
return hubUris.map((hub) => ({
|
|
23
|
-
hub: resolveUrlFn(hub, baseUrl) ?? hub,
|
|
24
|
-
topic
|
|
25
|
-
}));
|
|
26
|
-
};
|
|
27
|
-
//#endregion
|
|
28
|
-
exports.discoverHubsFromHtml = discoverHubsFromHtml;
|
package/dist/hubs.cjs
DELETED
|
File without changes
|
package/dist/hubs.d.cts
DELETED
package/dist/index.cjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_utils = require("./common/discover/utils.cjs");
|
|
3
|
-
const require_index = require("./blogrolls/index.cjs");
|
|
4
|
-
const require_index$1 = require("./favicons/index.cjs");
|
|
5
|
-
const require_index$2 = require("./feeds/index.cjs");
|
|
6
|
-
const require_index$3 = require("./hubs/discover/index.cjs");
|
|
7
|
-
exports.defaultResolveSiteUrlFn = require_utils.defaultResolveSiteUrlFn;
|
|
8
|
-
exports.discoverBlogrolls = require_index.discoverBlogrolls;
|
|
9
|
-
exports.discoverFavicons = require_index$1.discoverFavicons;
|
|
10
|
-
exports.discoverFeeds = require_index$2.discoverFeeds;
|
|
11
|
-
exports.discoverHubs = require_index$3.discoverHubs;
|
|
12
|
-
exports.getFeedSiteUrl = require_utils.getFeedSiteUrl;
|
package/dist/index.d.cts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DiscoverExtractFn, DiscoverFetchFn, DiscoverFetchFnOptions, DiscoverFetchFnResponse, DiscoverInput, DiscoverInputObject, DiscoverMethod, DiscoverMethodsConfig, DiscoverOnProgressFn, DiscoverOptions, DiscoverProgress, DiscoverResolveSiteUrlFn, DiscoverResolveUrlFn, DiscoverResult, DiscoverUriEntry, DiscoverUriHint, UriEntry } from "./common/types.cjs";
|
|
2
|
-
import { discoverBlogrolls } from "./blogrolls/index.cjs";
|
|
3
|
-
import { defaultResolveSiteUrlFn, getFeedSiteUrl } from "./common/discover/utils.cjs";
|
|
4
|
-
import { discoverFavicons } from "./favicons/index.cjs";
|
|
5
|
-
import { discoverFeeds } from "./feeds/index.cjs";
|
|
6
|
-
import { discoverHubs } from "./hubs/discover/index.cjs";
|
|
7
|
-
export { type DiscoverExtractFn, type DiscoverFetchFn, type DiscoverFetchFnOptions, type DiscoverFetchFnResponse, type DiscoverInput, type DiscoverInputObject, type DiscoverMethod, type DiscoverMethodsConfig, type DiscoverOnProgressFn, type DiscoverOptions, type DiscoverProgress, type DiscoverResolveSiteUrlFn, type DiscoverResolveUrlFn, type DiscoverResult, type DiscoverUriEntry, type DiscoverUriHint, type UriEntry, defaultResolveSiteUrlFn, discoverBlogrolls, discoverFavicons, discoverFeeds, discoverHubs, getFeedSiteUrl };
|
package/dist/methods.cjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_index = require("./common/uris/feed/index.cjs");
|
|
3
|
-
const require_utils = require("./common/uris/guess/utils.cjs");
|
|
4
|
-
const require_index$1 = require("./common/uris/guess/index.cjs");
|
|
5
|
-
const require_index$2 = require("./common/uris/headers/index.cjs");
|
|
6
|
-
const require_index$3 = require("./common/uris/html/index.cjs");
|
|
7
|
-
const require_index$4 = require("./common/uris/platform/index.cjs");
|
|
8
|
-
exports.discoverUrisFromFeed = require_index.discoverUrisFromFeed;
|
|
9
|
-
exports.discoverUrisFromGuess = require_index$1.discoverUrisFromGuess;
|
|
10
|
-
exports.discoverUrisFromHeaders = require_index$2.discoverUrisFromHeaders;
|
|
11
|
-
exports.discoverUrisFromHtml = require_index$3.discoverUrisFromHtml;
|
|
12
|
-
exports.discoverUrisFromPlatform = require_index$4.discoverUrisFromPlatform;
|
|
13
|
-
exports.generateUrlCombinations = require_utils.generateUrlCombinations;
|
|
14
|
-
exports.getSubdomainVariants = require_utils.getSubdomainVariants;
|
|
15
|
-
exports.getWwwCounterpart = require_utils.getWwwCounterpart;
|
package/dist/methods.d.cts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { discoverUrisFromFeed } from "./common/uris/feed/index.cjs";
|
|
2
|
-
import { discoverUrisFromGuess } from "./common/uris/guess/index.cjs";
|
|
3
|
-
import { generateUrlCombinations, getSubdomainVariants, getWwwCounterpart } from "./common/uris/guess/utils.cjs";
|
|
4
|
-
import { discoverUrisFromHeaders } from "./common/uris/headers/index.cjs";
|
|
5
|
-
import { discoverUrisFromHtml } from "./common/uris/html/index.cjs";
|
|
6
|
-
import { discoverUrisFromPlatform } from "./common/uris/platform/index.cjs";
|
|
7
|
-
export { discoverUrisFromFeed, discoverUrisFromGuess, discoverUrisFromHeaders, discoverUrisFromHtml, discoverUrisFromPlatform, generateUrlCombinations, getSubdomainVariants, getWwwCounterpart };
|
package/dist/utils.cjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_utils = require("./common/utils.cjs");
|
|
3
|
-
exports.anyWordMatchesAnyOf = require_utils.anyWordMatchesAnyOf;
|
|
4
|
-
exports.endsWithAnyOf = require_utils.endsWithAnyOf;
|
|
5
|
-
exports.includesAnyOf = require_utils.includesAnyOf;
|
|
6
|
-
exports.isAnyOf = require_utils.isAnyOf;
|
|
7
|
-
exports.isHostOf = require_utils.isHostOf;
|
|
8
|
-
exports.isSubdomainOf = require_utils.isSubdomainOf;
|
|
9
|
-
exports.omitEmpty = require_utils.omitEmpty;
|
package/dist/utils.d.cts
DELETED