feat(route): add NEW字幕组指定剧集 (#7022)
This commit is contained in:
parent
45eff8ea5a
commit
4e52a65ed0
|
|
@ -477,6 +477,14 @@ pageClass: routes
|
|||
|
||||
</Route>
|
||||
|
||||
### 指定剧集
|
||||
|
||||
<Route author="nczitzk" example="/newzmz/view/qEzRyY3v" path="/newzmz/view/:id?" :paramsDesc="['剧集 id,可在剧集下载页 URL 中找到']">
|
||||
|
||||
如:雪国列车(剧版)的下载页 URL 为 `https://ysfx.tv/view/qEzRyY3v.html`,即剧集 id 为 `qEzRyY3v`。
|
||||
|
||||
</Route>
|
||||
|
||||
## Nyaa
|
||||
|
||||
### 搜索结果
|
||||
|
|
|
|||
|
|
@ -3888,7 +3888,8 @@ router.get('/feed-the-beast/modpack/:modpackEntry', require('./routes/feed-the-b
|
|||
router.get('/gab/user/:username', require('./routes/gab/user'));
|
||||
router.get('/gab/popular/:sort?', require('./routes/gab/explore'));
|
||||
|
||||
// NEW字幕组
|
||||
// NEW 字幕组
|
||||
router.get('/newzmz/view/:id', require('./routes/newzmz/view'));
|
||||
router.get('/newzmz/:category?', require('./routes/newzmz/index'));
|
||||
|
||||
// Phrack Magazine
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const id = ctx.params.id;
|
||||
|
||||
const rootUrl = `https://ysfx.tv`;
|
||||
const currentUrl = `${rootUrl}/view/${id}.html`;
|
||||
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: currentUrl,
|
||||
});
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
$('img, .link-name').remove();
|
||||
|
||||
$('a[title]').each(function () {
|
||||
$(this).text($(this).attr('title'));
|
||||
});
|
||||
|
||||
const list = $('.team-con-area')
|
||||
.map((_, item) => {
|
||||
item = $(item);
|
||||
const link = item.find('a[data-target="#down-modal"]').eq(0).attr('href');
|
||||
|
||||
return {
|
||||
link,
|
||||
enclosure_url: link,
|
||||
enclosure_type: 'application/x-bittorrent',
|
||||
title: item.find('.item-content').text(),
|
||||
description: `<ul>${item.find('.team-icons').html()}</ul>`,
|
||||
};
|
||||
})
|
||||
.get();
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${$('.page-header-content .title').text()} - NEW字幕组`,
|
||||
link: currentUrl,
|
||||
item: list,
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue