diff --git a/docs/README.md b/docs/README.md index 7501029e3..32d95632e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1153,6 +1153,10 @@ GitHub 官方也提供了一些 RSS: +### ebb.io + + + ## 程序更新 ### RSSHub diff --git a/lib/router.js b/lib/router.js index 9bc37c81b..6e142b8c4 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1034,4 +1034,7 @@ router.get('/animen/news/:type', require('./routes/animen/news')); // D2 资源库 router.get('/d2/daily', require('./routes/d2/daily')); +// ebb +router.get('/ebb', require('./routes/ebb')); + module.exports = router; diff --git a/lib/routes/ebb/index.js b/lib/routes/ebb/index.js new file mode 100644 index 000000000..3fb0933b1 --- /dev/null +++ b/lib/routes/ebb/index.js @@ -0,0 +1,21 @@ +const axios = require('../../utils/axios'); +const lzstring = require('lz-string'); +module.exports = async (ctx) => { + const url = 'https://ebb.io/_/anime_list'; + const response = await axios({ + method: 'get', + url: url, + headers: { + Referer: url, + }, + return: 'string', + }); + const responseData = JSON.parse(lzstring.decompressFromUTF16(response.data)); + const result = responseData.map((item) => ({ + title: item.name_chi, + link: `https://ebb.io/anime/${item.anime_id}x${item.season_id}`, + description: `${item.season_title} - ${item.episode_title}`, + guid: `${item.anime_id}-${item.season_id}-${item.episode_title}`, + })); + ctx.state.data = { title: 'ebb.io', link: 'https://ebb.io', description: '最新連載', item: result }; +}; diff --git a/package.json b/package.json index 1daadffd6..05b7287a5 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "koa-router": "7.4.0", "lru-cache": "5.1.1", "luxon": "^1.7.1", + "lz-string": "^1.4.4", "markdown-it": "^8.4.2", "node-fetch": "^2.3.0", "path-to-regexp": "3.0.0", diff --git a/yarn.lock b/yarn.lock index 4f279c44c..be04d48d1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6318,6 +6318,11 @@ luxon@^1.7.1: resolved "https://registry.yarnpkg.com/luxon/-/luxon-1.10.0.tgz#335b55e2fed50e09f869aee828897a3f67c7044e" integrity sha512-ry3GKh//v3isD6oJN5pFWmdh+3GiScwv9q8VgG6fZ2j1guGOol2vVVdo4GBAWCrcq5RHOqSeipqHBnOu/u024Q== +lz-string@^1.4.4: + version "1.4.4" + resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26" + integrity sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY= + make-dir@^1.0.0, make-dir@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c"