rsshub 1.0.0-master.ff3a9ce → 1.0.0-master.ff3ea5a
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 +38 -0
- package/lib/errors/index.tsx +3 -2
- package/lib/middleware/debug.ts +6 -4
- package/lib/middleware/header.ts +4 -2
- package/lib/registry.test.ts +24 -1
- package/lib/registry.ts +40 -11
- package/lib/router.js +1 -1
- package/lib/routes/121/namespace.ts +9 -0
- package/lib/routes/121/templates/description.art +17 -0
- package/lib/routes/121/weather-live.ts +104 -0
- package/lib/routes/141jav/index.ts +3 -0
- package/lib/routes/141ppv/index.ts +3 -0
- package/lib/routes/163/news/rank.ts +1 -1
- package/lib/routes/18comic/album.ts +59 -64
- package/lib/routes/18comic/index.ts +1 -0
- package/lib/routes/18comic/search.ts +53 -4
- package/lib/routes/18comic/utils.ts +70 -1
- package/lib/routes/2048/index.ts +1 -0
- package/lib/routes/30secondsofcode/utils.ts +0 -1
- package/lib/routes/6park/index.ts +1 -1
- package/lib/routes/7mmtv/index.ts +1 -0
- package/lib/routes/91porn/index.ts +1 -0
- package/lib/routes/95mm/tab.ts +1 -0
- package/lib/routes/agefans/detail.ts +1 -1
- package/lib/routes/aliyun/database-month.ts +1 -1
- package/lib/routes/anthropic/research.ts +112 -0
- package/lib/routes/apnews/topics.ts +2 -1
- package/lib/routes/apnews/utils.ts +1 -1
- package/lib/routes/apple/design.ts +54 -0
- package/lib/routes/apple/namespace.ts +1 -1
- package/lib/routes/aqara/post.ts +1 -1
- package/lib/routes/augmentcode/blog.ts +161 -0
- package/lib/routes/augmentcode/namespace.ts +9 -0
- package/lib/routes/augmentcode/templates/description.art +17 -0
- package/lib/routes/azul/namespace.ts +9 -0
- package/lib/routes/azul/packages.ts +105 -0
- package/lib/routes/banshujiang/index.ts +763 -0
- package/lib/routes/banshujiang/namespace.ts +9 -0
- package/lib/routes/banshujiang/templates/description.art +17 -0
- package/lib/routes/bfl/announcements.ts +1 -1
- package/lib/routes/bilibili/cache.ts +78 -0
- package/lib/routes/bilibili/danmaku.ts +1 -1
- package/lib/routes/bilibili/dynamic.ts +8 -2
- package/lib/routes/bilibili/video.ts +31 -73
- package/lib/routes/biquge/index.ts +1 -1
- package/lib/routes/bsky/keyword.ts +15 -10
- package/lib/routes/capitalmind/insights.ts +40 -0
- package/lib/routes/capitalmind/namespace.ts +8 -0
- package/lib/routes/capitalmind/podcasts.ts +41 -0
- package/lib/routes/capitalmind/utils.ts +122 -0
- package/lib/routes/cartoonmad/comic.ts +1 -1
- package/lib/routes/chikubi/index.ts +1 -0
- package/lib/routes/chikubi/tag.ts +1 -0
- package/lib/routes/chocolatey/namespace.ts +9 -0
- package/lib/routes/chocolatey/packages.ts +122 -0
- package/lib/routes/cmde/index.ts +1 -1
- package/lib/routes/cockroachlabs/blog.ts +113 -0
- package/lib/routes/cockroachlabs/namespace.ts +7 -0
- package/lib/routes/cool18/index.ts +4 -1
- package/lib/routes/coomer/index.ts +12 -6
- package/lib/routes/coomer/namespace.ts +1 -1
- package/lib/routes/copymanga/comic.ts +7 -9
- package/lib/routes/css-tricks/articles.ts +48 -0
- package/lib/routes/css-tricks/collections.ts +62 -0
- package/lib/routes/css-tricks/namespace.ts +8 -0
- package/lib/routes/css-tricks/popular.ts +39 -0
- package/lib/routes/css-tricks/utils.ts +103 -0
- package/lib/routes/cursor/changelog.ts +26 -17
- package/lib/routes/cursor/namespace.ts +1 -1
- package/lib/routes/cw/utils.ts +6 -13
- package/lib/routes/dealstreetasia/home.ts +1 -1
- package/lib/routes/dedao/index.ts +3 -3
- package/lib/routes/deepl/blog.ts +422 -0
- package/lib/routes/deepl/namespace.ts +9 -0
- package/lib/routes/deepl/templates/description.art +21 -0
- package/lib/routes/deeplearning/the-batch.ts +1 -1
- package/lib/routes/dev.to/guides.ts +100 -0
- package/lib/routes/dev.to/namespace.ts +8 -0
- package/lib/routes/dev.to/top.ts +105 -0
- package/lib/routes/dgut/jwb.ts +73 -0
- package/lib/routes/dgut/namespace.ts +9 -0
- package/lib/routes/digitalpolicyalert/activity-tracker.ts +135 -0
- package/lib/routes/digitalpolicyalert/namespace.ts +9 -0
- package/lib/routes/dnaindia/common.ts +26 -8
- package/lib/routes/douban/other/list.ts +3 -3
- package/lib/routes/e-hentai/index.ts +4 -1
- package/lib/routes/ehentai/tag.ts +1 -0
- package/lib/routes/englishhome/index.ts +55 -0
- package/lib/routes/englishhome/namespace.ts +6 -0
- package/lib/routes/epicgames/index.ts +2 -2
- package/lib/routes/espn/news.ts +1 -1
- package/lib/routes/expats/czech-news.ts +272 -0
- package/lib/routes/expats/namespace.ts +9 -0
- package/lib/routes/fanbox/index.ts +1 -0
- package/lib/routes/fanbox/utils.ts +1 -1
- package/lib/routes/fansly/tag.ts +1 -0
- package/lib/routes/fantia/search.ts +1 -1
- package/lib/routes/fantube/creator.ts +69 -0
- package/lib/routes/fantube/namespace.ts +7 -0
- package/lib/routes/fantube/templates/post.art +17 -0
- package/lib/routes/fantube/types.ts +100 -0
- package/lib/routes/fantube/utils.ts +268 -0
- package/lib/routes/follow/profile.ts +1 -1
- package/lib/routes/followin/news.ts +1 -1
- package/lib/routes/foresightnews/util.ts +1 -1
- package/lib/routes/freexcomic/book.ts +4 -1
- package/lib/routes/gamer/hot.ts +5 -5
- package/lib/routes/gaoyu/blog.ts +145 -0
- package/lib/routes/gaoyu/namespace.ts +9 -0
- package/lib/routes/gaoyu/templates/description.art +7 -0
- package/lib/routes/geocaching/blogs.ts +2 -2
- package/lib/routes/github/namespace.ts +1 -1
- package/lib/routes/github/private-feed.ts +229 -0
- package/lib/routes/github/star.ts +1 -1
- package/lib/routes/google/extension.ts +9 -10
- package/lib/routes/gov/beijing/bphc/index.ts +1 -1
- package/lib/routes/gov/ccdi/index.ts +1 -1
- package/lib/routes/gov/chongqing/sydwgkzp.ts +22 -6
- package/lib/routes/gov/customs/list.ts +1 -1
- package/lib/routes/gov/general/general.ts +1 -1
- package/lib/routes/gov/hangzhou/zwfw.ts +1 -1
- package/lib/routes/gov/pbc/goutongjiaoliu.ts +1 -1
- package/lib/routes/gov/shenzhen/szlh/index.ts +77 -0
- package/lib/routes/gov/shenzhen/szlh/namespace.ts +8 -0
- package/lib/routes/grist/utils.ts +5 -4
- package/lib/routes/hanime1/search.ts +4 -2
- package/lib/routes/hellogithub/report.ts +1 -1
- package/lib/routes/hit/hitgs.ts +240 -54
- package/lib/routes/hit/templates/description.art +7 -0
- package/lib/routes/hlju/namespace.ts +8 -0
- package/lib/routes/hlju/news.ts +141 -0
- package/lib/routes/hostmonit/cloudflareyes.ts +1 -1
- package/lib/routes/hotukdeals/index.ts +1 -1
- package/lib/routes/hyperdash/namespace.ts +7 -0
- package/lib/routes/hyperdash/templates/description.art +34 -0
- package/lib/routes/hyperdash/top-traders.ts +84 -0
- package/lib/routes/hyperdash/utils.ts +49 -0
- package/lib/routes/hypergryph/arknights/announce.ts +1 -1
- package/lib/routes/ielts/index.ts +1 -1
- package/lib/routes/infoq/topic.ts +16 -13
- package/lib/routes/instagram/web-api/index.ts +17 -13
- package/lib/routes/instagram/web-api/utils.ts +46 -63
- package/lib/routes/jamesclear/book-summaries.ts +40 -0
- package/lib/routes/jamesclear/great-speeches.ts +40 -0
- package/lib/routes/jamesclear/namespace.ts +8 -0
- package/lib/routes/jamesclear/quotes.ts +40 -0
- package/lib/routes/jamesclear/three-two-one.ts +41 -0
- package/lib/routes/jamesclear/utils.ts +22 -0
- package/lib/routes/japanpost/utils.ts +2 -2
- package/lib/routes/javbus/index.ts +3 -0
- package/lib/routes/javdb/tags.ts +1 -0
- package/lib/routes/javlibrary/star.ts +1 -0
- package/lib/routes/javtiful/actress.ts +3 -0
- package/lib/routes/javtiful/channel.ts +3 -0
- package/lib/routes/javtrailers/casts.ts +3 -0
- package/lib/routes/jetbrains/comments.ts +99 -0
- package/lib/routes/jetbrains/namespace.ts +8 -0
- package/lib/routes/jimmyspa/books.ts +1 -1
- package/lib/routes/jimmyspa/news.ts +1 -1
- package/lib/routes/jpxgmn/tab.ts +3 -0
- package/lib/routes/kakuyomu/works.ts +3 -0
- package/lib/routes/kaopu/news.ts +1 -1
- package/lib/routes/kemono/const.ts +1 -1
- package/lib/routes/kemono/index.ts +12 -11
- package/lib/routes/kemono/namespace.ts +1 -1
- package/lib/routes/kiro/blog.ts +131 -0
- package/lib/routes/kiro/changelog.ts +128 -0
- package/lib/routes/kiro/namespace.ts +9 -0
- package/lib/routes/konachan/post.ts +3 -0
- package/lib/routes/kovidgoyal/kitty/changelog.ts +83 -0
- package/lib/routes/kovidgoyal/namespace.ts +7 -0
- package/lib/routes/kunchengblog/essay.ts +1 -1
- package/lib/routes/landiannews/category.ts +1 -1
- package/lib/routes/landiannews/index.ts +1 -1
- package/lib/routes/landiannews/tag.ts +1 -1
- package/lib/routes/line/utils.ts +1 -1
- package/lib/routes/lineageos/changes.ts +79 -0
- package/lib/routes/lineageos/namespace.ts +9 -0
- package/lib/routes/linkedin/cn/renderer.ts +1 -1
- package/lib/routes/liquipedia/cs-matches.ts +42 -14
- package/lib/routes/literotica/new.ts +1 -0
- package/lib/routes/lofter/tag.ts +27 -3
- package/lib/routes/makerworld/contest.ts +51 -0
- package/lib/routes/makerworld/namespace.ts +7 -0
- package/lib/routes/makerworld/trending.ts +45 -0
- package/lib/routes/makerworld/user-upload.ts +54 -0
- package/lib/routes/makerworld/utils.ts +18 -0
- package/lib/routes/manhuagui/comic.ts +1 -1
- package/lib/routes/manus/blog.ts +77 -0
- package/lib/routes/manus/namespace.ts +7 -0
- package/lib/routes/mastodon/tag.ts +48 -0
- package/lib/routes/mathpix/blog.ts +155 -0
- package/lib/routes/mathpix/namespace.ts +9 -0
- package/lib/routes/mathpix/templates/description.art +21 -0
- package/lib/routes/mckinsey/cn/category-map.ts +9 -15
- package/lib/routes/mckinsey/cn/index.ts +77 -40
- package/lib/routes/melonbooks/search.ts +1 -0
- package/lib/routes/metacritic/index.ts +2 -2
- package/lib/routes/meteoblue/namespace.ts +8 -0
- package/lib/routes/meteoblue/weathernews.ts +75 -0
- package/lib/routes/meteor/index.ts +1 -1
- package/lib/routes/microsoft/addon.ts +7 -9
- package/lib/routes/mihoyo/zzz/news.ts +106 -0
- package/lib/routes/missav/new.ts +2 -1
- package/lib/routes/mit/hanlab.ts +61 -0
- package/lib/routes/mit/namespace.ts +6 -0
- package/lib/routes/mittrchina/index.ts +3 -3
- package/lib/routes/mixcloud/config.ts +129 -0
- package/lib/routes/mixcloud/index.ts +163 -107
- package/lib/routes/mixcloud/user-playlist.ts +31 -0
- package/lib/routes/mixi2/community.ts +72 -0
- package/lib/routes/mixi2/discovery.ts +52 -0
- package/lib/routes/mixi2/home.ts +51 -0
- package/lib/routes/mixi2/namespace.ts +8 -0
- package/lib/routes/mixi2/user.ts +77 -0
- package/lib/routes/mixi2/utils.ts +56 -0
- package/lib/routes/modelscope/learn.ts +94 -0
- package/lib/routes/moodysmismicrosite/report.ts +1 -1
- package/lib/routes/musify/index.ts +130 -0
- package/lib/routes/musify/namespace.ts +9 -0
- package/lib/routes/musikguru/namespace.ts +9 -0
- package/lib/routes/musikguru/news.ts +146 -0
- package/lib/routes/musikguru/templates/description.art +21 -0
- package/lib/routes/myfans/post.ts +1 -0
- package/lib/routes/nankai/cc-notice.ts +114 -0
- package/lib/routes/nankai/jwc.ts +131 -0
- package/lib/routes/nankai/namespace.ts +7 -0
- package/lib/routes/nankai/notice.ts +84 -0
- package/lib/routes/nankai/yzb.ts +97 -0
- package/lib/routes/neu/yz.ts +172 -0
- package/lib/routes/newslaundry/explainer.ts +30 -0
- package/lib/routes/newslaundry/namespace.ts +8 -0
- package/lib/routes/newslaundry/nl-cheatsheet.ts +30 -0
- package/lib/routes/newslaundry/nl-collaborations.ts +30 -0
- package/lib/routes/newslaundry/podcast.ts +61 -0
- package/lib/routes/newslaundry/reports.ts +30 -0
- package/lib/routes/newslaundry/shot.ts +30 -0
- package/lib/routes/newslaundry/subscriber-only.ts +30 -0
- package/lib/routes/newslaundry/templates/description.art +28 -0
- package/lib/routes/newslaundry/utils.ts +108 -0
- package/lib/routes/newswav/latest.ts +100 -0
- package/lib/routes/newswav/namespace.ts +7 -0
- package/lib/routes/nhentai/index.ts +1 -0
- package/lib/routes/nifd/research.ts +16 -0
- package/lib/routes/nio/namespace.ts +9 -0
- package/lib/routes/nio/nioradio.ts +75 -0
- package/lib/routes/njust/cs.ts +58 -0
- package/lib/routes/njust/utils.ts +1 -1
- package/lib/routes/ntdm/video.ts +1 -1
- package/lib/routes/nuaa/utils/pypasswaf.ts +1 -1
- package/lib/routes/oilchem/index.ts +1 -1
- package/lib/routes/oncc/money18.ts +1 -1
- package/lib/routes/openai/cookbook.ts +1 -1
- package/lib/routes/paulgraham/article.ts +2 -2
- package/lib/routes/picuki/profile.ts +4 -0
- package/lib/routes/pixiv/bookmarks.ts +1 -1
- package/lib/routes/pixiv/novel-api/series/sfw.ts +1 -1
- package/lib/routes/pixiv/novels.ts +2 -2
- package/lib/routes/pixiv/user.ts +1 -1
- package/lib/routes/playno1/av.ts +1 -0
- package/lib/routes/pornhub/model.ts +3 -7
- package/lib/routes/pornhub/pornstar.ts +2 -7
- package/lib/routes/pornhub/users.ts +2 -7
- package/lib/routes/pornhub/utils.ts +12 -1
- package/lib/routes/qingting/podcast.ts +2 -1
- package/lib/routes/qipamaijia/index.ts +1 -0
- package/lib/routes/questmobile/report.ts +1 -1
- package/lib/routes/railway/index.ts +73 -0
- package/lib/routes/railway/namespace.ts +8 -0
- package/lib/routes/reuters/common.ts +0 -3
- package/lib/routes/rockthejvm/articles.ts +167 -0
- package/lib/routes/rockthejvm/namespace.ts +9 -0
- package/lib/routes/rockthejvm/templates/description.art +7 -0
- package/lib/routes/samrdprc/namespace.ts +7 -0
- package/lib/routes/samrdprc/news.ts +79 -0
- package/lib/routes/sankei/namespace.ts +7 -0
- package/lib/routes/sankei/news.ts +68 -0
- package/lib/routes/sankei/topics.ts +71 -0
- package/lib/routes/sciencenet/user.ts +1 -1
- package/lib/routes/scoop/apps.ts +188 -0
- package/lib/routes/scoop/namespace.ts +9 -0
- package/lib/routes/scoop/templates/description.art +56 -0
- package/lib/routes/scpta/namespace.ts +8 -0
- package/lib/routes/scpta/news.ts +101 -0
- package/lib/routes/seekingalpha/index.ts +1 -1
- package/lib/routes/sehuatang/index.ts +29 -31
- package/lib/routes/setn/index.ts +11 -2
- package/lib/routes/seu/cyber/index.ts +78 -0
- package/lib/routes/sicau/jiaowu.ts +42 -34
- package/lib/routes/sis001/forum.ts +1 -0
- package/lib/routes/sjtu/seiee/icisee.ts +67 -0
- package/lib/routes/sketis/isabelle-dev/blog/index.ts +1 -1
- package/lib/routes/smartlink/index.ts +13 -3
- package/lib/routes/sohu/mp.ts +17 -6
- package/lib/routes/sotwe/namespace.ts +1 -0
- package/lib/routes/sotwe/user.ts +98 -0
- package/lib/routes/spankbang/new-videos.ts +1 -0
- package/lib/routes/spglobal/ratings.ts +1 -1
- package/lib/routes/stanford/blog.ts +77 -0
- package/lib/routes/stanford/namespace.ts +7 -0
- package/lib/routes/syosetu/index.ts +1 -1
- package/lib/routes/t66y/index.ts +1 -0
- package/lib/routes/taobao/mysql.ts +157 -0
- package/lib/routes/taobao/namespace.ts +2 -2
- package/lib/routes/techcrunch/category.ts +48 -0
- package/lib/routes/telegram/channel.ts +2 -2
- package/lib/routes/tesla/cx.ts +1 -1
- package/lib/routes/test/index.ts +1 -1
- package/lib/routes/themoviedb/episodes.ts +1 -1
- package/lib/routes/thewirehindi/category.ts +78 -0
- package/lib/routes/thewirehindi/index.ts +43 -0
- package/lib/routes/thewirehindi/namespace.ts +7 -0
- package/lib/routes/thewirehindi/templates/description.art +9 -0
- package/lib/routes/thewirehindi/utils.ts +33 -0
- package/lib/routes/threads/utils.ts +2 -2
- package/lib/routes/tidb/blog.ts +314 -0
- package/lib/routes/tidb/namespace.ts +9 -0
- package/lib/routes/tumblr/namespace.ts +17 -0
- package/lib/routes/tumblr/posts.ts +74 -0
- package/lib/routes/tumblr/utils.ts +110 -0
- package/lib/routes/tver/namespace.ts +7 -0
- package/lib/routes/tver/series.ts +98 -0
- package/lib/routes/twitter/api/web-api/login.ts +1 -3
- package/lib/routes/twitter/api/web-api/utils.ts +23 -1
- package/lib/routes/twitter/utils.ts +21 -21
- package/lib/routes/udn/breaking-news.ts +2 -2
- package/lib/routes/uestc/auto.ts +1 -1
- package/lib/routes/uestc/cqe.ts +1 -1
- package/lib/routes/uestc/scse.ts +1 -1
- package/lib/routes/uestc/sice.ts +1 -1
- package/lib/routes/uestc/sise.ts +1 -1
- package/lib/routes/upc/jwc.ts +32 -46
- package/lib/routes/uptimerobot/rss.ts +1 -1
- package/lib/routes/visionias/daily-news-summary.ts +65 -0
- package/lib/routes/visionias/monthly-magazine.ts +68 -0
- package/lib/routes/visionias/news-today.ts +3 -13
- package/lib/routes/visionias/utils.ts +5 -5
- package/lib/routes/visionias/weekly-focus.ts +2 -2
- package/lib/routes/wdfxw/bookfree.ts +528 -0
- package/lib/routes/wdfxw/namespace.ts +8 -0
- package/lib/routes/wdfxw/templates/description.art +13 -0
- package/lib/routes/whu/swrh.ts +1 -1
- package/lib/routes/windsurf/blog.ts +118 -0
- package/lib/routes/windsurf/changelog.ts +100 -0
- package/lib/routes/windsurf/namespace.ts +9 -0
- package/lib/routes/windsurf/templates/description.art +21 -0
- package/lib/routes/x6d/index.ts +1 -1
- package/lib/routes/xbookcn/blog.ts +1 -0
- package/lib/routes/xiaohongshu/util.ts +1 -3
- package/lib/routes/xiaoyuzhou/pickup.ts +1 -1
- package/lib/routes/ximalaya/album.ts +32 -70
- package/lib/routes/ximalaya/types.ts +48 -0
- package/lib/routes/ximalaya/utils.ts +9 -7
- package/lib/routes/xmanhua/index.ts +1 -0
- package/lib/routes/xueqiu/cookies.ts +1 -1
- package/lib/routes/xueqiu/user.ts +1 -1
- package/lib/routes/xwenming/index.ts +184 -0
- package/lib/routes/xwenming/namespace.ts +9 -0
- package/lib/routes/yahoo/news/utils.ts +1 -1
- package/lib/routes/yande/post.ts +3 -0
- package/lib/routes/ymgal/game.ts +1 -0
- package/lib/routes/youtube/api/google.ts +27 -0
- package/lib/routes/youtube/api/youtubei.ts +70 -20
- package/lib/routes/youtube/community.ts +3 -1
- package/lib/routes/youtube/utils.ts +16 -14
- package/lib/routes/zaobao/util.ts +8 -5
- package/lib/routes/zhihu/activities.ts +3 -0
- package/lib/routes/zhihu/execlib/x-zse-96-v3.ts +5 -5
- package/lib/routes/zhizhuan100/namespace.ts +7 -0
- package/lib/routes/zhizhuan100/report.ts +79 -0
- package/lib/routes/zimuxia/portfolio.ts +1 -1
- package/lib/routes/zju/sis/index.ts +161 -0
- package/lib/server.ts +5 -0
- package/lib/types.ts +58 -54
- package/lib/utils/helpers.ts +1 -1
- package/lib/utils/logger.ts +1 -1
- package/lib/utils/proxy/index.ts +102 -18
- package/lib/utils/proxy/multi-proxy.ts +139 -0
- package/lib/utils/proxy/unify-proxy.ts +3 -1
- package/lib/utils/puppeteer-utils.test.ts +1 -1
- package/lib/utils/puppeteer.test.ts +14 -27
- package/lib/utils/puppeteer.ts +51 -37
- package/lib/utils/readable-social.test.ts +65 -0
- package/lib/utils/readable-social.ts +15 -1
- package/lib/utils/request-rewriter/fetch.ts +42 -4
- package/package.json +54 -56
- package/lib/routes/mixcloud/queries.ts +0 -2274
- package/lib/routes-deprecated/dev.to/top.js +0 -40
package/lib/routes/missav/new.ts
CHANGED
|
@@ -20,6 +20,7 @@ export const route: Route = {
|
|
|
20
20
|
supportBT: false,
|
|
21
21
|
supportPodcast: false,
|
|
22
22
|
supportScihub: false,
|
|
23
|
+
nsfw: true,
|
|
23
24
|
},
|
|
24
25
|
radar: [
|
|
25
26
|
{
|
|
@@ -39,7 +40,7 @@ async function handler() {
|
|
|
39
40
|
const baseUrl = 'https://missav.ws';
|
|
40
41
|
const url = `${baseUrl}/${urlPath}`;
|
|
41
42
|
|
|
42
|
-
const browser = await puppeteer(
|
|
43
|
+
const browser = await puppeteer();
|
|
43
44
|
const page = await browser.newPage();
|
|
44
45
|
await page.setRequestInterception(true);
|
|
45
46
|
page.on('request', (request) => {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Route } from '@/types';
|
|
2
|
+
import got from '@/utils/got';
|
|
3
|
+
import { parseDate } from '@/utils/parse-date';
|
|
4
|
+
import { load } from 'cheerio';
|
|
5
|
+
|
|
6
|
+
export const route: Route = {
|
|
7
|
+
path: '/hanlab/blog',
|
|
8
|
+
categories: ['blog'],
|
|
9
|
+
example: '/mit/hanlab/blog',
|
|
10
|
+
parameters: {},
|
|
11
|
+
features: {
|
|
12
|
+
requireConfig: false,
|
|
13
|
+
requirePuppeteer: false,
|
|
14
|
+
antiCrawler: false,
|
|
15
|
+
supportBT: false,
|
|
16
|
+
supportPodcast: false,
|
|
17
|
+
supportScihub: false,
|
|
18
|
+
},
|
|
19
|
+
radar: [
|
|
20
|
+
{
|
|
21
|
+
source: ['hanlab.mit.edu/blog'],
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
name: 'HAN Lab Blog',
|
|
25
|
+
maintainers: ['johan456789'],
|
|
26
|
+
handler,
|
|
27
|
+
description: 'MIT HAN Lab pioneers research in efficient AI, advancing algorithms and hardware to make generative models faster, smarter, and more accessible.',
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
async function handler() {
|
|
31
|
+
const rootUrl = 'https://hanlab.mit.edu';
|
|
32
|
+
const currentUrl = `${rootUrl}/blog`;
|
|
33
|
+
|
|
34
|
+
const response = await got(currentUrl);
|
|
35
|
+
const $ = load(response.data);
|
|
36
|
+
|
|
37
|
+
const items = $('a.post-card-wrapper')
|
|
38
|
+
.toArray()
|
|
39
|
+
.map((item) => {
|
|
40
|
+
const el = $(item);
|
|
41
|
+
const titleEl = el.find('h3.text-title');
|
|
42
|
+
const title = titleEl.text().trim();
|
|
43
|
+
const link = new URL(el.attr('href') ?? '', rootUrl).href;
|
|
44
|
+
const description = el.find('p.text-tldr').html() ?? undefined;
|
|
45
|
+
const dateText = el.find('div.text-date').text().trim();
|
|
46
|
+
const pubDate = parseDate(dateText);
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
title,
|
|
50
|
+
link,
|
|
51
|
+
description,
|
|
52
|
+
pubDate,
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
title: 'MIT HAN Lab Blog',
|
|
58
|
+
link: currentUrl,
|
|
59
|
+
item: items,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -80,10 +80,10 @@ async function handler(ctx) {
|
|
|
80
80
|
type: article.address.split('.').pop(),
|
|
81
81
|
},
|
|
82
82
|
})
|
|
83
|
-
:
|
|
83
|
+
: type === 'breaking'
|
|
84
84
|
? article.content
|
|
85
|
-
: article.summary
|
|
86
|
-
pubDate: article.start_time ? parseDate(article.start_time, 'X') :
|
|
85
|
+
: article.summary,
|
|
86
|
+
pubDate: article.start_time ? parseDate(article.start_time, 'X') : article.push_time ? parseDate(article.push_time, 'X') : undefined,
|
|
87
87
|
id: article.id,
|
|
88
88
|
link: `https://www.mittrchina.com/news/detail/${article.id}`,
|
|
89
89
|
}));
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
export const MIXCLOUD_CONFIG = {
|
|
2
|
+
host: 'https://www.mixcloud.com',
|
|
3
|
+
imageBaseURL: 'https://thumbnailer.mixcloud.com/unsafe/480x480/',
|
|
4
|
+
graphqlURL: 'https://app.mixcloud.com/graphql',
|
|
5
|
+
decryptionKey: 'IFYOUWANTTHEARTISTSTOGETPAIDDONOTDOWNLOADFROMMIXCLOUD',
|
|
6
|
+
headers: {
|
|
7
|
+
Referer: 'https://www.mixcloud.com',
|
|
8
|
+
'Content-Type': 'application/json',
|
|
9
|
+
'X-Requested-With': 'XMLHttpRequest',
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const TYPE_CONFIG = {
|
|
14
|
+
uploads: 'uploads',
|
|
15
|
+
reposts: 'reposted',
|
|
16
|
+
favorites: 'favorites',
|
|
17
|
+
listens: 'listeningHistory',
|
|
18
|
+
stream: 'stream',
|
|
19
|
+
playlist: 'items',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const TYPE_NAMES = {
|
|
23
|
+
uploads: 'Shows',
|
|
24
|
+
reposts: 'Reposts',
|
|
25
|
+
favorites: 'Favorites',
|
|
26
|
+
listens: 'History',
|
|
27
|
+
stream: 'Stream',
|
|
28
|
+
playlist: 'Playlist',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const CLOUDCAST_FIELDS = `
|
|
32
|
+
id
|
|
33
|
+
slug
|
|
34
|
+
name
|
|
35
|
+
description
|
|
36
|
+
publishDate
|
|
37
|
+
audioLength
|
|
38
|
+
picture(width: 1024, height: 1024) {
|
|
39
|
+
url
|
|
40
|
+
}
|
|
41
|
+
owner {
|
|
42
|
+
displayName
|
|
43
|
+
username
|
|
44
|
+
url
|
|
45
|
+
}
|
|
46
|
+
streamInfo {
|
|
47
|
+
url
|
|
48
|
+
hlsUrl
|
|
49
|
+
dashUrl
|
|
50
|
+
}
|
|
51
|
+
favorites {
|
|
52
|
+
totalCount
|
|
53
|
+
}
|
|
54
|
+
reposts {
|
|
55
|
+
totalCount
|
|
56
|
+
}
|
|
57
|
+
plays
|
|
58
|
+
tags {
|
|
59
|
+
tag {
|
|
60
|
+
name
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
featuringArtistList
|
|
64
|
+
isExclusive
|
|
65
|
+
restrictedReason
|
|
66
|
+
comments(first: 100) {
|
|
67
|
+
edges {
|
|
68
|
+
node {
|
|
69
|
+
comment
|
|
70
|
+
created
|
|
71
|
+
user {
|
|
72
|
+
displayName
|
|
73
|
+
username
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
totalCount
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
export function getObjectFields(type: string): { objectType: string; objectFields: string } {
|
|
82
|
+
if (type === 'playlist') {
|
|
83
|
+
return {
|
|
84
|
+
objectType: 'playlist',
|
|
85
|
+
objectFields: `
|
|
86
|
+
name
|
|
87
|
+
description
|
|
88
|
+
picture {
|
|
89
|
+
urlRoot
|
|
90
|
+
}
|
|
91
|
+
items(first: 100) {
|
|
92
|
+
edges {
|
|
93
|
+
node {
|
|
94
|
+
cloudcast {
|
|
95
|
+
${CLOUDCAST_FIELDS}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
pageInfo {
|
|
100
|
+
endCursor
|
|
101
|
+
hasNextPage
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
`,
|
|
105
|
+
};
|
|
106
|
+
} else {
|
|
107
|
+
const nodeTemplate = type === 'listens' ? `node { cloudcast { ${CLOUDCAST_FIELDS} } }` : `node { ${CLOUDCAST_FIELDS} }`;
|
|
108
|
+
|
|
109
|
+
return {
|
|
110
|
+
objectType: 'user',
|
|
111
|
+
objectFields: `
|
|
112
|
+
displayName
|
|
113
|
+
biog
|
|
114
|
+
picture {
|
|
115
|
+
urlRoot
|
|
116
|
+
}
|
|
117
|
+
${TYPE_CONFIG[type]}(first: 100) {
|
|
118
|
+
edges {
|
|
119
|
+
${nodeTemplate}
|
|
120
|
+
}
|
|
121
|
+
pageInfo {
|
|
122
|
+
endCursor
|
|
123
|
+
hasNextPage
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
`,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -2,14 +2,17 @@ import { Route } from '@/types';
|
|
|
2
2
|
import got from '@/utils/got';
|
|
3
3
|
import CryptoJS from 'crypto-js';
|
|
4
4
|
import { parseDate } from '@/utils/parse-date';
|
|
5
|
-
import { queries } from './queries';
|
|
6
5
|
import InvalidParameterError from '@/errors/types/invalid-parameter';
|
|
6
|
+
import { MIXCLOUD_CONFIG, TYPE_CONFIG, TYPE_NAMES, getObjectFields } from './config';
|
|
7
7
|
|
|
8
8
|
export const route: Route = {
|
|
9
9
|
path: '/:username/:type?',
|
|
10
10
|
categories: ['multimedia'],
|
|
11
11
|
example: '/mixcloud/dholbach/uploads',
|
|
12
|
-
parameters: {
|
|
12
|
+
parameters: {
|
|
13
|
+
username: 'Username, can be found in URL',
|
|
14
|
+
type: 'Type, see below, uploads by default',
|
|
15
|
+
},
|
|
13
16
|
features: {
|
|
14
17
|
requireConfig: false,
|
|
15
18
|
requirePuppeteer: false,
|
|
@@ -34,123 +37,176 @@ export const route: Route = {
|
|
|
34
37
|
| uploads | reposts | favorites | listens | stream |`,
|
|
35
38
|
};
|
|
36
39
|
|
|
37
|
-
async function
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
40
|
+
async function callApi(objectType: string, objectFields: string, username: string, slug?: string) {
|
|
41
|
+
const lookupKey = objectType + 'Lookup';
|
|
42
|
+
const headers = MIXCLOUD_CONFIG.headers;
|
|
43
|
+
|
|
44
|
+
const lookupParams = slug ? `, slug: "${slug}"` : '';
|
|
45
|
+
const query = `{
|
|
46
|
+
${lookupKey}(lookup: {username: "${username}"${lookupParams}}) {
|
|
47
|
+
${objectFields}
|
|
48
|
+
}
|
|
49
|
+
}`;
|
|
50
|
+
|
|
51
|
+
const response = await got({
|
|
52
|
+
method: 'post',
|
|
53
|
+
url: MIXCLOUD_CONFIG.graphqlURL,
|
|
54
|
+
headers,
|
|
55
|
+
json: { query },
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
return response.data.data[lookupKey];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// https://github.com/yt-dlp/yt-dlp/commits/master/yt_dlp/extractor/mixcloud.py
|
|
62
|
+
function decryptXorCipher(key: string, ciphertext: string): string {
|
|
63
|
+
const decoded = CryptoJS.enc.Base64.parse(ciphertext).toString(CryptoJS.enc.Utf8);
|
|
64
|
+
return [...decoded].map((ch, i) => String.fromCodePoint((ch.codePointAt(0) || 0) ^ (key.codePointAt(i % key.length) || 0))).join('');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function tryDecrypt(ciphertext: string | undefined): string {
|
|
68
|
+
if (!ciphertext) {
|
|
69
|
+
return '';
|
|
70
|
+
}
|
|
71
|
+
try {
|
|
72
|
+
return decryptXorCipher(MIXCLOUD_CONFIG.decryptionKey, ciphertext);
|
|
73
|
+
} catch {
|
|
74
|
+
return ciphertext;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function getCloudcast(node: any, type: string): any {
|
|
79
|
+
if (type === 'playlist' || type === 'listens') {
|
|
80
|
+
return node.cloudcast;
|
|
81
|
+
}
|
|
82
|
+
return node;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function getPlaylistTitle(displayName: string, type: string, playlistName?: string): string {
|
|
86
|
+
if (type === 'playlist' && playlistName) {
|
|
87
|
+
return `Mixcloud - ${displayName}'s Playlist: ${playlistName}`;
|
|
88
|
+
}
|
|
89
|
+
return `Mixcloud - ${displayName}'s ${TYPE_NAMES[type] || type}`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function getPlaylistLink(username: string, type: string, playlistSlug?: string): string {
|
|
93
|
+
const host = MIXCLOUD_CONFIG.host;
|
|
94
|
+
if (type === 'playlist' && playlistSlug) {
|
|
95
|
+
return `${host}/${username}/playlists/${playlistSlug}/`;
|
|
96
|
+
}
|
|
97
|
+
return `${host}/${username}/${type === 'uploads' ? '' : type + '/'}`;
|
|
98
|
+
}
|
|
46
99
|
|
|
47
|
-
|
|
100
|
+
export async function handler(ctx) {
|
|
48
101
|
const username = ctx.req.param('username');
|
|
102
|
+
const playlistSlug = ctx.req.param('playlist');
|
|
103
|
+
const type = ctx.req.param('type') ?? (playlistSlug ? 'playlist' : 'uploads');
|
|
49
104
|
|
|
50
|
-
|
|
51
|
-
stream: { name: 'Stream', node: 'stream' },
|
|
52
|
-
uploads: { name: 'Shows', node: 'uploads' },
|
|
53
|
-
reposts: { name: 'Reposts', node: 'reposted' },
|
|
54
|
-
favorites: { name: 'Favorites', node: 'favorites' },
|
|
55
|
-
listens: { name: 'History', node: 'listeningHistory' },
|
|
56
|
-
};
|
|
57
|
-
if (!config[type]) {
|
|
105
|
+
if (!TYPE_CONFIG[type]) {
|
|
58
106
|
throw new InvalidParameterError(`Invalid type: ${type}`);
|
|
59
107
|
}
|
|
60
108
|
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
uploads: {
|
|
71
|
-
query: queries.uploads.query,
|
|
72
|
-
variables: {
|
|
73
|
-
lookup: {
|
|
74
|
-
username: ctx.req.param('username'),
|
|
75
|
-
},
|
|
76
|
-
orderBy: 'LATEST',
|
|
77
|
-
onlyAttributedTo: '',
|
|
78
|
-
hasAttributedTo: false,
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
reposts: {
|
|
82
|
-
query: queries.reposts.query,
|
|
83
|
-
variables: {
|
|
84
|
-
lookup: {
|
|
85
|
-
username: ctx.req.param('username'),
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
favorites: {
|
|
90
|
-
query: queries.favorites.query,
|
|
91
|
-
variables: {
|
|
92
|
-
lookup: {
|
|
93
|
-
username: ctx.req.param('username'),
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
listens: {
|
|
98
|
-
query: queries.listens.query,
|
|
99
|
-
variables: {
|
|
100
|
-
lookup: {
|
|
101
|
-
username: ctx.req.param('username'),
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
};
|
|
109
|
+
const { objectType, objectFields } = getObjectFields(type);
|
|
110
|
+
|
|
111
|
+
const data = await callApi(objectType, objectFields, username, playlistSlug);
|
|
112
|
+
|
|
113
|
+
if (!data) {
|
|
114
|
+
throw new Error(`${type === 'playlist' ? 'Playlist' : 'User'} not found`);
|
|
115
|
+
}
|
|
106
116
|
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
117
|
+
const isPlaylist = type === 'playlist';
|
|
118
|
+
const displayName = isPlaylist ? username : data.displayName;
|
|
119
|
+
const description = isPlaylist ? data.description : data.biog;
|
|
120
|
+
const picture = data.picture;
|
|
121
|
+
const image = picture && picture.urlRoot ? `${MIXCLOUD_CONFIG.imageBaseURL}${picture.urlRoot}` : '';
|
|
122
|
+
|
|
123
|
+
const itemsData = data[TYPE_CONFIG[type]];
|
|
124
|
+
const edges = itemsData?.edges || [];
|
|
125
|
+
|
|
126
|
+
const items = edges
|
|
127
|
+
.map((edge: any) => {
|
|
128
|
+
const cloudcast = getCloudcast(edge.node, type);
|
|
129
|
+
|
|
130
|
+
if (!cloudcast) {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const streamInfo = cloudcast.streamInfo || {};
|
|
135
|
+
const enclosureUrl = tryDecrypt(streamInfo.url);
|
|
136
|
+
const tags = cloudcast.tags?.map((t: any) => t.tag?.name).filter(Boolean) || [];
|
|
137
|
+
|
|
138
|
+
let richDescription = cloudcast.description?.replaceAll('\n', '<br>') || '';
|
|
139
|
+
|
|
140
|
+
if (cloudcast.featuringArtistList && cloudcast.featuringArtistList.length > 0) {
|
|
141
|
+
const artists = cloudcast.featuringArtistList.slice(0, 5).join(', ');
|
|
142
|
+
richDescription += richDescription ? '<br><br>' : '';
|
|
143
|
+
richDescription += `<strong>Featured Artists:</strong> ${artists}`;
|
|
144
|
+
if (cloudcast.featuringArtistList.length > 5) {
|
|
145
|
+
richDescription += ` and ${cloudcast.featuringArtistList.length - 5} more...`;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const stats: string[] = [];
|
|
150
|
+
if (cloudcast.plays) {
|
|
151
|
+
stats.push(`${cloudcast.plays} plays`);
|
|
152
|
+
}
|
|
153
|
+
if (cloudcast.favorites?.totalCount) {
|
|
154
|
+
stats.push(`${cloudcast.favorites.totalCount} favorites`);
|
|
155
|
+
}
|
|
156
|
+
if (cloudcast.reposts?.totalCount) {
|
|
157
|
+
stats.push(`${cloudcast.reposts.totalCount} reposts`);
|
|
158
|
+
}
|
|
159
|
+
if (cloudcast.comments?.totalCount) {
|
|
160
|
+
stats.push(`${cloudcast.comments.totalCount} comments`);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (stats.length > 0) {
|
|
164
|
+
richDescription += richDescription ? '<br><br>' : '';
|
|
165
|
+
richDescription += `<em>${stats.join(' • ')}</em>`;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return {
|
|
169
|
+
title: cloudcast.name,
|
|
170
|
+
author: cloudcast.owner?.displayName || username,
|
|
171
|
+
description: richDescription,
|
|
172
|
+
pubDate: parseDate(cloudcast.publishDate),
|
|
173
|
+
guid: Buffer.from(cloudcast.id, 'base64').toString(),
|
|
174
|
+
link: `${MIXCLOUD_CONFIG.host}/${cloudcast.owner?.username || username}/${cloudcast.slug}`,
|
|
175
|
+
itunes_item_image: cloudcast.picture?.url || '',
|
|
176
|
+
itunes_duration: cloudcast.audioLength,
|
|
177
|
+
enclosure_url: enclosureUrl,
|
|
178
|
+
enclosure_type: 'audio/x-m4a',
|
|
179
|
+
itunes_author: cloudcast.owner?.displayName || username,
|
|
180
|
+
category: tags,
|
|
181
|
+
comments: cloudcast.comments?.totalCount || 0,
|
|
182
|
+
upvotes: cloudcast.favorites?.totalCount || 0,
|
|
183
|
+
media: enclosureUrl
|
|
184
|
+
? {
|
|
185
|
+
content: {
|
|
186
|
+
url: enclosureUrl,
|
|
187
|
+
type: 'audio/x-m4a',
|
|
188
|
+
duration: cloudcast.audioLength,
|
|
189
|
+
},
|
|
190
|
+
thumbnail: cloudcast.picture?.url
|
|
191
|
+
? {
|
|
192
|
+
url: cloudcast.picture.url,
|
|
193
|
+
}
|
|
194
|
+
: undefined,
|
|
195
|
+
}
|
|
196
|
+
: undefined,
|
|
197
|
+
};
|
|
113
198
|
})
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const biog = data.user.biog;
|
|
117
|
-
const image = `${imageBaseURL}${data.user.picture.urlRoot}`;
|
|
118
|
-
|
|
119
|
-
// https://github.com/ytdl-org/youtube-dl/blob/f1487d4fca40fd37d735753e24a7bae53a1b1513/youtube_dl/extractor/mixcloud.py#L72-L79
|
|
120
|
-
const decryptionKey = 'IFYOUWANTTHEARTISTSTOGETPAIDDONOTDOWNLOADFROMMIXCLOUD';
|
|
121
|
-
const decryptXorCipher = (key, cipherText) => {
|
|
122
|
-
const cipher = CryptoJS.enc.Base64.parse(cipherText);
|
|
123
|
-
const decrypted = cipher.toString(CryptoJS.enc.Utf8);
|
|
124
|
-
let result = '';
|
|
125
|
-
for (let i = 0; i < decrypted.length; i++) {
|
|
126
|
-
result += String.fromCharCode(decrypted.charCodeAt(i) ^ key.charCodeAt(i % key.length));
|
|
127
|
-
}
|
|
128
|
-
return result;
|
|
129
|
-
};
|
|
199
|
+
.filter(Boolean);
|
|
130
200
|
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
return {
|
|
134
|
-
title: item.name,
|
|
135
|
-
author: item.owner.displayName,
|
|
136
|
-
description: item.description.replaceAll('\n', '<br>'),
|
|
137
|
-
pubDate: parseDate(item.publishDate),
|
|
138
|
-
guid: Buffer.from(item.id, 'base64').toString('utf8'),
|
|
139
|
-
link: `${host}/${username}/${item.slug}`,
|
|
140
|
-
itunes_item_image: `${imageBaseURL}${item.picture.urlRoot}`,
|
|
141
|
-
itunes_duration: item.audioLength,
|
|
142
|
-
enclosure_url: decryptXorCipher(decryptionKey, item.streamInfo.url),
|
|
143
|
-
enclosure_type: 'audio/x-m4a',
|
|
144
|
-
upvotes: item.favorites.totalCount,
|
|
145
|
-
};
|
|
146
|
-
});
|
|
201
|
+
const title = getPlaylistTitle(displayName, type, data.name);
|
|
202
|
+
const link = getPlaylistLink(username, type, playlistSlug);
|
|
147
203
|
|
|
148
204
|
return {
|
|
149
|
-
title
|
|
150
|
-
description:
|
|
151
|
-
itunes_author:
|
|
205
|
+
title,
|
|
206
|
+
description: description?.replaceAll('\n', '<br>') || '',
|
|
207
|
+
itunes_author: displayName,
|
|
152
208
|
image,
|
|
153
|
-
link
|
|
209
|
+
link,
|
|
154
210
|
item: items,
|
|
155
211
|
};
|
|
156
212
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Route } from '@/types';
|
|
2
|
+
import { handler } from './index';
|
|
3
|
+
|
|
4
|
+
export const route: Route = {
|
|
5
|
+
path: '/:username/playlists/:playlist',
|
|
6
|
+
categories: ['multimedia'],
|
|
7
|
+
example: '/mixcloud/dholbach/playlists/ecclectic-dance',
|
|
8
|
+
parameters: {
|
|
9
|
+
username: 'Username, can be found in URL',
|
|
10
|
+
playlist: 'Playlist slug, can be found in URL',
|
|
11
|
+
},
|
|
12
|
+
features: {
|
|
13
|
+
requireConfig: false,
|
|
14
|
+
requirePuppeteer: false,
|
|
15
|
+
antiCrawler: false,
|
|
16
|
+
supportBT: false,
|
|
17
|
+
supportPodcast: true,
|
|
18
|
+
supportScihub: false,
|
|
19
|
+
},
|
|
20
|
+
radar: [
|
|
21
|
+
{
|
|
22
|
+
source: ['mixcloud.com/:username/playlists/:playlist'],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
source: ['www.mixcloud.com/:username/playlists/:playlist'],
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
name: 'Playlist',
|
|
29
|
+
maintainers: ['Misaka13514'],
|
|
30
|
+
handler,
|
|
31
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type Data, type Route, ViewType } from '@/types';
|
|
2
|
+
import type { Context } from 'hono';
|
|
3
|
+
import { CONFIG_OPTIONS, generatePostDataItem, getClient, postFilter } from './utils';
|
|
4
|
+
|
|
5
|
+
const handler = async (ctx: Context) => {
|
|
6
|
+
const limit = Number.parseInt(ctx.req.query('limit') ?? '20', 10);
|
|
7
|
+
const communityId = ctx.req.param('id');
|
|
8
|
+
const mediaOnly = ctx.req.param('media') === 'media';
|
|
9
|
+
|
|
10
|
+
const client = getClient();
|
|
11
|
+
|
|
12
|
+
const [communityInfo, postsData] = await Promise.all([
|
|
13
|
+
client.getCommunity({
|
|
14
|
+
communityId,
|
|
15
|
+
}),
|
|
16
|
+
client.getCommunityTimeline({
|
|
17
|
+
communityId,
|
|
18
|
+
limit,
|
|
19
|
+
mediaOnly,
|
|
20
|
+
}),
|
|
21
|
+
]);
|
|
22
|
+
|
|
23
|
+
const personasData = await client.getPersonas({
|
|
24
|
+
personaIds: postsData?.posts.map((post) => post.personaId),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
title: `${communityInfo.community.name} - ${mediaOnly ? 'メディア' : 'ポスト'}`,
|
|
29
|
+
description: communityInfo.community.purpose.replaceAll('\n', ' '),
|
|
30
|
+
link: `https://mixi.social/communities/${communityId}/about`,
|
|
31
|
+
image: communityInfo.community.coverImage.postImage?.largeImageUrl,
|
|
32
|
+
item:
|
|
33
|
+
postsData?.posts?.filter(postFilter).map((post) => ({
|
|
34
|
+
title: communityInfo.community.name,
|
|
35
|
+
...generatePostDataItem(post, personasData.personas),
|
|
36
|
+
})) ?? [],
|
|
37
|
+
} as Data;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const route: Route = {
|
|
41
|
+
path: '/community/:id/:media?',
|
|
42
|
+
name: 'コミュニティ',
|
|
43
|
+
categories: ['social-media'],
|
|
44
|
+
example: '/mixi2/community/62e7e813-d242-4c54-a0ee-0aab5b2bbad2',
|
|
45
|
+
parameters: {
|
|
46
|
+
id: {
|
|
47
|
+
description: 'コミュニティID',
|
|
48
|
+
},
|
|
49
|
+
media: {
|
|
50
|
+
description: '`media`を入力するとメディアを含むポストのみを取得、デフォルトは空で全てのポストを取得',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
features: {
|
|
54
|
+
supportRadar: true,
|
|
55
|
+
requireConfig: CONFIG_OPTIONS,
|
|
56
|
+
},
|
|
57
|
+
radar: [
|
|
58
|
+
{
|
|
59
|
+
source: ['mixi.social/communities/:id', 'mixi.social/communities/:id/about'],
|
|
60
|
+
target: '/community/:id',
|
|
61
|
+
title: 'コミュニティ - ポスト',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
source: ['mixi.social/communities/:id', 'mixi.social/communities/:id/about'],
|
|
65
|
+
target: '/community/:id/media',
|
|
66
|
+
title: 'コミュニティ - メディア',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
view: ViewType.SocialMedia,
|
|
70
|
+
handler,
|
|
71
|
+
maintainers: ['KarasuShin'],
|
|
72
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type Data, type Route, ViewType } from '@/types';
|
|
2
|
+
import type { Context } from 'hono';
|
|
3
|
+
import { CONFIG_OPTIONS, generatePostDataItem, getClient, postFilter } from './utils';
|
|
4
|
+
|
|
5
|
+
const handler = async (ctx: Context) => {
|
|
6
|
+
const limit = Number.parseInt(ctx.req.query('limit') ?? '20', 10);
|
|
7
|
+
|
|
8
|
+
const client = getClient();
|
|
9
|
+
|
|
10
|
+
const data = await client.getRecommendedTimeline({
|
|
11
|
+
limit,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const personasData = await client.getPersonas({
|
|
15
|
+
personaIds: data?.posts?.map((post) => post.personaId) ?? [],
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
title: '発見',
|
|
20
|
+
link: 'https://mixi.social/home/discovery',
|
|
21
|
+
image: 'https://mixi.social/_next/static/media/image_logo.8bb36f11.svg',
|
|
22
|
+
item:
|
|
23
|
+
data?.posts?.filter(postFilter).map((post) => {
|
|
24
|
+
const author = personasData.personas.find((persona) => persona.personaId === post.personaId);
|
|
25
|
+
return {
|
|
26
|
+
title: `@${author?.name}`,
|
|
27
|
+
...generatePostDataItem(post, personasData.personas),
|
|
28
|
+
};
|
|
29
|
+
}) ?? [],
|
|
30
|
+
} as Data;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const route: Route = {
|
|
34
|
+
path: '/discovery',
|
|
35
|
+
name: '発見',
|
|
36
|
+
categories: ['social-media'],
|
|
37
|
+
example: '/mixi2/discovery',
|
|
38
|
+
features: {
|
|
39
|
+
supportRadar: true,
|
|
40
|
+
requireConfig: CONFIG_OPTIONS,
|
|
41
|
+
},
|
|
42
|
+
radar: [
|
|
43
|
+
{
|
|
44
|
+
source: ['mixi.social/home/discovery'],
|
|
45
|
+
target: '/discovery',
|
|
46
|
+
title: '発見',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
view: ViewType.SocialMedia,
|
|
50
|
+
handler,
|
|
51
|
+
maintainers: ['KarasuShin'],
|
|
52
|
+
};
|