diff --git a/docs/multimedia.md b/docs/multimedia.md index cecbc5403..c9df98a1e 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -389,6 +389,12 @@ BT 之家的域名会变更,本路由以 为默认 +## 注视影视 + +### 更新通知 + + + ## Hentaimama ### 近期更新 diff --git a/lib/v2/gaze/maintainer.js b/lib/v2/gaze/maintainer.js new file mode 100644 index 000000000..863472a9b --- /dev/null +++ b/lib/v2/gaze/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/update/:mid': ['zytomorrow'], +}; diff --git a/lib/v2/gaze/radar.js b/lib/v2/gaze/radar.js new file mode 100644 index 000000000..96de41f19 --- /dev/null +++ b/lib/v2/gaze/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'gaze.run': { + _name: '注视影视', + '.': [ + { + title: '更新通知', + docs: 'https://docs.rsshub.app//multimedia.html#gaze-run', + source: ['/play/:mid'], + target: (params) => `/gaze/update/${params.mid}`, + }, + ], + }, +}; diff --git a/lib/v2/gaze/router.js b/lib/v2/gaze/router.js new file mode 100644 index 000000000..49eaf43c5 --- /dev/null +++ b/lib/v2/gaze/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/update/:mid', require('./update')); +}; diff --git a/lib/v2/gaze/templates/update.art b/lib/v2/gaze/templates/update.art new file mode 100644 index 000000000..919f938ec --- /dev/null +++ b/lib/v2/gaze/templates/update.art @@ -0,0 +1,4 @@ +
+ {{ data.name }}已于{{ data.update_time }}更新第{{ data.episodes }}集。
+ 观看地址:{{ data.name }}第{{ data.episodes }}集 +
diff --git a/lib/v2/gaze/update.js b/lib/v2/gaze/update.js new file mode 100644 index 000000000..11e75a764 --- /dev/null +++ b/lib/v2/gaze/update.js @@ -0,0 +1,27 @@ +const got = require('@/utils/got'); +const { art } = require('@/utils/render'); +const path = require('path'); +const { parseDate } = require('@/utils/parse-date'); +const timezone = require('@/utils/timezone') + +// 站长提供的API +const rootUrl = 'https://gaze.run/3e47b75000b0924b6c9ba5759a7cf15d'; + +module.exports = async (ctx) => { + const mid = ctx.params.mid; + const response = await got.post(rootUrl, { form: { mid } }); + const data = response.data.data; + + ctx.state.data = { + title: `gaze.run影视更新通知 - ${data.name}`, + link: `https://gaze.run/play/${mid}`, + item: [ + { + title: `${data.name}-第${data.episodes}集`, + description: art(path.resolve(__dirname, './templates/update.art'), { data }), + link: `https://gaze.run/play/${mid}`, + pubDate: timezone(parseDate(data.update_time), +8), + }, + ], + }; +};