Files
RSSHub/lib/v2/cw/sub.js
T
2024-02-29 17:33:33 +08:00

20 lines
630 B
JavaScript

const { baseUrl, parsePage } = require('./utils');
import puppeteer from '@/utils/puppeteer';
module.exports = async (ctx) => {
const browser = await puppeteer();
const { $, items } = await parsePage('sub', browser, ctx);
await browser.close();
ctx.set('data', {
title: $('head title').text(),
description: $('meta[name=description]').attr('content'),
link: `${baseUrl}/subchannel.action?idSubChannel=${ctx.req.param('channel')}`,
image: `${baseUrl}/assets_new/img/fbshare.jpg`,
language: $('meta[property="og:locale"]').attr('content'),
item: items,
});
};