Skip to content

Commit df3950c

Browse files
authored
Merge pull request #940 from DIYgod/master
[pull] master from diygod:master
2 parents d70bd4e + 3b5d4d2 commit df3950c

File tree

13 files changed

+103
-43
lines changed

13 files changed

+103
-43
lines changed

docs/en/install/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ resolved by the SOCKS server, recommanded, prevents DNS poisoning or DNS leak),
529529

530530
#### Proxy options
531531

532-
`PROXY_PROTOCOL`: Using proxy, supports socks, http, https, etc. See [socks-proxy-agent](https://www.npmjs.com/package/socks-proxy-agent) NPM package page and [source](https://github.com/TooTallNate/node-socks-proxy-agent/blob/master/src/agent.ts) for what these protocols mean. See also [cURL OOTW: SOCKS5](https://daniel.haxx.se/blog/2020/05/26/curl-ootw-socks5/) for reference.
532+
`PROXY_PROTOCOL`: Using proxy, supports socks, http, https, etc. See [socks-proxy-agent](https://www.npmjs.com/package/socks-proxy-agent) NPM package page and [source](https://github.com/TooTallNate/proxy-agents/blob/63adbcefdb4783cc67c0eb90200886b4064e8639/packages/socks-proxy-agent/src/index.ts#L81) for what these protocols mean. See also [cURL OOTW: SOCKS5](https://daniel.haxx.se/blog/2020/05/26/curl-ootw-socks5/) for reference.
533533

534534
`PROXY_HOST`: host or IP of the proxy
535535

docs/en/multimedia.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ Official RSS: <https://eztv.io/ezrss.xml>
153153

154154
<RouteEn author="everyonus" example="/hentaimama/videos" path="/hentaimama/videos" />
155155

156+
## IBC 岩手放送
157+
158+
### イヤーマイッタマイッタ
159+
160+
<RouteEn author="fengkx" example="/ibc/maitta" path="/ibc/maitta" supportPodcast="1" radar="1"/>
161+
156162
## JavBus
157163

158164
::: tip Language

docs/install/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ RSSHub 支持 `memory` 和 `redis` 两种缓存方式
514514

515515
#### 代理 URI
516516

517-
`PROXY_URI`: 代理 URI,支持 socks4, socks5(本地查询域名的 SOCKS5,不推荐使用), socks5h(传域名的 SOCKS5,推荐使用,以防止 DNS 污染或 DNS 泄露), http, https,具体以[socks-proxy-agent](https://www.npmjs.com/package/socks-proxy-agent) NPM 包的支持为准,也可参考[curl 中 SOCKS 代理协议的用法](https://daniel.haxx.se/blog/2020/05/26/curl-ootw-socks5/)。
517+
`PROXY_URI`: 代理 URI,支持 socks4, socks5(本地查询域名的 SOCKS5,不推荐使用), socks5h(传域名的 SOCKS5,推荐使用,以防止 DNS 污染或 DNS 泄露), http, https,具体以 [socks-proxy-agent](https://www.npmjs.com/package/socks-proxy-agent) NPM 包的支持为准,也可参考[curl 中 SOCKS 代理协议的用法](https://daniel.haxx.se/blog/2020/05/26/curl-ootw-socks5/)。
518518

519519
> 代理 URI 的格式为:
520520
>

docs/multimedia.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,12 @@ BT 之家的域名会变更,本路由以 <https://www.btbtt20.com> 为默认
524524

525525
<Route author="everyonus" example="/hentaimama/videos" path="/hentaimama/videos" />
526526

527+
## IBC 岩手放送
528+
529+
### イヤーマイッタマイッタ
530+
531+
<Route author="fengkx" example="/ibc/maitta" path="/ibc/maitta" supportPodcast="1" radar="1"/>
532+
527533
## JavBus
528534

529535
::: tip 提示
@@ -1357,12 +1363,6 @@ JavDB 有多个备用域名,本路由默认使用永久域名 <https://javdb.c
13571363

13581364
</Route>
13591365

1360-
## 播客 IBC 岩手放送| IBC ラジオ イヤーマイッタマイッタ
1361-
1362-
### IBC 岩手放送| IBC ラジオ イヤーマイッタマイッタ
1363-
1364-
<Route author="fengkx" example="/maitta" path="/maitta" supportPodcast="1" />
1365-
13661366
## 草榴社区
13671367

13681368
### 分区帖子

lib/router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ router.get('/ui-cn/user/:id', lazyloadRouteHandler('./routes/ui-cn/user'));
13601360
router.get('/juesheng', lazyloadRouteHandler('./routes/juesheng'));
13611361

13621362
// 播客IBCラジオ イヤーマイッタマイッタ
1363-
router.get('/maitta', lazyloadRouteHandler('./routes/maitta'));
1363+
// router.get('/maitta', lazyloadRouteHandler('./routes/maitta'));
13641364

13651365
// 一些博客
13661366
// 敬维-以认真的态度做完美的事情: https://jingwei.link/

lib/utils/request-wrapper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ const https = require('https');
77
let agent = null;
88
if (proxyUri) {
99
if (proxyUri.startsWith('http')) {
10-
const HttpsProxyAgent = require('https-proxy-agent');
10+
const { HttpsProxyAgent } = require('https-proxy-agent');
1111
agent = new HttpsProxyAgent(proxyUri);
1212
} else if (proxyUri.startsWith('socks')) {
13-
const SocksProxyAgent = require('socks-proxy-agent').SocksProxyAgent;
13+
const { SocksProxyAgent } = require('socks-proxy-agent');
1414
agent = new SocksProxyAgent(proxyUri);
1515
}
1616
}

lib/v2/ibc/maintainer.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
'/maitta': ['fengkx'],
3+
};
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
const got = require('@/utils/got');
22
const cheerio = require('cheerio');
33
const url = 'https://www.ibc.co.jp/radio/maitta/audio/';
4+
const { parseDate } = require('@/utils/parse-date');
45

56
module.exports = async (ctx) => {
6-
const res = await got.get(url);
7+
const res = await got(url);
78
const $ = cheerio.load(res.data);
8-
const items = $('.broadcast').get();
9+
const items = $('.up').toArray();
910
ctx.state.data = {
1011
title: 'IBCラジオ イヤーマイッタマイッタ|IBC岩手放送',
1112
link: 'http://www.ibc.co.jp/radio/maitta/audio',
1213
description: $('meta[name=description]').attr('content'),
1314
itunes_author: '水越アナと大塚アナ',
14-
image: 'https://cdn.ibc.co.jp/radio/maitta/audio/images/og.png',
15+
image: 'https://cdn.ibc.co.jp/radio/maitta/audio/images/header.png',
1516
language: 'ja',
1617
item: items.map((item) => {
1718
item = $(item);
19+
const link = new URL(item.find('a').attr('href'), url).href;
20+
const uid = link.match(/\/(\d+)\/$/)[1];
1821
return {
1922
title: item.find('h3').text(),
20-
description: item.find('.linecontent').text().trim(),
21-
link: `https:${item.find('a').first().attr('href').split('?')[0]}`,
22-
pubDate: new Date(item.find('.onairdate').text().split('日')[0].replace(/|/g, '-')).toUTCString(),
23-
itunes_item_image: 'https://cdn.ibc.co.jp/radio/maitta/audio/images/og.png',
24-
enclosure_url: `https:${item.find('a').first().attr('href').split('?')[0]}`, // 音频链接
23+
description: item.find('.audio_intro').text().trim(),
24+
link,
25+
pubDate: parseDate(item.find('.onair_date').text().split('日')[0].replace(/|/g, '-')),
26+
itunes_item_image: 'https://assets.blubrry.com/coverart/300/357155.png',
27+
enclosure_url: `https://media-data.cdn.ibc.co.jp/out/sound/28_${uid}/28_${uid}.mp3`, // 音频链接
2528
enclosure_type: 'audio/mpeg',
2629
};
2730
}),

lib/v2/ibc/radar.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
'ibc.co.jp': {
3+
_name: 'IBC 岩手放送',
4+
'.': [
5+
{
6+
title: 'イヤーマイッタマイッタ',
7+
docs: 'https://docs.rsshub.app/multimedia.html#ibc-yan-shou-fang-song',
8+
source: ['/radio/maitta/audio', '/'],
9+
target: '/ibc/maitta',
10+
},
11+
],
12+
},
13+
};

lib/v2/ibc/router.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = (router) => {
2+
router.get('/maitta', require('./maitta'));
3+
};

0 commit comments

Comments
 (0)