feat(route): add olevod.one (#15405)
* feat(route): add olevod.one * fix: feed category --------- Co-authored-by: root <root@debian.st>
This commit is contained in:
parent
715bad0663
commit
6f97f7a113
|
|
@ -0,0 +1,6 @@
|
|||
import type { Namespace } from '@/types';
|
||||
|
||||
export const namespace: Namespace = {
|
||||
name: '欧乐影院',
|
||||
url: 'olevod.one',
|
||||
};
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
import { Route } from '@/types';
|
||||
import { load } from 'cheerio';
|
||||
import ofetch from '@/utils/ofetch';
|
||||
|
||||
export const route: Route = {
|
||||
path: '/vod/:id',
|
||||
categories: ['multimedia'],
|
||||
example: '/olevod/vod/202449091',
|
||||
parameters: { id: '视频id号' },
|
||||
radar: [
|
||||
{
|
||||
source: ['www.olevod.one/vod/:id'],
|
||||
target: '/vod/:id',
|
||||
},
|
||||
],
|
||||
name: '视频',
|
||||
maintainers: ['fang63625'],
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const urlBase = 'https://www.olevod.one';
|
||||
const id = ctx.req.param('id');
|
||||
const url = `${urlBase}/vod/${id}`;
|
||||
|
||||
const response = await ofetch(url);
|
||||
const $ = load(response);
|
||||
|
||||
const title = $('.title.scookie').text().trim();
|
||||
const image = $('.vodlist_thumb.lazyload').attr('data-original');
|
||||
const items = $('.content_playlist.clearfix a')
|
||||
.toArray()
|
||||
.map((item) => {
|
||||
const tmp = $(item);
|
||||
const href = urlBase + tmp.attr('href');
|
||||
|
||||
return {
|
||||
title: `${title} ${tmp.text()}`,
|
||||
link: href,
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
title,
|
||||
link: url,
|
||||
item: items,
|
||||
image: urlBase + image,
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
import { Route } from '@/types';
|
||||
import { load } from 'cheerio';
|
||||
import ofetch from '@/utils/ofetch';
|
||||
|
||||
export const route: Route = {
|
||||
path: '/vodlist',
|
||||
categories: ['multimedia'],
|
||||
example: '/olevod/vodlist',
|
||||
radar: [
|
||||
{
|
||||
source: ['www.olevod.one'],
|
||||
target: '/vodlist',
|
||||
},
|
||||
],
|
||||
name: '最新视频',
|
||||
maintainers: ['fang63625'],
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler() {
|
||||
const urlBase = 'https://www.olevod.one';
|
||||
const title = '欧乐影院 最新视频';
|
||||
|
||||
const response = await ofetch(urlBase);
|
||||
const $ = load(response);
|
||||
|
||||
const items = $('.cbox1 .vodlist_thumb.lazyload')
|
||||
.toArray()
|
||||
.map((item) => {
|
||||
const tmp = $(item);
|
||||
const href = urlBase + tmp.attr('href');
|
||||
const title = tmp.attr('title');
|
||||
const image = urlBase + tmp.attr('data-original');
|
||||
|
||||
return {
|
||||
title: `${title} ${tmp.find('.pic_text.text_right').text()}`,
|
||||
link: href,
|
||||
image,
|
||||
description: `豆瓣评分 ${tmp.find('.text_right.text_dy').text()}`,
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
title,
|
||||
link: urlBase,
|
||||
item: items,
|
||||
};
|
||||
}
|
||||
Loading…
Reference in New Issue