diff --git a/lib/v2/iqilu/maintainer.js b/lib/v2/iqilu/maintainer.js
new file mode 100644
index 000000000..fcaa86e3c
--- /dev/null
+++ b/lib/v2/iqilu/maintainer.js
@@ -0,0 +1,3 @@
+module.exports = {
+ '/v/category?': ['nczitzk'],
+};
diff --git a/lib/v2/iqilu/program.js b/lib/v2/iqilu/program.js
new file mode 100644
index 000000000..e05fcbdc1
--- /dev/null
+++ b/lib/v2/iqilu/program.js
@@ -0,0 +1,98 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+const { parseDate } = require('@/utils/parse-date');
+const { art } = require('@/utils/render');
+const path = require('path');
+
+module.exports = async (ctx) => {
+ const { category = 'sdws/sdxwlb' } = ctx.params;
+ const limit = ctx.query.limit ? parseInt(ctx.query.limit, 10) : 30;
+
+ const rootUrl = 'http://v.iqilu.com';
+ const currentUrl = new URL(category, rootUrl).href;
+
+ const { data: response } = await got(currentUrl);
+
+ const $ = cheerio.load(response);
+
+ let items = $('#jmzhanshi1 dl')
+ .slice(0, limit)
+ .toArray()
+ .map((item) => {
+ item = $(item);
+
+ const a = item.find('a').first();
+ const image = item.find('img').first();
+
+ item.find('dd').last().remove();
+
+ return {
+ title: a.prop('title'),
+ link: a.prop('href'),
+ description: art(path.join(__dirname, 'templates/description.art'), {
+ image: {
+ src: image.prop('src'),
+ alt: image.prop('alt'),
+ },
+ }),
+ pubDate: parseDate(
+ item
+ .find('dd')
+ .last()
+ .text()
+ .match(/(\d{4}-\d{2}-\d{2})/)[1]
+ ),
+ itunes_item_image: image.prop('src'),
+ };
+ });
+
+ items = await Promise.all(
+ items.map((item) =>
+ ctx.cache.tryGet(item.link, async () => {
+ const { data: detailResponse } = await got(item.link);
+
+ const content = cheerio.load(detailResponse);
+
+ item.title = content('div.vtitle').text();
+ item.enclosure_url = content('#copy_mp4text').prop('value');
+ item.enclosure_type = item.enclosure_url ? `video/${item.enclosure_url.split(/\./).pop()}` : undefined;
+
+ item.description = art(path.join(__dirname, 'templates/description.art'), {
+ image: {
+ src: item.itunes_item_image,
+ alt: item.title,
+ },
+ video: {
+ src: item.enclosure_url,
+ type: item.enclosure_type,
+ },
+ description: content('div.vinfo').text().trim(),
+ });
+
+ return item;
+ })
+ )
+ );
+
+ const icon = new URL($('link[rel="icon"]').prop('href'), rootUrl).href;
+ const author = $('div.host_pic dl dd a')
+ .toArray()
+ .map((a) => $(a).text())
+ .join('/');
+
+ ctx.state.data = {
+ item: items,
+ title: $('title').text(),
+ link: currentUrl,
+ description: $('meta[name="description"]').prop('content'),
+ language: $('html').prop('lang'),
+ image: $('div.s_logo img').prop('src'),
+ icon,
+ logo: icon,
+ subtitle: $('meta[name="keywords"]').prop('content'),
+ author,
+ itunes_author: author,
+ itunes_category: 'News',
+ allowEmpty: true,
+ };
+};
diff --git a/lib/v2/iqilu/radar.js b/lib/v2/iqilu/radar.js
new file mode 100644
index 000000000..065e84886
--- /dev/null
+++ b/lib/v2/iqilu/radar.js
@@ -0,0 +1,107 @@
+module.exports = {
+ 'iqilu.com': {
+ _name: '齐鲁网',
+ v: [
+ {
+ title: '电视节目',
+ docs: 'https://docs.rsshub.app/routes/traditional-media#qi-lu-wang-dian-shi-jie-mu',
+ source: ['/:category*'],
+ target: (params) => {
+ const category = params.category;
+
+ return `/iqilu/v${category ? `/${category}` : ''}`;
+ },
+ },
+ {
+ title: '山东新闻联播',
+ docs: 'https://docs.rsshub.app/routes/traditional-media#qi-lu-wang-dian-shi-jie-mu',
+ source: ['/sdws/sdxwlb'],
+ target: '/iqilu/v/sdws/sdxwlb',
+ },
+ {
+ title: '闪电大视野',
+ docs: 'https://docs.rsshub.app/routes/traditional-media#qi-lu-wang-dian-shi-jie-mu',
+ source: ['/ggpd/sddsy'],
+ target: '/iqilu/v/ggpd/sddsy',
+ },
+ {
+ title: '山东三农新闻联播',
+ docs: 'https://docs.rsshub.app/routes/traditional-media#qi-lu-wang-dian-shi-jie-mu',
+ source: ['/nkpd/snxw'],
+ target: '/iqilu/v/nkpd/snxw',
+ },
+ {
+ title: '每日新闻',
+ docs: 'https://docs.rsshub.app/routes/traditional-media#qi-lu-wang-dian-shi-jie-mu',
+ source: ['/qlpd/mrxw'],
+ target: '/iqilu/v/qlpd/mrxw',
+ },
+ {
+ title: '新闻午班车',
+ docs: 'https://docs.rsshub.app/routes/traditional-media#qi-lu-wang-dian-shi-jie-mu',
+ source: ['/ggpd/xwwbc'],
+ target: '/iqilu/v/ggpd/xwwbc',
+ },
+ {
+ title: '戏宇宙',
+ docs: 'https://docs.rsshub.app/routes/traditional-media#qi-lu-wang-dian-shi-jie-mu',
+ source: ['/sdws/xyz/'],
+ target: '/iqilu/v/sdws/xyz/',
+ },
+ {
+ title: '中国礼 中国乐',
+ docs: 'https://docs.rsshub.app/routes/traditional-media#qi-lu-wang-dian-shi-jie-mu',
+ source: ['/qlpd/zglzgy'],
+ target: '/iqilu/v/qlpd/zglzgy',
+ },
+ {
+ title: '超级语文课',
+ docs: 'https://docs.rsshub.app/routes/traditional-media#qi-lu-wang-dian-shi-jie-mu',
+ source: ['/sdws/cjywk'],
+ target: '/iqilu/v/sdws/cjywk',
+ },
+ {
+ title: '文物里的山东',
+ docs: 'https://docs.rsshub.app/routes/traditional-media#qi-lu-wang-dian-shi-jie-mu',
+ source: ['/yspd/wwldsd'],
+ target: '/iqilu/v/yspd/wwldsd',
+ },
+ {
+ title: '拉呱',
+ docs: 'https://docs.rsshub.app/routes/traditional-media#qi-lu-wang-dian-shi-jie-mu',
+ source: ['/qlpd/l0'],
+ target: '/iqilu/v/qlpd/l0',
+ },
+ {
+ title: '生活帮',
+ docs: 'https://docs.rsshub.app/routes/traditional-media#qi-lu-wang-dian-shi-jie-mu',
+ source: ['/shpd/shb'],
+ target: '/iqilu/v/shpd/shb',
+ },
+ {
+ title: '快乐大赢家',
+ docs: 'https://docs.rsshub.app/routes/traditional-media#qi-lu-wang-dian-shi-jie-mu',
+ source: ['/zypd/kldyj'],
+ target: '/iqilu/v/zypd/kldyj',
+ },
+ {
+ title: '乡村季风',
+ docs: 'https://docs.rsshub.app/routes/traditional-media#qi-lu-wang-dian-shi-jie-mu',
+ source: ['/nkpd/xcjf'],
+ target: '/iqilu/v/nkpd/xcjf',
+ },
+ {
+ title: '健康是1',
+ docs: 'https://docs.rsshub.app/routes/traditional-media#qi-lu-wang-dian-shi-jie-mu',
+ source: ['/ggpd/jks1'],
+ target: '/iqilu/v/ggpd/jks1',
+ },
+ {
+ title: '此时此刻',
+ docs: 'https://docs.rsshub.app/routes/traditional-media#qi-lu-wang-dian-shi-jie-mu',
+ source: ['/sdws/cishicike'],
+ target: '/iqilu/v/sdws/cishicike',
+ },
+ ],
+ },
+};
diff --git a/lib/v2/iqilu/router.js b/lib/v2/iqilu/router.js
new file mode 100644
index 000000000..0f8a24a90
--- /dev/null
+++ b/lib/v2/iqilu/router.js
@@ -0,0 +1,3 @@
+module.exports = (router) => {
+ router.get('/v/:category*', require('./program'));
+};
diff --git a/lib/v2/iqilu/templates/description.art b/lib/v2/iqilu/templates/description.art
new file mode 100644
index 000000000..df4b1523c
--- /dev/null
+++ b/lib/v2/iqilu/templates/description.art
@@ -0,0 +1,24 @@
+{{ if image && !video }}
+
+
{{ description }}
+{{ /if }} diff --git a/website/docs/routes/traditional-media.md b/website/docs/routes/traditional-media.md index adcd75bbd..e47d80e95 100644 --- a/website/docs/routes/traditional-media.md +++ b/website/docs/routes/traditional-media.md @@ -2205,6 +2205,32 @@ category 对应的关键词有 +## 齐鲁网 {#qi-lu-wang} + +### 电视节目 {#qi-lu-wang-dian-shi-jie-mu} + +