koishi-plugin-kkk 1.0.0
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/CHANGELOG.md +57 -0
- package/LICENSE +674 -0
- package/README.md +98 -0
- package/assets/web/assets/CronEditor-CYgFpX-g.js +1 -0
- package/assets/web/assets/DesktopLayout-iI43ij11.js +1 -0
- package/assets/web/assets/MobileLayout-CziU8MCR.js +1 -0
- package/assets/web/assets/ThemeSwitch-DFohhwd9.js +1 -0
- package/assets/web/assets/index-BRROK0vh.js +47 -0
- package/assets/web/assets/index-Dj-StEiS.css +2 -0
- package/assets/web/assets/separator-CxcFlCzz.js +1 -0
- package/assets/web/favicon.svg +1 -0
- package/assets/web/icons.svg +24 -0
- package/assets/web/index.html +15 -0
- package/assets/webui.html +115 -0
- package/client/index.ts +63 -0
- package/config/default_config/app.yaml +64 -0
- package/config/default_config/bilibili.yaml +116 -0
- package/config/default_config/config.json +157 -0
- package/config/default_config/cookies.yaml +11 -0
- package/config/default_config/douyin.yaml +99 -0
- package/config/default_config/kuaishou.yaml +8 -0
- package/config/default_config/pushlist.yaml +37 -0
- package/config/default_config/request.yaml +22 -0
- package/config/default_config/upload.yaml +50 -0
- package/config/default_config/xiaohongshu.yaml +23 -0
- package/dist/index.js +1 -0
- package/lib/compat/axios.js +23 -0
- package/lib/compat/cron.js +77 -0
- package/lib/compat/esm.js +15 -0
- package/lib/compat/express.js +23 -0
- package/lib/compat/heroui.js +12 -0
- package/lib/compat/lodash.js +33 -0
- package/lib/compat/logger.js +118 -0
- package/lib/compat/node-karin.js +1053 -0
- package/lib/compat/phosphor-icons.js +27 -0
- package/lib/compat/qqcard.js +256 -0
- package/lib/compat/root.js +44 -0
- package/lib/compat/runtime.js +87 -0
- package/lib/compat/segment.js +167 -0
- package/lib/compat/sqlite3.js +117 -0
- package/lib/compat/start.js +7 -0
- package/lib/compat/syncConfig.js +65 -0
- package/lib/compat/template-react.js +30 -0
- package/lib/compat/text.js +65 -0
- package/lib/compat/yaml.js +13 -0
- package/lib/configBridge.js +91 -0
- package/lib/index.js +775 -0
- package/lib/karin/app.js +34 -0
- package/lib/karin/apps/__ready.js +9 -0
- package/lib/karin/apps/admin.js +136 -0
- package/lib/karin/apps/help.js +233 -0
- package/lib/karin/apps/push.js +291 -0
- package/lib/karin/apps/qrlogin.js +176 -0
- package/lib/karin/apps/statistics.js +209 -0
- package/lib/karin/apps/testPush.js +247 -0
- package/lib/karin/apps/tools.js +473 -0
- package/lib/karin/apps/update.js +252 -0
- package/lib/karin/index.js +37 -0
- package/lib/karin/module/db/bilibili.js +831 -0
- package/lib/karin/module/db/douyin.js +918 -0
- package/lib/karin/module/db/index.js +165 -0
- package/lib/karin/module/db/migration.js +199 -0
- package/lib/karin/module/db/statistics.js +559 -0
- package/lib/karin/module/index.js +94 -0
- package/lib/karin/module/server/constants/routes.js +48 -0
- package/lib/karin/module/server/controllers/bots.js +230 -0
- package/lib/karin/module/server/controllers/config.js +75 -0
- package/lib/karin/module/server/controllers/video.js +208 -0
- package/lib/karin/module/server/index.js +26 -0
- package/lib/karin/module/server/middlewares/auth.js +133 -0
- package/lib/karin/module/server/routes/amagi.js +57 -0
- package/lib/karin/module/server/routes/api.js +40 -0
- package/lib/karin/module/server/routes/index.js +97 -0
- package/lib/karin/module/server/routes/ssr.js +16 -0
- package/lib/karin/module/server/routes/static.js +43 -0
- package/lib/karin/module/utils/Base.js +403 -0
- package/lib/karin/module/utils/CardParser.js +487 -0
- package/lib/karin/module/utils/Common.js +418 -0
- package/lib/karin/module/utils/Config.js +434 -0
- package/lib/karin/module/utils/EmojiReaction.js +242 -0
- package/lib/karin/module/utils/ErrorHandler/handler.js +114 -0
- package/lib/karin/module/utils/ErrorHandler/index.js +55 -0
- package/lib/karin/module/utils/ErrorHandler/render.js +182 -0
- package/lib/karin/module/utils/ErrorHandler/sender.js +206 -0
- package/lib/karin/module/utils/ErrorHandler/strategy.js +41 -0
- package/lib/karin/module/utils/ErrorHandler/types.js +2 -0
- package/lib/karin/module/utils/ErrorHandler/utils.js +108 -0
- package/lib/karin/module/utils/FFmpeg.js +298 -0
- package/lib/karin/module/utils/ImageHelper.js +91 -0
- package/lib/karin/module/utils/ImageSlice.js +429 -0
- package/lib/karin/module/utils/MotionPhoto.js +250 -0
- package/lib/karin/module/utils/Network/Downloader.js +413 -0
- package/lib/karin/module/utils/Network/ImageDownloader.js +250 -0
- package/lib/karin/module/utils/Network/Network.js +332 -0
- package/lib/karin/module/utils/Network/ThrottleStream.js +71 -0
- package/lib/karin/module/utils/Network/constants.js +129 -0
- package/lib/karin/module/utils/Network/helpers.js +174 -0
- package/lib/karin/module/utils/Network/index.js +34 -0
- package/lib/karin/module/utils/Network/types.js +12 -0
- package/lib/karin/module/utils/Networks.js +17 -0
- package/lib/karin/module/utils/ParseLock.js +34 -0
- package/lib/karin/module/utils/ParseOverride.js +88 -0
- package/lib/karin/module/utils/QqCardResolve.js +114 -0
- package/lib/karin/module/utils/QqPanel.js +879 -0
- package/lib/karin/module/utils/Render/coverTheme.js +256 -0
- package/lib/karin/module/utils/Render/index.js +582 -0
- package/lib/karin/module/utils/amagiClient.js +338 -0
- package/lib/karin/module/utils/avatar.js +201 -0
- package/lib/karin/module/utils/bot.js +141 -0
- package/lib/karin/module/utils/build-metadata.js +50 -0
- package/lib/karin/module/utils/changelog.js +166 -0
- package/lib/karin/module/utils/index.js +26 -0
- package/lib/karin/module/utils/loginSession.js +259 -0
- package/lib/karin/module/utils/parseTip.js +93 -0
- package/lib/karin/module/utils/runtime-report.js +140 -0
- package/lib/karin/module/utils/semver.js +72 -0
- package/lib/karin/module/utils/statisticsAggregate.js +415 -0
- package/lib/karin/platform/bilibili/bilibili.js +1805 -0
- package/lib/karin/platform/bilibili/comments.js +294 -0
- package/lib/karin/platform/bilibili/danmaku.js +555 -0
- package/lib/karin/platform/bilibili/dynamic-text.js +827 -0
- package/lib/karin/platform/bilibili/genParams.js +37 -0
- package/lib/karin/platform/bilibili/getID.js +159 -0
- package/lib/karin/platform/bilibili/index.js +24 -0
- package/lib/karin/platform/bilibili/live-status.js +40 -0
- package/lib/karin/platform/bilibili/login.js +132 -0
- package/lib/karin/platform/bilibili/push.js +1397 -0
- package/lib/karin/platform/bilibili/riskControl.js +133 -0
- package/lib/karin/platform/bilibili/search.js +299 -0
- package/lib/karin/platform/common/danmaku-types.js +12 -0
- package/lib/karin/platform/douyin/comments.js +310 -0
- package/lib/karin/platform/douyin/danmaku.js +893 -0
- package/lib/karin/platform/douyin/douyin.js +1145 -0
- package/lib/karin/platform/douyin/getID.js +94 -0
- package/lib/karin/platform/douyin/index.js +24 -0
- package/lib/karin/platform/douyin/login.js +230 -0
- package/lib/karin/platform/douyin/push/favorite.js +75 -0
- package/lib/karin/platform/douyin/push/index.js +21 -0
- package/lib/karin/platform/douyin/push/live.js +69 -0
- package/lib/karin/platform/douyin/push/post.js +60 -0
- package/lib/karin/platform/douyin/push/recommend.js +74 -0
- package/lib/karin/platform/douyin/push/render.js +621 -0
- package/lib/karin/platform/douyin/push/types.js +2 -0
- package/lib/karin/platform/douyin/push.js +1128 -0
- package/lib/karin/platform/douyin/types.js +13 -0
- package/lib/karin/platform/douyin/videoQuality.js +222 -0
- package/lib/karin/platform/douyin/workType.js +182 -0
- package/lib/karin/platform/index.js +20 -0
- package/lib/karin/platform/kuaishou/comments.js +91 -0
- package/lib/karin/platform/kuaishou/getID.js +43 -0
- package/lib/karin/platform/kuaishou/getdata.js +41 -0
- package/lib/karin/platform/kuaishou/index.js +20 -0
- package/lib/karin/platform/kuaishou/kuaishou.js +122 -0
- package/lib/karin/platform/xiaohongshu/comments.js +162 -0
- package/lib/karin/platform/xiaohongshu/getID.js +129 -0
- package/lib/karin/platform/xiaohongshu/index.js +18 -0
- package/lib/karin/platform/xiaohongshu/xiaohongshu.js +643 -0
- package/lib/karin/root.js +73 -0
- package/lib/karin/setup.js +99 -0
- package/lib/karin/types/config/amagi.js +2 -0
- package/lib/karin/types/config/app.js +2 -0
- package/lib/karin/types/config/bilibili.js +2 -0
- package/lib/karin/types/config/cookies.js +2 -0
- package/lib/karin/types/config/douyin.js +2 -0
- package/lib/karin/types/config/index.js +2 -0
- package/lib/karin/types/config/kuaishou.js +2 -0
- package/lib/karin/types/config/pushlist.js +2 -0
- package/lib/karin/types/config/request.js +2 -0
- package/lib/karin/types/config/upload.js +2 -0
- package/lib/karin/types/config/xiaohongshu.js +2 -0
- package/lib/karin/types/datatypes.js +2 -0
- package/lib/karin/types/index.js +18 -0
- package/lib/karin/types/netrorks/NetworksConfigType.js +2 -0
- package/lib/karin/types/netrorks/index.js +17 -0
- package/lib/karin/web.config.js +49 -0
- package/lib/ktr/registry.js +82 -0
- package/lib/ktr/template/_preview/components/PreviewInfoCard.js +10 -0
- package/lib/ktr/template/_preview/components/PreviewLayout.js +10 -0
- package/lib/ktr/template/_preview/components/PreviewVideoCard.js +8 -0
- package/lib/ktr/template/_preview/render.js +142 -0
- package/lib/ktr/template/_preview/types.js +2 -0
- package/lib/ktr/template/_preview/utils/status.js +31 -0
- package/lib/ktr/template/_preview/utils/time.js +12 -0
- package/lib/ktr/template/bilibili/bangumi/components/bangumi.js +127 -0
- package/lib/ktr/template/bilibili/bangumi/components/types.js +2 -0
- package/lib/ktr/template/bilibili/bangumi/index.js +12 -0
- package/lib/ktr/template/bilibili/comment/components/Comment.js +193 -0
- package/lib/ktr/template/bilibili/comment/components/types.js +2 -0
- package/lib/ktr/template/bilibili/comment/index.js +10 -0
- package/lib/ktr/template/bilibili/components/Icons.js +66 -0
- package/lib/ktr/template/bilibili/components/shared.js +93 -0
- package/lib/ktr/template/bilibili/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_ARTICLE/components/DYNAMIC_TYPE_ARTICLE.js +66 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_ARTICLE/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_ARTICLE/index.js +10 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_AV/components/DYNAMIC_TYPE_AV.js +87 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_AV/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_AV/index.js +10 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_DRAW/components/DYNAMIC_TYPE_DRAW.js +93 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_DRAW/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_DRAW/index.js +10 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_FORWARD/components/DYNAMIC_TYPE_FORWARD.js +132 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_FORWARD/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_FORWARD/index.js +10 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD/components/DYNAMIC_TYPE_LIVE_RCMD.js +84 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD/index.js +10 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_WORD/components/DYNAMIC_TYPE_WORD.js +38 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_WORD/components/types.js +2 -0
- package/lib/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_WORD/index.js +10 -0
- package/lib/ktr/template/bilibili/dynamic/components/AdditionalCard.js +59 -0
- package/lib/ktr/template/bilibili/dynamic/components/CommonComponents.js +30 -0
- package/lib/ktr/template/bilibili/dynamic/types.js +2 -0
- package/lib/ktr/template/bilibili/qrcodeImg/components/qrcodeImg.js +48 -0
- package/lib/ktr/template/bilibili/qrcodeImg/components/types.js +3 -0
- package/lib/ktr/template/bilibili/qrcodeImg/index.js +10 -0
- package/lib/ktr/template/bilibili/userlist/components/UserList.js +53 -0
- package/lib/ktr/template/bilibili/userlist/components/types.js +3 -0
- package/lib/ktr/template/bilibili/userlist/index.js +13 -0
- package/lib/ktr/template/bilibili/videoInfo/components/types.js +2 -0
- package/lib/ktr/template/bilibili/videoInfo/components/videoInfo.js +62 -0
- package/lib/ktr/template/bilibili/videoInfo/index.js +10 -0
- package/lib/ktr/template/components/AmbientCover.js +36 -0
- package/lib/ktr/template/components/DefaultLayout.js +33 -0
- package/lib/ktr/template/components/GlowImage.js +276 -0
- package/lib/ktr/template/components/QRCodeWithAvatar.js +34 -0
- package/lib/ktr/template/components/RolldownLogo.js +6 -0
- package/lib/ktr/template/components/ViteLogo.js +6 -0
- package/lib/ktr/template/components/iconRegistry.js +173 -0
- package/lib/ktr/template/douyin/article-work/components/ArticleWork.js +99 -0
- package/lib/ktr/template/douyin/article-work/components/types.js +3 -0
- package/lib/ktr/template/douyin/article-work/index.js +10 -0
- package/lib/ktr/template/douyin/comment/components/Comment.js +189 -0
- package/lib/ktr/template/douyin/comment/components/types.js +2 -0
- package/lib/ktr/template/douyin/comment/index.js +10 -0
- package/lib/ktr/template/douyin/components/Icons.js +29 -0
- package/lib/ktr/template/douyin/components/types.js +3 -0
- package/lib/ktr/template/douyin/dynamic/components/Dynamic.js +90 -0
- package/lib/ktr/template/douyin/dynamic/components/types.js +3 -0
- package/lib/ktr/template/douyin/dynamic/index.js +10 -0
- package/lib/ktr/template/douyin/favorite-list/components/FavoriteList.js +30 -0
- package/lib/ktr/template/douyin/favorite-list/components/types.js +3 -0
- package/lib/ktr/template/douyin/favorite-list/index.js +10 -0
- package/lib/ktr/template/douyin/image-work/components/ImageWork.js +136 -0
- package/lib/ktr/template/douyin/image-work/components/types.js +2 -0
- package/lib/ktr/template/douyin/image-work/index.js +10 -0
- package/lib/ktr/template/douyin/live/components/Live.js +51 -0
- package/lib/ktr/template/douyin/live/components/types.js +3 -0
- package/lib/ktr/template/douyin/live/index.js +10 -0
- package/lib/ktr/template/douyin/musicinfo/components/MusicInfo.js +60 -0
- package/lib/ktr/template/douyin/musicinfo/components/types.js +3 -0
- package/lib/ktr/template/douyin/musicinfo/index.js +10 -0
- package/lib/ktr/template/douyin/qrcodeImg/components/qrcodeImg.js +39 -0
- package/lib/ktr/template/douyin/qrcodeImg/components/types.js +3 -0
- package/lib/ktr/template/douyin/qrcodeImg/index.js +9 -0
- package/lib/ktr/template/douyin/recommend-list/components/RecommendList.js +30 -0
- package/lib/ktr/template/douyin/recommend-list/components/types.js +3 -0
- package/lib/ktr/template/douyin/recommend-list/index.js +10 -0
- package/lib/ktr/template/douyin/user_profile/components/UserVideoList.js +54 -0
- package/lib/ktr/template/douyin/user_profile/components/types.js +3 -0
- package/lib/ktr/template/douyin/user_profile/index.js +9 -0
- package/lib/ktr/template/douyin/userlist/components/UserList.js +50 -0
- package/lib/ktr/template/douyin/userlist/components/types.js +3 -0
- package/lib/ktr/template/douyin/userlist/index.js +13 -0
- package/lib/ktr/template/douyin/video-work/components/VideoWork.js +127 -0
- package/lib/ktr/template/douyin/video-work/components/types.js +2 -0
- package/lib/ktr/template/douyin/video-work/index.js +10 -0
- package/lib/ktr/template/kuaishou/comment/components/Comment.js +88 -0
- package/lib/ktr/template/kuaishou/comment/components/types.js +2 -0
- package/lib/ktr/template/kuaishou/comment/index.js +10 -0
- package/lib/ktr/template/other/changelog/components/changelog.js +117 -0
- package/lib/ktr/template/other/changelog/components/types.js +3 -0
- package/lib/ktr/template/other/changelog/index.js +9 -0
- package/lib/ktr/template/other/handlerError/components/errorTitles.js +227 -0
- package/lib/ktr/template/other/handlerError/components/handlerError.js +392 -0
- package/lib/ktr/template/other/handlerError/components/stackHighlight.js +109 -0
- package/lib/ktr/template/other/handlerError/components/types.js +2 -0
- package/lib/ktr/template/other/handlerError/index.js +9 -0
- package/lib/ktr/template/other/help/components/Help.js +79 -0
- package/lib/ktr/template/other/help/components/types.js +3 -0
- package/lib/ktr/template/other/help/index.js +12 -0
- package/lib/ktr/template/other/live-photo-tip/components/LivePhotoTip.js +80 -0
- package/lib/ktr/template/other/live-photo-tip/components/types.js +3 -0
- package/lib/ktr/template/other/live-photo-tip/index.js +9 -0
- package/lib/ktr/template/other/qrlogin/components/qrlogin.js +58 -0
- package/lib/ktr/template/other/qrlogin/components/types.js +3 -0
- package/lib/ktr/template/other/qrlogin/index.js +9 -0
- package/lib/ktr/template/other/runtime/components/runtime.js +101 -0
- package/lib/ktr/template/other/runtime/components/types.js +3 -0
- package/lib/ktr/template/other/runtime/index.js +9 -0
- package/lib/ktr/template/other/version_warning/components/VersionWarning.js +38 -0
- package/lib/ktr/template/other/version_warning/components/types.js +3 -0
- package/lib/ktr/template/other/version_warning/index.js +9 -0
- package/lib/ktr/template/statistics/components/BoxplotGuide.js +17 -0
- package/lib/ktr/template/statistics/components/ChartCard.js +15 -0
- package/lib/ktr/template/statistics/components/KpiCard.js +14 -0
- package/lib/ktr/template/statistics/components/PlatformTable.js +20 -0
- package/lib/ktr/template/statistics/components/RankList.js +61 -0
- package/lib/ktr/template/statistics/components/SSRChart.js +22 -0
- package/lib/ktr/template/statistics/components/chartPresets.js +630 -0
- package/lib/ktr/template/statistics/components/chartTheme.js +226 -0
- package/lib/ktr/template/statistics/components/format.js +38 -0
- package/lib/ktr/template/statistics/components/types.js +9 -0
- package/lib/ktr/template/statistics/global/components/GlobalStatistics.js +246 -0
- package/lib/ktr/template/statistics/global/components/types.js +3 -0
- package/lib/ktr/template/statistics/global/index.js +9 -0
- package/lib/ktr/template/statistics/group/components/GroupStatistics.js +181 -0
- package/lib/ktr/template/statistics/group/components/types.js +3 -0
- package/lib/ktr/template/statistics/group/index.js +9 -0
- package/lib/ktr/template/types/ctx.js +2 -0
- package/lib/ktr/template/xiaohongshu/comment/components/Comment.js +99 -0
- package/lib/ktr/template/xiaohongshu/comment/components/types.js +3 -0
- package/lib/ktr/template/xiaohongshu/comment/index.js +9 -0
- package/lib/ktr/template/xiaohongshu/noteInfo/components/noteInfo.js +93 -0
- package/lib/ktr/template/xiaohongshu/noteInfo/components/types.js +2 -0
- package/lib/ktr/template/xiaohongshu/noteInfo/index.js +9 -0
- package/lib/ktr/utils/QRCodeAvatar.js +99 -0
- package/lib/ktr/utils/QRcode.js +56 -0
- package/lib/ktr/utils/avatarProxy.js +45 -0
- package/lib/ktr/utils/cn.js +11 -0
- package/lib/ktr/utils/theme.js +12 -0
- package/lib/qqFields.json +75 -0
- package/lib/qqOptions.js +44 -0
- package/lib/richtext/index.js +25 -0
- package/lib/richtext/parse/index.js +232 -0
- package/lib/richtext/react/cn.js +11 -0
- package/lib/richtext/react/index.js +221 -0
- package/lib/richtext/types.js +2 -0
- package/lib/schema.js +352 -0
- package/lib/webui.js +341 -0
- package/package.json +88 -0
- package/resources/image/bilibili/RICH_TEXT_NODE_TYPE/RICH_TEXT_NODE_TYPE_BV.svg +1 -0
- package/resources/image/bilibili/RICH_TEXT_NODE_TYPE/RICH_TEXT_NODE_TYPE_GOODS.svg +1 -0
- package/resources/image/bilibili/RICH_TEXT_NODE_TYPE/RICH_TEXT_NODE_TYPE_LOTTERY.svg +1 -0
- package/resources/image/bilibili/RICH_TEXT_NODE_TYPE/RICH_TEXT_NODE_TYPE_VIEW_PICTURE.svg +1 -0
- package/resources/image/bilibili/RICH_TEXT_NODE_TYPE/RICH_TEXT_NODE_TYPE_VOTE.svg +1 -0
- package/resources/image/bilibili/RICH_TEXT_NODE_TYPE/RICH_TEXT_NODE_TYPE_WEB.svg +1 -0
- package/resources/image/bilibili/bilibili-dark.png +0 -0
- package/resources/image/bilibili/bilibili-light.png +0 -0
- package/resources/image/bilibili/bilibili.png +0 -0
- package/resources/image/bilibili/id-dark.svg +1 -0
- package/resources/image/bilibili/id-light.svg +1 -0
- package/resources/image/bilibili/level/lv0.svg +1 -0
- package/resources/image/bilibili/level/lv1.svg +1 -0
- package/resources/image/bilibili/level/lv2.svg +1 -0
- package/resources/image/bilibili/level/lv3.svg +1 -0
- package/resources/image/bilibili/level/lv4.svg +1 -0
- package/resources/image/bilibili/level/lv5.svg +1 -0
- package/resources/image/bilibili/level/lv6.svg +1 -0
- package/resources/image/bilibili/level/lv7.svg +1 -0
- package/resources/image/bilibili/like-dark.svg +6 -0
- package/resources/image/bilibili/like-light.svg +6 -0
- package/resources/image/bilibili/play.svg +28 -0
- package/resources/image/bilibili/res-local1.png +0 -0
- package/resources/image/bilibili/up_pb.svg +1 -0
- package/resources/image/bilibili//347/233/264/346/222/255/344/270/255.png +0 -0
- package/resources/image/douyin/douyin.png +0 -0
- package/resources/image/douyin/dylogo-dark.svg +23 -0
- package/resources/image/douyin/dylogo-light.svg +38 -0
- package/resources/image/douyin/search-dark.svg +1 -0
- package/resources/image/douyin/search-light.svg +3 -0
- package/resources/image/douyin//346/212/226/351/237/263-/347/233/264/346/222/255/344/270/255.png +0 -0
- package/resources/image/frame-logo.png +0 -0
- package/resources/image/kuaishou/logo.png +0 -0
- package/resources/image/other/handlerError/Milky.png +0 -0
- package/resources/image/other/handlerError/chronocat.svg +43 -0
- package/resources/image/other/handlerError/conwechat.webp +0 -0
- package/resources/image/other/handlerError/gocq-http.webp +0 -0
- package/resources/image/other/handlerError/lagrange.webp +0 -0
- package/resources/image/other/handlerError/llonebot.webp +0 -0
- package/resources/image/other/handlerError/napcat.webp +0 -0
- package/resources/image/other/handlerError/onebot.png +0 -0
- package/resources/image/other/handlerError/satori.png +0 -0
- package/resources/image/xiaohongshu/logo.png +0 -0
- package/resources/template/style.css +23708 -0
- package/resources/vite.svg +130 -0
- package/scripts/build.mjs +129 -0
- package/scripts/check-schema.cjs +55 -0
- package/scripts/deploy.mjs +78 -0
- package/scripts/make-demo-placeholders.mjs +112 -0
- package/scripts/patch-deps.mjs +46 -0
- package/scripts/patch-webui.mjs +112 -0
- package/scripts/smoke-commands.cjs +39 -0
- package/scripts/smoke-config.cjs +122 -0
- package/scripts/smoke-douyin.cjs +170 -0
- package/scripts/smoke-koishi-commands.cjs +210 -0
- package/scripts/smoke-login.cjs +110 -0
- package/scripts/smoke-parse.cjs +54 -0
- package/scripts/smoke-push-mock.cjs +114 -0
- package/scripts/smoke-push.cjs +104 -0
- package/scripts/smoke-qq.cjs +147 -0
- package/scripts/smoke-qqcard.cjs +108 -0
- package/scripts/smoke-qqpanel.cjs +205 -0
- package/scripts/smoke-render.cjs +106 -0
- package/scripts/smoke-server.cjs +94 -0
- package/src/compat/axios.ts +5 -0
- package/src/compat/cron.ts +86 -0
- package/src/compat/esm.ts +13 -0
- package/src/compat/express.ts +5 -0
- package/src/compat/heroui.tsx +53 -0
- package/src/compat/lodash.ts +32 -0
- package/src/compat/logger.ts +121 -0
- package/src/compat/node-karin.ts +1064 -0
- package/src/compat/phosphor-icons.tsx +25 -0
- package/src/compat/qqcard.ts +251 -0
- package/src/compat/root.ts +44 -0
- package/src/compat/runtime.ts +120 -0
- package/src/compat/segment.ts +161 -0
- package/src/compat/sqlite3.ts +123 -0
- package/src/compat/start.ts +3 -0
- package/src/compat/syncConfig.ts +64 -0
- package/src/compat/template-react.ts +54 -0
- package/src/compat/text.ts +58 -0
- package/src/compat/yaml.ts +6 -0
- package/src/configBridge.ts +94 -0
- package/src/index.ts +769 -0
- package/src/karin/app.ts +1 -0
- package/src/karin/apps/__ready.ts +14 -0
- package/src/karin/apps/admin.ts +127 -0
- package/src/karin/apps/help.ts +228 -0
- package/src/karin/apps/push.ts +327 -0
- package/src/karin/apps/qrlogin.ts +160 -0
- package/src/karin/apps/statistics.ts +203 -0
- package/src/karin/apps/testPush.ts +226 -0
- package/src/karin/apps/tools.ts +510 -0
- package/src/karin/apps/update.ts +239 -0
- package/src/karin/index.ts +9 -0
- package/src/karin/module/db/bilibili.ts +1089 -0
- package/src/karin/module/db/douyin.ts +1218 -0
- package/src/karin/module/db/index.ts +159 -0
- package/src/karin/module/db/migration.ts +249 -0
- package/src/karin/module/db/statistics.ts +817 -0
- package/src/karin/module/index.ts +37 -0
- package/src/karin/module/server/constants/routes.ts +53 -0
- package/src/karin/module/server/controllers/bots.ts +289 -0
- package/src/karin/module/server/controllers/config.ts +85 -0
- package/src/karin/module/server/controllers/video.ts +212 -0
- package/src/karin/module/server/index.ts +11 -0
- package/src/karin/module/server/middlewares/auth.ts +147 -0
- package/src/karin/module/server/routes/amagi.ts +57 -0
- package/src/karin/module/server/routes/api.ts +42 -0
- package/src/karin/module/server/routes/index.ts +68 -0
- package/src/karin/module/server/routes/ssr.ts +14 -0
- package/src/karin/module/server/routes/static.ts +43 -0
- package/src/karin/module/utils/Base.ts +497 -0
- package/src/karin/module/utils/CardParser.ts +503 -0
- package/src/karin/module/utils/Common.ts +448 -0
- package/src/karin/module/utils/Config.ts +443 -0
- package/src/karin/module/utils/EmojiReaction.ts +268 -0
- package/src/karin/module/utils/ErrorHandler/handler.ts +124 -0
- package/src/karin/module/utils/ErrorHandler/index.ts +48 -0
- package/src/karin/module/utils/ErrorHandler/render.ts +180 -0
- package/src/karin/module/utils/ErrorHandler/sender.ts +192 -0
- package/src/karin/module/utils/ErrorHandler/strategy.ts +41 -0
- package/src/karin/module/utils/ErrorHandler/types.ts +122 -0
- package/src/karin/module/utils/ErrorHandler/utils.ts +108 -0
- package/src/karin/module/utils/FFmpeg.ts +357 -0
- package/src/karin/module/utils/ImageHelper.ts +90 -0
- package/src/karin/module/utils/ImageSlice.ts +383 -0
- package/src/karin/module/utils/MotionPhoto.ts +297 -0
- package/src/karin/module/utils/Network/Downloader.ts +481 -0
- package/src/karin/module/utils/Network/ImageDownloader.ts +291 -0
- package/src/karin/module/utils/Network/Network.ts +344 -0
- package/src/karin/module/utils/Network/ThrottleStream.ts +76 -0
- package/src/karin/module/utils/Network/constants.ts +135 -0
- package/src/karin/module/utils/Network/helpers.ts +183 -0
- package/src/karin/module/utils/Network/index.ts +28 -0
- package/src/karin/module/utils/Network/types.ts +46 -0
- package/src/karin/module/utils/Networks.ts +20 -0
- package/src/karin/module/utils/ParseLock.ts +33 -0
- package/src/karin/module/utils/ParseOverride.ts +128 -0
- package/src/karin/module/utils/QqCardResolve.ts +116 -0
- package/src/karin/module/utils/QqPanel.ts +880 -0
- package/src/karin/module/utils/Render/coverTheme.ts +294 -0
- package/src/karin/module/utils/Render/index.ts +574 -0
- package/src/karin/module/utils/amagiClient.ts +368 -0
- package/src/karin/module/utils/avatar.ts +220 -0
- package/src/karin/module/utils/bot.ts +115 -0
- package/src/karin/module/utils/build-metadata.ts +60 -0
- package/src/karin/module/utils/changelog.ts +175 -0
- package/src/karin/module/utils/index.ts +10 -0
- package/src/karin/module/utils/loginSession.ts +291 -0
- package/src/karin/module/utils/parseTip.ts +59 -0
- package/src/karin/module/utils/runtime-report.ts +142 -0
- package/src/karin/module/utils/semver.ts +60 -0
- package/src/karin/module/utils/statisticsAggregate.ts +507 -0
- package/src/karin/platform/bilibili/bilibili.ts +2004 -0
- package/src/karin/platform/bilibili/comments.ts +397 -0
- package/src/karin/platform/bilibili/danmaku.ts +653 -0
- package/src/karin/platform/bilibili/dynamic-text.ts +926 -0
- package/src/karin/platform/bilibili/genParams.ts +30 -0
- package/src/karin/platform/bilibili/getID.ts +163 -0
- package/src/karin/platform/bilibili/index.ts +8 -0
- package/src/karin/platform/bilibili/live-status.ts +36 -0
- package/src/karin/platform/bilibili/login.ts +130 -0
- package/src/karin/platform/bilibili/push.ts +1615 -0
- package/src/karin/platform/bilibili/riskControl.ts +114 -0
- package/src/karin/platform/bilibili/search.ts +305 -0
- package/src/karin/platform/common/danmaku-types.ts +18 -0
- package/src/karin/platform/douyin/comments.ts +404 -0
- package/src/karin/platform/douyin/danmaku.ts +1187 -0
- package/src/karin/platform/douyin/douyin.ts +1244 -0
- package/src/karin/platform/douyin/getID.ts +101 -0
- package/src/karin/platform/douyin/index.ts +8 -0
- package/src/karin/platform/douyin/login.ts +251 -0
- package/src/karin/platform/douyin/push/favorite.ts +97 -0
- package/src/karin/platform/douyin/push/index.ts +5 -0
- package/src/karin/platform/douyin/push/live.ts +86 -0
- package/src/karin/platform/douyin/push/post.ts +75 -0
- package/src/karin/platform/douyin/push/recommend.ts +96 -0
- package/src/karin/platform/douyin/push/render.ts +768 -0
- package/src/karin/platform/douyin/push/types.ts +41 -0
- package/src/karin/platform/douyin/push.ts +1241 -0
- package/src/karin/platform/douyin/types.ts +151 -0
- package/src/karin/platform/douyin/videoQuality.ts +234 -0
- package/src/karin/platform/douyin/workType.ts +238 -0
- package/src/karin/platform/index.ts +4 -0
- package/src/karin/platform/kuaishou/comments.ts +114 -0
- package/src/karin/platform/kuaishou/getID.ts +48 -0
- package/src/karin/platform/kuaishou/getdata.ts +78 -0
- package/src/karin/platform/kuaishou/index.ts +4 -0
- package/src/karin/platform/kuaishou/kuaishou.ts +130 -0
- package/src/karin/platform/xiaohongshu/comments.ts +227 -0
- package/src/karin/platform/xiaohongshu/getID.ts +127 -0
- package/src/karin/platform/xiaohongshu/index.ts +2 -0
- package/src/karin/platform/xiaohongshu/xiaohongshu.ts +733 -0
- package/src/karin/root.ts +78 -0
- package/src/karin/setup.ts +77 -0
- package/src/karin/types/config/amagi.ts +46 -0
- package/src/karin/types/config/app.ts +129 -0
- package/src/karin/types/config/bilibili.ts +121 -0
- package/src/karin/types/config/cookies.ts +11 -0
- package/src/karin/types/config/douyin.ts +93 -0
- package/src/karin/types/config/index.ts +41 -0
- package/src/karin/types/config/kuaishou.ts +10 -0
- package/src/karin/types/config/pushlist.ts +55 -0
- package/src/karin/types/config/request.ts +27 -0
- package/src/karin/types/config/upload.ts +49 -0
- package/src/karin/types/config/xiaohongshu.ts +24 -0
- package/src/karin/types/datatypes.ts +42 -0
- package/src/karin/types/index.ts +4 -0
- package/src/karin/types/netrorks/NetworksConfigType.ts +61 -0
- package/src/karin/types/netrorks/index.ts +1 -0
- package/src/karin/web.config.ts +48 -0
- package/src/ktr/registry.ts +55 -0
- package/src/ktr/template/_preview/components/PreviewInfoCard.tsx +33 -0
- package/src/ktr/template/_preview/components/PreviewLayout.tsx +65 -0
- package/src/ktr/template/_preview/components/PreviewVideoCard.tsx +22 -0
- package/src/ktr/template/_preview/render.ts +158 -0
- package/src/ktr/template/_preview/types.ts +15 -0
- package/src/ktr/template/_preview/utils/status.ts +29 -0
- package/src/ktr/template/_preview/utils/time.ts +8 -0
- package/src/ktr/template/bilibili/bangumi/components/bangumi.tsx +462 -0
- package/src/ktr/template/bilibili/bangumi/components/types.ts +36 -0
- package/src/ktr/template/bilibili/bangumi/index.tsx +9 -0
- package/src/ktr/template/bilibili/comment/components/Comment.tsx +657 -0
- package/src/ktr/template/bilibili/comment/components/types.ts +26 -0
- package/src/ktr/template/bilibili/comment/index.tsx +11 -0
- package/src/ktr/template/bilibili/components/Icons.tsx +209 -0
- package/src/ktr/template/bilibili/components/shared.tsx +162 -0
- package/src/ktr/template/bilibili/components/types.ts +388 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_ARTICLE/components/DYNAMIC_TYPE_ARTICLE.tsx +251 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_ARTICLE/components/types.ts +67 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_ARTICLE/index.tsx +12 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_AV/components/DYNAMIC_TYPE_AV.tsx +238 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_AV/components/types.ts +39 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_AV/index.tsx +12 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_DRAW/components/DYNAMIC_TYPE_DRAW.tsx +205 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_DRAW/components/types.ts +20 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_DRAW/index.tsx +11 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_FORWARD/components/DYNAMIC_TYPE_FORWARD.tsx +348 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_FORWARD/components/types.ts +16 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_FORWARD/index.tsx +12 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD/components/DYNAMIC_TYPE_LIVE_RCMD.tsx +264 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD/components/types.ts +32 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_LIVE_RCMD/index.tsx +12 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_WORD/components/DYNAMIC_TYPE_WORD.tsx +68 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_WORD/components/types.ts +14 -0
- package/src/ktr/template/bilibili/dynamic/DYNAMIC_TYPE_WORD/index.tsx +12 -0
- package/src/ktr/template/bilibili/dynamic/components/AdditionalCard.tsx +165 -0
- package/src/ktr/template/bilibili/dynamic/components/CommonComponents.tsx +142 -0
- package/src/ktr/template/bilibili/dynamic/types.ts +382 -0
- package/src/ktr/template/bilibili/qrcodeImg/components/qrcodeImg.tsx +179 -0
- package/src/ktr/template/bilibili/qrcodeImg/components/types.ts +9 -0
- package/src/ktr/template/bilibili/qrcodeImg/index.tsx +12 -0
- package/src/ktr/template/bilibili/userlist/components/UserList.tsx +246 -0
- package/src/ktr/template/bilibili/userlist/components/types.ts +35 -0
- package/src/ktr/template/bilibili/userlist/index.tsx +11 -0
- package/src/ktr/template/bilibili/videoInfo/components/types.ts +28 -0
- package/src/ktr/template/bilibili/videoInfo/components/videoInfo.tsx +217 -0
- package/src/ktr/template/bilibili/videoInfo/index.tsx +12 -0
- package/src/ktr/template/components/AmbientCover.tsx +50 -0
- package/src/ktr/template/components/DefaultLayout.tsx +166 -0
- package/src/ktr/template/components/GlowImage.tsx +572 -0
- package/src/ktr/template/components/QRCodeWithAvatar.tsx +52 -0
- package/src/ktr/template/components/RolldownLogo.tsx +110 -0
- package/src/ktr/template/components/ViteLogo.tsx +134 -0
- package/src/ktr/template/components/iconRegistry.ts +294 -0
- package/src/ktr/template/douyin/article-work/components/ArticleWork.tsx +301 -0
- package/src/ktr/template/douyin/article-work/components/types.ts +53 -0
- package/src/ktr/template/douyin/article-work/index.tsx +12 -0
- package/src/ktr/template/douyin/comment/components/Comment.tsx +612 -0
- package/src/ktr/template/douyin/comment/components/types.ts +85 -0
- package/src/ktr/template/douyin/comment/index.tsx +11 -0
- package/src/ktr/template/douyin/components/Icons.tsx +75 -0
- package/src/ktr/template/douyin/components/types.ts +83 -0
- package/src/ktr/template/douyin/dynamic/components/Dynamic.tsx +283 -0
- package/src/ktr/template/douyin/dynamic/components/types.ts +46 -0
- package/src/ktr/template/douyin/dynamic/index.tsx +11 -0
- package/src/ktr/template/douyin/favorite-list/components/FavoriteList.tsx +201 -0
- package/src/ktr/template/douyin/favorite-list/components/types.ts +38 -0
- package/src/ktr/template/douyin/favorite-list/index.tsx +12 -0
- package/src/ktr/template/douyin/image-work/components/ImageWork.tsx +437 -0
- package/src/ktr/template/douyin/image-work/components/types.ts +78 -0
- package/src/ktr/template/douyin/image-work/index.tsx +11 -0
- package/src/ktr/template/douyin/live/components/Live.tsx +229 -0
- package/src/ktr/template/douyin/live/components/types.ts +47 -0
- package/src/ktr/template/douyin/live/index.tsx +11 -0
- package/src/ktr/template/douyin/musicinfo/components/MusicInfo.tsx +187 -0
- package/src/ktr/template/douyin/musicinfo/components/types.ts +31 -0
- package/src/ktr/template/douyin/musicinfo/index.tsx +11 -0
- package/src/ktr/template/douyin/qrcodeImg/components/qrcodeImg.tsx +170 -0
- package/src/ktr/template/douyin/qrcodeImg/components/types.ts +9 -0
- package/src/ktr/template/douyin/qrcodeImg/index.tsx +9 -0
- package/src/ktr/template/douyin/recommend-list/components/RecommendList.tsx +201 -0
- package/src/ktr/template/douyin/recommend-list/components/types.ts +37 -0
- package/src/ktr/template/douyin/recommend-list/index.tsx +12 -0
- package/src/ktr/template/douyin/user_profile/components/UserVideoList.tsx +225 -0
- package/src/ktr/template/douyin/user_profile/components/types.ts +71 -0
- package/src/ktr/template/douyin/user_profile/index.tsx +9 -0
- package/src/ktr/template/douyin/userlist/components/UserList.tsx +229 -0
- package/src/ktr/template/douyin/userlist/components/types.ts +35 -0
- package/src/ktr/template/douyin/userlist/index.tsx +11 -0
- package/src/ktr/template/douyin/video-work/components/VideoWork.tsx +398 -0
- package/src/ktr/template/douyin/video-work/components/types.ts +80 -0
- package/src/ktr/template/douyin/video-work/index.tsx +11 -0
- package/src/ktr/template/font.css +6071 -0
- package/src/ktr/template/global.d.ts +69 -0
- package/src/ktr/template/kuaishou/comment/components/Comment.tsx +207 -0
- package/src/ktr/template/kuaishou/comment/components/types.ts +47 -0
- package/src/ktr/template/kuaishou/comment/index.tsx +11 -0
- package/src/ktr/template/other/changelog/components/changelog.tsx +411 -0
- package/src/ktr/template/other/changelog/components/types.ts +21 -0
- package/src/ktr/template/other/changelog/index.tsx +9 -0
- package/src/ktr/template/other/handlerError/components/errorTitles.ts +224 -0
- package/src/ktr/template/other/handlerError/components/handlerError.tsx +1076 -0
- package/src/ktr/template/other/handlerError/components/stackHighlight.ts +127 -0
- package/src/ktr/template/other/handlerError/components/types.ts +124 -0
- package/src/ktr/template/other/handlerError/index.tsx +9 -0
- package/src/ktr/template/other/help/components/Help.tsx +249 -0
- package/src/ktr/template/other/help/components/types.ts +47 -0
- package/src/ktr/template/other/help/index.tsx +9 -0
- package/src/ktr/template/other/live-photo-tip/components/LivePhotoTip.tsx +295 -0
- package/src/ktr/template/other/live-photo-tip/components/types.ts +8 -0
- package/src/ktr/template/other/live-photo-tip/index.tsx +9 -0
- package/src/ktr/template/other/qrlogin/components/qrlogin.tsx +295 -0
- package/src/ktr/template/other/qrlogin/components/types.ts +11 -0
- package/src/ktr/template/other/qrlogin/index.tsx +9 -0
- package/src/ktr/template/other/runtime/components/runtime.tsx +347 -0
- package/src/ktr/template/other/runtime/components/types.ts +75 -0
- package/src/ktr/template/other/runtime/index.tsx +9 -0
- package/src/ktr/template/other/version_warning/components/VersionWarning.tsx +392 -0
- package/src/ktr/template/other/version_warning/components/types.ts +8 -0
- package/src/ktr/template/other/version_warning/index.tsx +9 -0
- package/src/ktr/template/statistics/components/BoxplotGuide.tsx +57 -0
- package/src/ktr/template/statistics/components/ChartCard.tsx +40 -0
- package/src/ktr/template/statistics/components/KpiCard.tsx +39 -0
- package/src/ktr/template/statistics/components/PlatformTable.tsx +83 -0
- package/src/ktr/template/statistics/components/RankList.tsx +127 -0
- package/src/ktr/template/statistics/components/SSRChart.tsx +41 -0
- package/src/ktr/template/statistics/components/chartPresets.ts +700 -0
- package/src/ktr/template/statistics/components/chartTheme.ts +234 -0
- package/src/ktr/template/statistics/components/format.ts +33 -0
- package/src/ktr/template/statistics/components/types.ts +92 -0
- package/src/ktr/template/statistics/global/components/GlobalStatistics.tsx +597 -0
- package/src/ktr/template/statistics/global/components/types.ts +138 -0
- package/src/ktr/template/statistics/global/index.tsx +9 -0
- package/src/ktr/template/statistics/group/components/GroupStatistics.tsx +468 -0
- package/src/ktr/template/statistics/group/components/types.ts +113 -0
- package/src/ktr/template/statistics/group/index.tsx +9 -0
- package/src/ktr/template/style.css +65 -0
- package/src/ktr/template/types/ctx.ts +42 -0
- package/src/ktr/template/xiaohongshu/comment/components/Comment.tsx +264 -0
- package/src/ktr/template/xiaohongshu/comment/components/types.ts +119 -0
- package/src/ktr/template/xiaohongshu/comment/index.tsx +9 -0
- package/src/ktr/template/xiaohongshu/noteInfo/components/noteInfo.tsx +271 -0
- package/src/ktr/template/xiaohongshu/noteInfo/components/types.ts +66 -0
- package/src/ktr/template/xiaohongshu/noteInfo/index.tsx +9 -0
- package/src/ktr/utils/QRCodeAvatar.ts +102 -0
- package/src/ktr/utils/QRcode.ts +65 -0
- package/src/ktr/utils/avatarProxy.ts +42 -0
- package/src/ktr/utils/cn.ts +6 -0
- package/src/ktr/utils/theme.ts +10 -0
- package/src/qqFields.json +75 -0
- package/src/qqOptions.ts +64 -0
- package/src/richtext/index.ts +9 -0
- package/src/richtext/parse/index.ts +271 -0
- package/src/richtext/react/cn.ts +6 -0
- package/src/richtext/react/index.tsx +582 -0
- package/src/richtext/types.ts +320 -0
- package/src/schema.ts +372 -0
- package/src/webui.ts +352 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
import path from 'node:path'
|
|
3
|
+
import { fileURLToPath } from 'node:url'
|
|
4
|
+
|
|
5
|
+
import { Package } from 'node-karin'
|
|
6
|
+
|
|
7
|
+
const resolvePluginRoot = (startUrl: string) => {
|
|
8
|
+
let dir = path.dirname(startUrl)
|
|
9
|
+
for (let i = 0; i < 8; i++) {
|
|
10
|
+
const pkgPath = path.join(dir, 'package.json')
|
|
11
|
+
if (fs.existsSync(pkgPath)) {
|
|
12
|
+
return dir
|
|
13
|
+
}
|
|
14
|
+
const parent = path.dirname(dir)
|
|
15
|
+
if (parent === dir) break
|
|
16
|
+
dir = parent
|
|
17
|
+
}
|
|
18
|
+
return path.resolve(startUrl, '../..')
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Koishi 移植:编译为 CJS 后没有 import.meta,改用 __filename
|
|
22
|
+
const pluginPath = resolvePluginRoot(__filename)
|
|
23
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(pluginPath, 'package.json'), 'utf-8')) as Package
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 框架版本号。
|
|
27
|
+
*
|
|
28
|
+
* 上游 karin 用 `process.env.KARIN_VERSION`;Koishi 移植版里这个环境变量通常不存在,
|
|
29
|
+
* 于是各处(错误卡片、运行环境诊断海报)都会显示成字面量 `koishi-compat`,
|
|
30
|
+
* 卡片页脚看上去就是「vkoishi-compat」这种没意义的版本号。
|
|
31
|
+
* 这里改成报**真实运行框架的版本**:优先环境变量,其次 Koishi 自己的版本号。
|
|
32
|
+
*/
|
|
33
|
+
const resolveFrameworkVersion = (): string => {
|
|
34
|
+
if (process.env.KARIN_VERSION) return process.env.KARIN_VERSION
|
|
35
|
+
const candidates = ['koishi/package.json', '@koishijs/core/package.json']
|
|
36
|
+
for (const id of candidates) {
|
|
37
|
+
try {
|
|
38
|
+
// 编译产物是 CJS,这里的 require 能直接从插件的 node_modules 解析到宿主 koishi
|
|
39
|
+
const loaded = require(id)
|
|
40
|
+
const version = String(loaded?.version ?? '')
|
|
41
|
+
if (version) return version
|
|
42
|
+
} catch { /* 换下一个候选 */ }
|
|
43
|
+
}
|
|
44
|
+
// 兜底:从插件目录往上找宿主的 node_modules/koishi/package.json
|
|
45
|
+
try {
|
|
46
|
+
let dir = pluginPath
|
|
47
|
+
for (let i = 0; i < 8; i++) {
|
|
48
|
+
const candidate = path.join(dir, 'node_modules', 'koishi', 'package.json')
|
|
49
|
+
if (fs.existsSync(candidate)) {
|
|
50
|
+
const version = String(JSON.parse(fs.readFileSync(candidate, 'utf-8'))?.version ?? '')
|
|
51
|
+
if (version) return version
|
|
52
|
+
}
|
|
53
|
+
const parent = path.dirname(dir)
|
|
54
|
+
if (parent === dir) break
|
|
55
|
+
dir = parent
|
|
56
|
+
}
|
|
57
|
+
} catch { /* 忽略 */ }
|
|
58
|
+
return 'koishi-compat'
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const Root: {
|
|
62
|
+
/** 插件名字 */
|
|
63
|
+
pluginName: string
|
|
64
|
+
/** 插件版本号 */
|
|
65
|
+
pluginVersion: string
|
|
66
|
+
/** 插件路径 */
|
|
67
|
+
pluginPath: string
|
|
68
|
+
/** Karin版本 */
|
|
69
|
+
karinVersion: string
|
|
70
|
+
/** 插件package.json */
|
|
71
|
+
pkg: Package
|
|
72
|
+
} = {
|
|
73
|
+
pluginName: pkg.name,
|
|
74
|
+
pluginVersion: pkg.version,
|
|
75
|
+
pluginPath,
|
|
76
|
+
karinVersion: resolveFrameworkVersion(),
|
|
77
|
+
pkg
|
|
78
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import '@/module/server'
|
|
2
|
+
import '@/platform/bilibili/riskControl'
|
|
3
|
+
import karin, { AdapterType, BOT_CONNECT, config, ImageElement, logger, Message, mkdirSync, SendMessage } from 'node-karin'
|
|
4
|
+
import { karinPathBase } from 'node-karin/root'
|
|
5
|
+
|
|
6
|
+
import { Common, Render, Root } from '@/module'
|
|
7
|
+
import { initAllDatabases } from '@/module/db'
|
|
8
|
+
|
|
9
|
+
import { isSemverGreater } from './module/utils/semver'
|
|
10
|
+
|
|
11
|
+
declare const __REQUIRE_KARIN_VERSION__: string
|
|
12
|
+
|
|
13
|
+
// ----------------- VERSION CHECK -----------------
|
|
14
|
+
const requireVersion = typeof __REQUIRE_KARIN_VERSION__ !== 'undefined' ? __REQUIRE_KARIN_VERSION__ : '1.1145.14'
|
|
15
|
+
// const requireVersion = '1.14514.1'
|
|
16
|
+
if (process.env.NODE_ENV !== 'development' && isSemverGreater(requireVersion, Root.karinVersion)) {
|
|
17
|
+
const msg = `[koishi-plugin-kkk] 插件构建时的 karin 版本 (${requireVersion}) 高于当前运行版本 (${Root.karinVersion}),可能会出现兼容性问题!`
|
|
18
|
+
logger.warn(msg)
|
|
19
|
+
|
|
20
|
+
/** 已发送通知的 Bot ID 和主人 ID 组合,格式:`${botId}:${master}` */
|
|
21
|
+
const notifiedSet = new Set<string>()
|
|
22
|
+
|
|
23
|
+
karin.on(BOT_CONNECT, async (bot: AdapterType) => {
|
|
24
|
+
const botId = bot.selfId
|
|
25
|
+
|
|
26
|
+
// 跳过 console Bot
|
|
27
|
+
if (botId === 'console') return
|
|
28
|
+
|
|
29
|
+
// 增加延迟,确保 bot 完全初始化
|
|
30
|
+
await new Promise((resolve) => setTimeout(resolve, 2000))
|
|
31
|
+
const masters = config.master()
|
|
32
|
+
|
|
33
|
+
logger.info(`[koishi-plugin-kkk] 监测到 Bot 连接: ${botId}, 准备发送版本警告`)
|
|
34
|
+
|
|
35
|
+
// 生成警告图片
|
|
36
|
+
let warningImage: ImageElement[] | null = null
|
|
37
|
+
|
|
38
|
+
for (const master of masters) {
|
|
39
|
+
if (master === 'console') continue
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
warningImage = await Render({ bot: karin.getBot(botId) } as Message, 'other/version_warning', {
|
|
43
|
+
requireVersion,
|
|
44
|
+
currentVersion: Root.karinVersion
|
|
45
|
+
})
|
|
46
|
+
} catch (error) {
|
|
47
|
+
logger.error(`[koishi-plugin-kkk] 生成版本警告图片失败: ${error}`)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const key = `${botId}:${master}`
|
|
51
|
+
if (notifiedSet.has(key)) continue
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
const elements: SendMessage = []
|
|
55
|
+
if (warningImage) {
|
|
56
|
+
elements.push(...warningImage)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
await karin.sendMaster(botId, master, elements)
|
|
60
|
+
notifiedSet.add(key)
|
|
61
|
+
logger.info(`[koishi-plugin-kkk] 已发送版本警告给主人: ${master} (via ${botId})`)
|
|
62
|
+
} catch (error) {
|
|
63
|
+
logger.error(`[koishi-plugin-kkk] 发送版本警告给主人 (${master}) 失败: ${error}`)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// ----------------- DATABASE INIT -----------------
|
|
70
|
+
await initAllDatabases().catch((err) => {
|
|
71
|
+
logger.error(`[koishi-plugin-kkk] 数据库初始化失败: ${err.message}`)
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
// ------------------- MAIN INIT -------------------
|
|
75
|
+
mkdirSync(`${karinPathBase}/${Root.pluginName}/data`)
|
|
76
|
+
mkdirSync(Common.tempDri.images)
|
|
77
|
+
mkdirSync(Common.tempDri.video)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** amagi 解析库配置(合并了 cookies 和 request) */
|
|
2
|
+
export interface amagiConfig {
|
|
3
|
+
/** 请求超时时间,单位:毫秒 */
|
|
4
|
+
timeout: number
|
|
5
|
+
|
|
6
|
+
/** 浏览器用户代理 */
|
|
7
|
+
'User-Agent': string
|
|
8
|
+
|
|
9
|
+
/** 代理配置 */
|
|
10
|
+
proxy?: {
|
|
11
|
+
/** 代理开关 */
|
|
12
|
+
switch: boolean
|
|
13
|
+
/** 代理主机 */
|
|
14
|
+
host: string
|
|
15
|
+
/** 代理端口 */
|
|
16
|
+
port: number
|
|
17
|
+
/** 代理协议 */
|
|
18
|
+
protocol: 'http' | 'https'
|
|
19
|
+
/** 代理认证 */
|
|
20
|
+
auth?: {
|
|
21
|
+
/** 用户名 */
|
|
22
|
+
username: string
|
|
23
|
+
/** 密码 */
|
|
24
|
+
password: string
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** 各平台 Cookies */
|
|
29
|
+
cookies: {
|
|
30
|
+
/** B站ck */
|
|
31
|
+
bilibili: string
|
|
32
|
+
/** 抖音ck */
|
|
33
|
+
douyin: string
|
|
34
|
+
/** 快手ck */
|
|
35
|
+
kuaishou: string
|
|
36
|
+
/** 小红书ck */
|
|
37
|
+
xiaohongshu: string
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** API 服务开关 */
|
|
41
|
+
APIServer: boolean
|
|
42
|
+
/** API 服务是否挂载到 Karin */
|
|
43
|
+
APIServerMount: boolean
|
|
44
|
+
/** API 服务端口(未挂载时生效) */
|
|
45
|
+
APIServerPort: number
|
|
46
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/** 定义视频解析工具的配置接口 */
|
|
2
|
+
export interface appConfig {
|
|
3
|
+
/** 默认解析,即识别最高优先级,修改后重启生效 */
|
|
4
|
+
videoTool: boolean
|
|
5
|
+
|
|
6
|
+
/** 自定义优先级,「默认解析」关闭后才会生效。修改后重启生效 */
|
|
7
|
+
priority: number
|
|
8
|
+
|
|
9
|
+
/** 缓存自动删除,非必要不修改! */
|
|
10
|
+
removeCache: boolean
|
|
11
|
+
|
|
12
|
+
/** 渲染精度,可选值50~200,建议100。设置高精度会提高图片的精细度,过高可能会影响渲染与发送速度 */
|
|
13
|
+
renderScale: number
|
|
14
|
+
|
|
15
|
+
/** 渲染图片的主题色,0为自动,1为浅色,2为深色,3为智能场景(实验性,支持封面的模板会根据封面判断深浅色) */
|
|
16
|
+
Theme: number
|
|
17
|
+
|
|
18
|
+
/** 封面氛围背景参数:控制封面图对模板背景氛围的贡献度,取值均为 0~1 */
|
|
19
|
+
ambientCover: {
|
|
20
|
+
/** 模糊封面层不透明度:封面色强度总闸,越大整体越浓 */
|
|
21
|
+
coverOpacity: number
|
|
22
|
+
/** 主题色压色罩两端(顶/底)不透明度 */
|
|
23
|
+
overlayEdgeOpacity: number
|
|
24
|
+
/** 主题色压色罩中间带不透明度,越小封面色越透 */
|
|
25
|
+
overlayMiddleOpacity: number
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** 渲染图片的等待时间,单位:秒;传递0可禁用 */
|
|
29
|
+
RenderWaitTime: number
|
|
30
|
+
|
|
31
|
+
/** 表情回应,若适配器不支持需要关闭 */
|
|
32
|
+
EmojiReply: boolean
|
|
33
|
+
|
|
34
|
+
/** 解析提示,发送提示信息:"检测到xxx链接,开始解析" */
|
|
35
|
+
parseTip: boolean
|
|
36
|
+
|
|
37
|
+
/** 是否伪造合并转发消息,开启后使用触发者身份展示转发 */
|
|
38
|
+
fakeForward: boolean
|
|
39
|
+
|
|
40
|
+
// /**
|
|
41
|
+
// * 表情 ID
|
|
42
|
+
// * @see https://github.com/NapNeko/NapCatQQ/blob/main/packages/napcat-core/external/face_config.json
|
|
43
|
+
// */
|
|
44
|
+
// EmojiReplyID: number
|
|
45
|
+
|
|
46
|
+
// /** 忽略表情回应失败,开启后表情回应失败时不会抛出错误 */
|
|
47
|
+
// EmojiReplyIgnoreError: boolean
|
|
48
|
+
|
|
49
|
+
/** 遇到错误时谁会收到错误日志:触发者 / 管理员(权限等级 > 4) */
|
|
50
|
+
errorLogSendTo: Array<'trigger' | 'admin' | 'master' | 'allMasters'>
|
|
51
|
+
|
|
52
|
+
/** 分页渲染,将模板渲染成多页的图片,以降低渲染器压力,默认开启,非必要不修改 */
|
|
53
|
+
multiPageRender: boolean
|
|
54
|
+
|
|
55
|
+
/** 分页渲染时,每页的高度,经测试最佳每页高度为12000px,默认12000px */
|
|
56
|
+
multiPageHeight: number
|
|
57
|
+
|
|
58
|
+
/** 解析包含 Live Photo 作品时,发送的静态图兼容系统
|
|
59
|
+
* - 'google': Google Motion Photo 格式
|
|
60
|
+
* - 'xiaomi': 小米实况照片格式,兼容小米(支持实况照片的任何版本)和 Google,但无法被 OPPO 识别
|
|
61
|
+
* - 'oppo': OPPO 实况照片格式(推荐),兼容 OPPO、小米(较新版本)和 Google,兼容性最广
|
|
62
|
+
* - 'huawei_honor': 华为/荣耀实况照片格式(理论可行但未实测,作者无对应设备)
|
|
63
|
+
* 注:vivo(Origin OS)和 iPhone(iOS)需要独立的图片和同名视频文件,暂不支持
|
|
64
|
+
*/
|
|
65
|
+
livePhotoSystem: 'google' | 'xiaomi' | 'oppo' | 'huawei_honor'
|
|
66
|
+
|
|
67
|
+
/** 解析遇到实况图时的处理和发送方式
|
|
68
|
+
* - 'video_and_livephoto': 生成并发送仿 iPhone Live Photo 播放效果的视频(播放三次,性能开销大,2C2G 服务器约 20s/张)+ 对应系统的实况图
|
|
69
|
+
* - 'video_only': 仅生成并发送仿 iPhone Live Photo 播放效果的视频(播放三次,性能开销大,2C2G 服务器约 20s/张)
|
|
70
|
+
* - 'livephoto_only': 仅生成并发送对应系统的实况图
|
|
71
|
+
*/
|
|
72
|
+
livePhotoMode: 'video_and_livephoto' | 'video_only' | 'livephoto_only'
|
|
73
|
+
|
|
74
|
+
/** 扫码登录时使用的地址类型,可选值:'lan'(局域网IP)、'external'(外部地址) */
|
|
75
|
+
qrLoginAddrType: 'lan' | 'external'
|
|
76
|
+
|
|
77
|
+
/** 外部访问地址(当 qrLoginAddrType 为 'external' 时使用,可以是公网IP或域名) */
|
|
78
|
+
qrLoginExternalAddr: string
|
|
79
|
+
|
|
80
|
+
// ============ 以下字段从 uploadConfig 合并 ============
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* 本地视频发送方式
|
|
84
|
+
* - 'file': 使用 file 协议发送本地视频(需 Karin 与协议端在同一系统)
|
|
85
|
+
* - 'base64': 转换为 base64 后发送(传输数据量增大约 30%,不在同一网络环境可能导致额外带宽成本)
|
|
86
|
+
*/
|
|
87
|
+
videoSendMode: 'file' | 'base64'
|
|
88
|
+
|
|
89
|
+
/** 视频上传拦截,开启后会根据视频文件大小判断是否需要上传,需配置「视频拦截阈值」。 */
|
|
90
|
+
usefilelimit: boolean
|
|
91
|
+
|
|
92
|
+
/** 视频拦截阈值,视频文件大于该数值则直接结束任务,不会上传,单位: MB,「视频上传拦截」开启后才会生效。 */
|
|
93
|
+
filelimit: number
|
|
94
|
+
|
|
95
|
+
/** 压缩视频,开启后会将视频文件压缩后再上传,适合上传大文件,任务过程中会吃满CPU,对低配服务器不友好。需配置「压缩触发阈值」与「压缩后的值」 */
|
|
96
|
+
compress: boolean
|
|
97
|
+
|
|
98
|
+
/** 压缩触发阈值,触发视频压缩的阈值,单位:MB。当文件大小超过该值时,才会压缩视频,「压缩视频」开启后才会生效 */
|
|
99
|
+
compresstrigger: number
|
|
100
|
+
|
|
101
|
+
/** 压缩后的值,单位:MB。若视频文件大小大于「压缩触发阈值」的值,则会进行压缩至该值(±5%),「压缩视频」开启后才会生效 */
|
|
102
|
+
compressvalue: number
|
|
103
|
+
|
|
104
|
+
/** 群文件上传,使用群文件上传,开启后会将视频文件上传到群文件中,需配置「群文件上传阈值」 */
|
|
105
|
+
usegroupfile: boolean
|
|
106
|
+
|
|
107
|
+
/** 群文件上传阈值,当文件大小超过该值时将使用群文件上传,单位:MB,「使用群文件上传」开启后才会生效 */
|
|
108
|
+
groupfilevalue: number
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* 网络图片发送方式
|
|
112
|
+
* - 'url': 直接传递 HTTP 链接给上游下载(可能因上游网络问题导致下载超时)
|
|
113
|
+
* - 'file': 下载到本地使用 file 协议发送(需 Karin 与协议端在同一系统)
|
|
114
|
+
* - 'base64': 下载后转换为 base64 发送(传输数据量增大约 30%,不在同一网络环境可能导致额外带宽成本)
|
|
115
|
+
*/
|
|
116
|
+
imageSendMode: 'url' | 'file' | 'base64'
|
|
117
|
+
|
|
118
|
+
/** 下载限速开关,开启后会限制下载速度,避免触发服务器风控导致连接被重置 */
|
|
119
|
+
downloadThrottle: boolean
|
|
120
|
+
|
|
121
|
+
/** 下载速度限制,单位:MB/s,0 表示不限速。建议设置为 5-20 之间,过高可能触发风控 */
|
|
122
|
+
downloadMaxSpeed: number
|
|
123
|
+
|
|
124
|
+
/** 断流自动降速,当检测到连接被重置时自动降低下载速度 */
|
|
125
|
+
downloadAutoReduce: boolean
|
|
126
|
+
|
|
127
|
+
/** 最低下载速度,单位:MB/s,自动降速时不会低于此值 */
|
|
128
|
+
downloadMinSpeed: number
|
|
129
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/** 定义B站解析工具的配置接口 */
|
|
2
|
+
export interface bilibiliConfig {
|
|
3
|
+
/** B站解析开关,单独开关,受「总开关」影响 */
|
|
4
|
+
switch: boolean
|
|
5
|
+
|
|
6
|
+
/** 解析时发送的内容,可选值:'info'(视频信息)、'comment'(评论图片)、'video'(视频文件) */
|
|
7
|
+
sendContent: ['info' | 'comment' | 'video']
|
|
8
|
+
|
|
9
|
+
/** B站评论数量,设置接口返回的评论数量,范围1 ~ x 条 */
|
|
10
|
+
numcomment: number
|
|
11
|
+
|
|
12
|
+
/** 评论图是否显示真实评论数量,关闭则显示解析到的评论数量 */
|
|
13
|
+
realCommentCount: boolean
|
|
14
|
+
|
|
15
|
+
/** 是否收集评论区的图片 */
|
|
16
|
+
commentImageCollection: boolean
|
|
17
|
+
|
|
18
|
+
/** 视频画质偏好设置,0 为自动根据大小选择,其他为固定画质
|
|
19
|
+
* - 0: 自动根据大小选择
|
|
20
|
+
* - 6: 240P 极速 (仅MP4格式支持)
|
|
21
|
+
* - 16: 360P 流畅
|
|
22
|
+
* - 32: 480P 清晰
|
|
23
|
+
* - 64: 720P 高清 (WEB默认值)
|
|
24
|
+
* - 74: 720P60 高帧率 (需登录)
|
|
25
|
+
* - 80: 1080P 高清 (TV/APP默认值,需登录)
|
|
26
|
+
* - 112: 1080P+ 高码率 (需大会员)
|
|
27
|
+
* - 116: 1080P60 高帧率 (需大会员)
|
|
28
|
+
* - 120: 4K 超清 (需大会员且支持4K)
|
|
29
|
+
* - 127: 8K 超高清 (需大会员且支持8K)
|
|
30
|
+
*/
|
|
31
|
+
videoQuality: 0 | 6 | 16 | 32 | 64 | 74 | 80 | 112 | 116 | 120 | 127
|
|
32
|
+
|
|
33
|
+
/** 视频体积上限,自动画质模式下可接受的最大视频大小(单位:MB),仅在 「videoQuality」 为 0 时生效 */
|
|
34
|
+
maxAutoVideoSize: number
|
|
35
|
+
|
|
36
|
+
/** 谁可以触发扫码登录,all为所有人,admin为管理员,master为主人,group.owner为群主,group.admin为群管理员。修改后需重启 */
|
|
37
|
+
loginPerm: 'all' | 'admin' | 'master' | 'group.owner' | 'group.admin'
|
|
38
|
+
|
|
39
|
+
/** 解析图文动态时,遇到多张图片时的页面布局方式(动态推送图片也生效):
|
|
40
|
+
* - 'vertical'(逐张上下排列)
|
|
41
|
+
* - 'waterfall'(瀑布流排列)
|
|
42
|
+
* - 'grid'(九宫格排列)
|
|
43
|
+
* - 'auto'(自动布局:少于4张时逐张上下排列;4~8张时瀑布流;9张及以上九宫格) */
|
|
44
|
+
imageLayout: 'vertical' | 'waterfall' | 'grid' | 'auto'
|
|
45
|
+
|
|
46
|
+
/** 视频信息返回形式:
|
|
47
|
+
* - 'text'(文本模式)
|
|
48
|
+
* - 'image'(图片模式) */
|
|
49
|
+
videoInfoMode: 'text' | 'image'
|
|
50
|
+
|
|
51
|
+
/** 视频信息的内容,可选值:'cover'(封面)、'title'(标题)、'author'(作者)、'stats'(视频统计信息)、'desc'(简介),数组为空则不显示任何内容 */
|
|
52
|
+
displayContent: ('cover' | 'title' | 'author' | 'stats' | 'desc')[]
|
|
53
|
+
|
|
54
|
+
/** 视频信息图片中显示弹幕(仅「视频信息返回形式」为图片模式时生效,关闭后不会请求弹幕数据) */
|
|
55
|
+
showDanmakuInVideoInfo: boolean
|
|
56
|
+
|
|
57
|
+
/** 弹幕烧录(将弹幕硬编码到视频画面中,需要重新编码视频) */
|
|
58
|
+
burnDanmaku: boolean
|
|
59
|
+
|
|
60
|
+
/** 弹幕显示区域(限制弹幕范围,避免遮挡视频主体)
|
|
61
|
+
* - 0.25: 1/4 屏,仅顶部区域
|
|
62
|
+
* - 0.5: 半屏,上半部分(推荐)
|
|
63
|
+
* - 0.75: 3/4 屏,大部分区域
|
|
64
|
+
* - 1: 全屏,铺满整个画面
|
|
65
|
+
*/
|
|
66
|
+
danmakuArea: 0.25 | 0.5 | 0.75 | 1
|
|
67
|
+
|
|
68
|
+
/** 弹幕字号
|
|
69
|
+
* - 'small': 小号
|
|
70
|
+
* - 'medium': 中号(推荐)
|
|
71
|
+
* - 'large': 大号
|
|
72
|
+
*/
|
|
73
|
+
danmakuFontSize: 'small' | 'medium' | 'large'
|
|
74
|
+
|
|
75
|
+
/** 弹幕透明度(0-100,0为完全透明,100为完全不透明) */
|
|
76
|
+
danmakuOpacity: number
|
|
77
|
+
|
|
78
|
+
/** 竖屏适配模式(模拟手机端竖屏观看体验)
|
|
79
|
+
* - 'off': 关闭,保持原始视频比例
|
|
80
|
+
* - 'standard': 智能模式,仅对 16:9、21:9 等常见宽屏比例生效
|
|
81
|
+
* - 'force': 强制 9:16,所有视频统一转为竖屏,弹幕大小一致
|
|
82
|
+
*/
|
|
83
|
+
verticalMode: 'off' | 'standard' | 'force'
|
|
84
|
+
|
|
85
|
+
/** 视频编码格式
|
|
86
|
+
* - 'h264': 兼容性最好,支持几乎所有设备
|
|
87
|
+
* - 'h265': 压缩率更高,近几年设备支持良好(默认)
|
|
88
|
+
* - 'av1': 最新编码格式,压缩率最高,但编码较慢
|
|
89
|
+
*/
|
|
90
|
+
videoCodec: 'h264' | 'h265' | 'av1'
|
|
91
|
+
|
|
92
|
+
/** B站推送相关配置 */
|
|
93
|
+
push: {
|
|
94
|
+
/** 推送开关,开启后需重启;使用「#设置B站推送 + 用户UID」配置推送列表 */
|
|
95
|
+
switch: boolean
|
|
96
|
+
/** 谁可以设置推送,all为所有人,admin为管理员,master为主人,group.owner为群主,group.admin为群管理员。修改后需重启 */
|
|
97
|
+
permission: 'all' | 'admin' | 'master' | 'group.owner' | 'group.admin'
|
|
98
|
+
/** 推送表达式 */
|
|
99
|
+
cron: string
|
|
100
|
+
/** 推送时是否一同解析该动态 */
|
|
101
|
+
parsedynamic: boolean
|
|
102
|
+
/** 开启推送解析后,需要进一步解析的动态类型 */
|
|
103
|
+
parseDynamicTypes: ('DYNAMIC_TYPE_AV' | 'DYNAMIC_TYPE_DRAW' | 'DYNAMIC_TYPE_ARTICLE')[]
|
|
104
|
+
/** 推送时遇到视频动态时解析的画质偏好设置,0 为自动根据「pushMaxAutoVideoSize」大小选择,其他为固定画质,仅「parsedynamic」为 true 时生效
|
|
105
|
+
* - 0: 自动根据大小选择
|
|
106
|
+
* - 6: 240P 极速 (仅MP4格式支持)
|
|
107
|
+
* - 16: 360P 流畅
|
|
108
|
+
* - 32: 480P 清晰
|
|
109
|
+
* - 64: 720P 高清 (WEB默认值)
|
|
110
|
+
* - 74: 720P60 高帧率 (需登录)
|
|
111
|
+
* - 80: 1080P 高清 (TV/APP默认值,需登录)
|
|
112
|
+
* - 112: 1080P+ 高码率 (需大会员)
|
|
113
|
+
* - 116: 1080P60 高帧率 (需大会员)
|
|
114
|
+
* - 120: 4K 超清 (需大会员且支持4K)
|
|
115
|
+
*/
|
|
116
|
+
pushVideoQuality: 0 | 6 | 16 | 32 | 64 | 74 | 80 | 112 | 116 | 120
|
|
117
|
+
|
|
118
|
+
/** 推送时遇到视频动态时解析的视频体积上限,自动画质模式下可接受的最大视频大小(单位:MB),仅在 「pushVideoQuality」 为 0 且「parsedynamic」为 true时生效 */
|
|
119
|
+
pushMaxAutoVideoSize: number
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/** 定义抖音解析工具的配置接口 */
|
|
2
|
+
export interface douyinConfig {
|
|
3
|
+
/** 抖音解析开关,单独开关,受「总开关」影响 */
|
|
4
|
+
switch: boolean
|
|
5
|
+
|
|
6
|
+
/** 解析时发送的内容,可选值:'info'(视频信息)、'comment'(评论图片)、'video'(视频文件) */
|
|
7
|
+
sendContent: ['info' | 'comment' | 'video']
|
|
8
|
+
|
|
9
|
+
/** 抖音评论数量,范围1 ~ x 条 */
|
|
10
|
+
numcomment: number
|
|
11
|
+
|
|
12
|
+
/** 次级评论请求数量,范围1 ~ x 条,最高尽量 8 条左右,当前逻辑无法判断请求的来的评论的嵌套深度,超过深度的评论会被截断 */
|
|
13
|
+
subCommentLimit: number
|
|
14
|
+
|
|
15
|
+
/** 是否收集评论区的图片 */
|
|
16
|
+
commentImageCollection: boolean
|
|
17
|
+
|
|
18
|
+
/** 合辑 Live 图 BGM 合并模式
|
|
19
|
+
* - 'continuous': 连续模式,BGM 接续播放
|
|
20
|
+
* - 'independent': 独立模式,每张图 BGM 从头开始
|
|
21
|
+
*/
|
|
22
|
+
liveImageMergeMode: 'continuous' | 'independent'
|
|
23
|
+
|
|
24
|
+
/** 视频画质偏好设置,'adapt' 为自动根据「maxAutoVideoSize」大小选择,其他为固定画质 */
|
|
25
|
+
videoQuality: 'adapt' | '540p' | '720p' | '1080p' | '2k' | '4k'
|
|
26
|
+
|
|
27
|
+
/** 视频体积上限,自动画质模式下可接受的最大视频大小(单位:MB),仅在 「videoQuality」 为 'adapt' 时生效 */
|
|
28
|
+
maxAutoVideoSize: number
|
|
29
|
+
|
|
30
|
+
/** 谁可以触发扫码登录,all为所有人,admin为管理员,master为主人,group.owner为群主,group.admin为群管理员。修改后需重启 */
|
|
31
|
+
loginPerm: 'all' | 'admin' | 'master' | 'group.owner' | 'group.admin'
|
|
32
|
+
|
|
33
|
+
/** 视频信息返回形式:
|
|
34
|
+
* - 'text'(文本模式)
|
|
35
|
+
* - 'image'(图片模式) */
|
|
36
|
+
videoInfoMode: 'text' | 'image'
|
|
37
|
+
|
|
38
|
+
/** 视频信息的内容,可选值:'cover'(封面)、'title'(标题)、'author'(作者)、'stats'(视频统计信息),数组为空则不显示任何内容 */
|
|
39
|
+
displayContent: ('cover' | 'title' | 'author' | 'stats')[]
|
|
40
|
+
|
|
41
|
+
/** 弹幕烧录(将弹幕硬编码到视频画面中,需要重新编码视频) */
|
|
42
|
+
burnDanmaku: boolean
|
|
43
|
+
|
|
44
|
+
/** 弹幕显示区域(限制弹幕范围,避免遮挡视频主体)
|
|
45
|
+
* - 0.25: 1/4 屏,仅顶部区域
|
|
46
|
+
* - 0.5: 半屏,上半部分(推荐)
|
|
47
|
+
* - 0.75: 3/4 屏,大部分区域
|
|
48
|
+
* - 1: 全屏,铺满整个画面
|
|
49
|
+
*/
|
|
50
|
+
danmakuArea: 0.25 | 0.5 | 0.75 | 1
|
|
51
|
+
|
|
52
|
+
/** 弹幕字号
|
|
53
|
+
* - 'small': 小号
|
|
54
|
+
* - 'medium': 中号(推荐)
|
|
55
|
+
* - 'large': 大号
|
|
56
|
+
*/
|
|
57
|
+
danmakuFontSize: 'small' | 'medium' | 'large'
|
|
58
|
+
|
|
59
|
+
/** 弹幕透明度(0-100,0为完全透明,100为完全不透明) */
|
|
60
|
+
danmakuOpacity: number
|
|
61
|
+
|
|
62
|
+
/** 横屏转竖屏模式(针对横屏视频)
|
|
63
|
+
* - 'off': 关闭,保持原始比例
|
|
64
|
+
* - 'standard': 智能模式,仅对宽高比 ≥1.7 的横屏视频转竖屏
|
|
65
|
+
* - 'force': 强制 9:16,所有视频统一转为竖屏
|
|
66
|
+
*/
|
|
67
|
+
verticalMode: 'off' | 'standard' | 'force'
|
|
68
|
+
|
|
69
|
+
/** 视频编码格式
|
|
70
|
+
* - 'h264': 兼容性最好,支持几乎所有设备
|
|
71
|
+
* - 'h265': 压缩率更高,近几年设备支持良好(默认)
|
|
72
|
+
* - 'av1': 最新编码格式,压缩率最高,但编码较慢
|
|
73
|
+
*/
|
|
74
|
+
videoCodec: 'h264' | 'h265' | 'av1'
|
|
75
|
+
|
|
76
|
+
/** 抖音推送相关配置 */
|
|
77
|
+
push: {
|
|
78
|
+
/** 推送开关,开启后需重启;使用「#设置抖音推送 + 抖音号」配置推送列表 */
|
|
79
|
+
switch: boolean
|
|
80
|
+
/** 谁可以设置推送,all为所有人,admin为管理员,master为主人,group.owner为群主,group.admin为群管理员。修改后需重启 */
|
|
81
|
+
permission: 'all' | 'admin' | 'master' | 'group.owner' | 'group.admin'
|
|
82
|
+
/** 推送表达式 */
|
|
83
|
+
cron: string
|
|
84
|
+
/** 推送时是否一同解析该作品 */
|
|
85
|
+
parsedynamic: boolean
|
|
86
|
+
/** 分享链接二维码的类型,web为跳转到抖音网页,download为视频下载直链 */
|
|
87
|
+
shareType: 'web' | 'download'
|
|
88
|
+
/** 推送解析时视频画质偏好设置,'adapt' 为自动根据「maxAutoVideoSize」大小选择,其他为固定画质 */
|
|
89
|
+
pushVideoQuality: 'adapt' | '540p' | '720p' | '1080p' | '2k' | '4k'
|
|
90
|
+
/** 推送解析时视频体积上限,自动画质模式下可接受的最大视频大小(单位:MB),仅在 「videoQuality」 为 'adapt' 时生效 */
|
|
91
|
+
pushMaxAutoVideoSize: number
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { amagiConfig } from './amagi'
|
|
2
|
+
import { appConfig } from './app'
|
|
3
|
+
import { bilibiliConfig } from './bilibili'
|
|
4
|
+
import { cookiesConfig } from './cookies'
|
|
5
|
+
import { douyinConfig } from './douyin'
|
|
6
|
+
import { kuaishouConfig } from './kuaishou'
|
|
7
|
+
import { pushlistConfig } from './pushlist'
|
|
8
|
+
import { requestConfig } from './request'
|
|
9
|
+
import { uploadConfig } from './upload'
|
|
10
|
+
import { xiaohongshuConfig } from './xiaohongshu'
|
|
11
|
+
|
|
12
|
+
/** 插件配置类型 */
|
|
13
|
+
export interface ConfigType {
|
|
14
|
+
/** amagi 解析库配置 */
|
|
15
|
+
amagi: amagiConfig
|
|
16
|
+
/** 插件应用设置 */
|
|
17
|
+
app: appConfig
|
|
18
|
+
/** bilibili 相关设置 */
|
|
19
|
+
bilibili: bilibiliConfig
|
|
20
|
+
/** 抖音相关设置 */
|
|
21
|
+
douyin: douyinConfig
|
|
22
|
+
/** 快手相关设置 */
|
|
23
|
+
kuaishou: kuaishouConfig
|
|
24
|
+
/** 小红书相关设置 */
|
|
25
|
+
xiaohongshu: xiaohongshuConfig
|
|
26
|
+
/** 推送列表 */
|
|
27
|
+
pushlist: pushlistConfig
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type {
|
|
31
|
+
amagiConfig,
|
|
32
|
+
appConfig,
|
|
33
|
+
bilibiliConfig,
|
|
34
|
+
cookiesConfig,
|
|
35
|
+
douyinConfig,
|
|
36
|
+
kuaishouConfig,
|
|
37
|
+
pushlistConfig,
|
|
38
|
+
requestConfig,
|
|
39
|
+
uploadConfig,
|
|
40
|
+
xiaohongshuConfig
|
|
41
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** 推送内容类型 */
|
|
2
|
+
export type DouyinPushType = 'post' | 'favorite' | 'recommend' | 'live'
|
|
3
|
+
|
|
4
|
+
/** B站推送动态类型 */
|
|
5
|
+
export type BilibiliPushType = 'video' | 'draw' | 'word' | 'live' | 'forward' | 'article'
|
|
6
|
+
|
|
7
|
+
/** 定义推送列表项的接口 */
|
|
8
|
+
export type douyinPushItem = {
|
|
9
|
+
/** 是否启用 */
|
|
10
|
+
switch: boolean
|
|
11
|
+
/** sec_uid,与short_id二选一 */
|
|
12
|
+
sec_uid: string
|
|
13
|
+
/** 抖音号,与sec_uid二选一 */
|
|
14
|
+
short_id: string
|
|
15
|
+
/** 推送群号和机器人账号,多个则使用逗号隔开,必填。如:群号1:机器人账号1 */
|
|
16
|
+
group_id: string[]
|
|
17
|
+
/** 博主或UP主的名字信息,可不填 */
|
|
18
|
+
remark: string
|
|
19
|
+
/** 推送类型:作品列表、喜欢列表、推荐列表、直播,默认为作品列表 */
|
|
20
|
+
pushTypes?: DouyinPushType[]
|
|
21
|
+
/** 黑名单:命中不推送;白名单:命中才推送 */
|
|
22
|
+
filterMode?: 'blacklist' | 'whitelist'
|
|
23
|
+
/** 指定关键词 */
|
|
24
|
+
Keywords?: string[]
|
|
25
|
+
/** 指定标签 */
|
|
26
|
+
Tags?: string[]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** 定义推送列表项的接口 */
|
|
30
|
+
export type bilibiliPushItem = {
|
|
31
|
+
/** 是否启用 */
|
|
32
|
+
switch: boolean
|
|
33
|
+
/** B站用户的UID,必填 */
|
|
34
|
+
host_mid: number
|
|
35
|
+
/** 推送群号和机器人账号,多个则使用逗号隔开,必填。如:群号1:机器人账号1 */
|
|
36
|
+
group_id: string[]
|
|
37
|
+
/** 博主或UP主的名字信息,可不填 */
|
|
38
|
+
remark: string
|
|
39
|
+
/** 推送类型:投稿视频、图文动态、纯文动态、直播动态、转发动态、投稿专栏,默认全部 */
|
|
40
|
+
pushTypes?: BilibiliPushType[]
|
|
41
|
+
/** 黑名单:命中不推送;白名单:命中才推送 */
|
|
42
|
+
filterMode?: 'blacklist' | 'whitelist'
|
|
43
|
+
/** 指定关键词 */
|
|
44
|
+
Keywords?: string[]
|
|
45
|
+
/** 指定标签 */
|
|
46
|
+
Tags?: string[]
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** 定义抖音和B站推送列表的接口 */
|
|
50
|
+
export type pushlistConfig = {
|
|
51
|
+
/** 抖音推送列表的接口 */
|
|
52
|
+
douyin: douyinPushItem[]
|
|
53
|
+
/** B站推送列表的接口 */
|
|
54
|
+
bilibili: bilibiliPushItem[]
|
|
55
|
+
}
|