fix conflict

This commit is contained in:
user 2021-01-12 15:29:45 +08:00
commit 04381990be
21 changed files with 559 additions and 66 deletions

View File

@ -1,6 +1,6 @@
<!--
请不要删除, 自行修改已有结构, 这会导致自动检测失败;不符合要求的部分留空即可
请不要删除, 自行修改已有结构/注释, 这会导致自动检测失败;不符合要求的部分留空即可
Do not remove existing titles or structures: it breaks CI
@ -25,13 +25,9 @@ Please fill the `routes` block follow the format below, as we will perform autom
```
如果与路由无关, 请写`NOROUTE`
```
NOROUTE
```
-->
<!-- 在下方填写 FILL BELOW -->
<!-- 在下方填写, 请不要删除`routes`标识: CI验证需要. FILL BELOW and keep `routes` keyword -->
```routes
```

View File

@ -2,9 +2,11 @@ name: PR route test
# https://github.com/actions/first-interaction/issues/10#issuecomment-670968624
# https://github.com/actions/first-interaction/issues/10#issuecomment-752360668
# Reopen Included
on:
- pull_request_target
jobs:
testRoute:
runs-on: ubuntu-latest

View File

@ -2035,6 +2035,82 @@
},
],
},
'141jav.com': {
_name: '141JAV BT',
'.': [
{
title: '今日种子',
docs: 'https://docs.rsshub.app/multimedia.html#141jav',
source: '/',
target: (params, url, document) => {
const today = document.querySelector('div.card.mb-1.card-overview').getAttribute('data-date').replace(/-/g, '');
return `/141jav/day/${today}`;
},
},
{
title: '今日演员',
docs: 'https://docs.rsshub.app/multimedia.html#141jav',
source: '/',
target: (params, url, document) => {
const star = document.querySelector('div.card-content > div > a').getAttribute('href');
return `/141jav${star}`;
},
},
{
title: '页面种子',
docs: 'https://docs.rsshub.app/multimedia.html#141jav',
source: ['/:type', '/:type/:key', '/:type/:key/:morekey'],
target: (params, url, document) => {
const itype = params.morekey === undefined ? `${params.type}` : params.type === 'tag' ? 'tag' : 'day';
let ikey = `${itype === 'day' ? params.type : ''}${params.key || ''}${itype === 'tag' && params.morekey !== undefined ? '%2F' : ''}${params.morekey || ''}`;
if (ikey === '' && itype === 'tag') {
ikey = document.querySelector('div.thumbnail.is-inline > a').getAttribute('href').replace('/tag/', '').replace('/', '%2F');
} else if (ikey === '' && itype === 'actress') {
ikey = document.querySelector('div.card > a').getAttribute('href').replace('/actress/', '');
}
return `/141jav/${itype}/${ikey}`;
},
},
],
},
'141ppv.com': {
_name: '141ppv BT',
'.': [
{
title: '今日种子',
docs: 'https://docs.rsshub.app/multimedia.html#141pvp',
source: '/',
target: (params, url, document) => {
const today = document.querySelector('div.card.mb-1.card-overview').getAttribute('data-date').replace(/-/g, '');
return `/141ppv/day/${today}`;
},
},
{
title: '今日演员',
docs: 'https://docs.rsshub.app/multimedia.html#141ppv',
source: '/',
target: (params, url, document) => {
const star = document.querySelector('div.card-content > div > a').getAttribute('href');
return `/141ppv${star}`;
},
},
{
title: '页面种子',
docs: 'https://docs.rsshub.app/multimedia.html#141ppv',
source: ['/:type', '/:type/:key', '/:type/:key/:morekey'],
target: (params, url, document) => {
const itype = params.morekey === undefined ? `${params.type}` : params.type === 'tag' ? 'tag' : 'day';
let ikey = `${itype === 'day' ? params.type : ''}${params.key || ''}${itype === 'tag' && params.morekey !== undefined ? '%2F' : ''}${params.morekey || ''}`;
if (ikey === '' && itype === 'tag') {
ikey = document.querySelector('div.thumbnail.is-inline > a').getAttribute('href').replace('/tag/', '').replace('/', '%2F');
} else if (ikey === '' && itype === 'actress') {
ikey = document.querySelector('div.card > a').getAttribute('href').replace('/actress/', '');
}
return `/141ppv/${itype}/${ikey}`;
},
},
],
},
'sexinsex.net': {
_name: 'sexinsex',
'.': [

View File

@ -288,7 +288,7 @@ pageClass: routes
### 风之动漫
<Route author="geeeeoff" path="/fzdm/manhua/:id" example="/fzdm/manhua/39" :paramsDesc="['漫画ID']"/>
<Route author="geeeeoff zytomorrow" path="/fzdm/manhua/:id/:nums?" example="/fzdm/manhua/39/2" :paramsDesc="['漫画ID', '最新的n话, 默认为最新1话']" anticrawler="1"/>
## 海猫吧

View File

@ -34,6 +34,16 @@ pageClass: routes
<RouteEn author="maple3142" example="/facebook/page/SonetPCR" path="/facebook/page/:id" :paramsDesc="['page id']" anticrawler="1"/>
## Gab
### User's Posts
<RouteEn author="zphw" example="/gab/user/realdonaldtrump" path="/gab/user/:username" :paramsDesc="['Username']" />
### Popular Posts
<RouteEn author="zphw" example="/gab/popular/hot" path="/gab/popular/:sort?" :paramsDesc="['Sort by, `hot` to be Hot Posts and `top` to be Top Posts. Default: hot']" />
## Instagram
::: warning

View File

@ -520,7 +520,7 @@ RSSHub 支持使用访问密钥 / 码,白名单和黑名单三种方式进行
- `BILIBILI_COOKIE_{uid}`: 对应 uid 的 b 站用户登录后的 Cookie 值,`{uid}` 替换为 uid`BILIBILI_COOKIE_2267573`,获取方式:
1. 打开 <https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/dynamic_new?uid=0&type=8>
2. 打开控制台,切换到 Network 面板,刷新
3. 点击 dynamic_new 请求,找到 Cookie
3. 点击 dynamic_new 请求,找到 Cookie。(Key`SESSDATA`)
- 语雀 全部路由:[注册地址](https://www.yuque.com/register)

View File

@ -4,6 +4,102 @@ pageClass: routes
# 音视频
## 141JAV
::: tip 提示
官方提供的订阅源不支持 BT 下载订阅,地址为 <https://141jav.com/feeds/>
:::
### 141JAV BT
<Route author="cgkings" example="/141jav/popular/30" path="/141jav/:type/:key?" :paramsDesc="['类型', '关键词']" supportBT="1" radar="1">
**类型**
| 最新 | 热门 | 随机 | 指定演员 | 指定标签 | 指定日期 |
| ---- | ------- | ------ | -------- | -------- | -------- |
| new | popular | random | actress | tag | day |
**关键词**
| 空 | 日期范围 | 演员名 | 标签名 | 日期 |
| -- | ----------- | ------------ | -------------- | -------- |
| | 7 / 30 / 60 | Yua%20Mikami | Adult%20Awards | YYYYMMDD |
**示例说明**
- `/141jav/new`
仅当类型为 `new` `popular``random` 时关键词可为 **空**
- `/141jav/popular/30`
`popular` `random` 类型的关键词可填写 `7` `30``60` 三个 **日期范围** 之一
- `/141jav/actress/Yua%20Mikami`
`actress` 类型的关键词必须填写 **演员名** ,可在 [此处](https://141jav.com/actress/) 演员单页链接中获取
- `/141jav/tag/Adult%20Awards`
`tag` 类型的关键词必须填写 **标签名** 且标签中的 `/` 必须替换为 `%2F` ,可在 [此处](https://141jav.com/tag/) 标签单页链接中获取
- `/141jav/day/20200730`
`day` 类型的关键词必须填写 **日期** ,按照示例写成形如 `20200730` 的格式
</Route>
## 141PPV
::: tip 提示
官方提供的订阅源不支持 BT 下载订阅,地址为 <https://141ppv.com/feeds/>
:::
### 141PPV BT
<Route author="cgkings" example="/141ppv/popular/30" path="/141ppv/:type/:key?" :paramsDesc="['类型', '关键词']" supportBT="1" radar="1">
**类型**
| 最新 | 热门 | 随机 | 指定演员 | 指定标签 | 指定日期 |
| ---- | ------- | ------ | -------- | -------- | -------- |
| new | popular | random | actress | tag | day |
**关键词**
| 空 | 日期范围 | 演员名 | 标签名 | 日期 |
| -- | ----------- | ------------ | -------------- | -------- |
| | 7 / 30 / 60 | Yua%20Mikami | Adult%20Awards | YYYYMMDD |
**示例说明**
- `/141ppv/new`
仅当类型为 `new` `popular``random` 时关键词可为 **空**
- `/141ppv/popular/30`
`popular` `random` 类型的关键词可填写 `7` `30``60` 三个 **日期范围** 之一
- `/141ppv/actress/Yua%20Mikami`
`actress` 类型的关键词必须填写 **演员名** ,可在 [此处](https://141ppv.com/actress/) 演员单页链接中获取
- `/141ppv/tag/Adult%20Awards`
`tag` 类型的关键词必须填写 **标签名** 且标签中的 `/` 必须替换为 `%2F` ,可在 [此处](https://141ppv.com/tag/) 标签单页链接中获取
- `/141ppv/day/20200730`
`day` 类型的关键词必须填写 **日期** ,按照示例写成形如 `20200730` 的格式
</Route>
## 2048 核基地
### 论坛更新
@ -344,6 +440,18 @@ pageClass: routes
<Route author="hoilc" example="/mqube/tag/UTAU" path="/mqube/tag/:tag" :paramsDesc="['标签名称, 可参考`https://mqube.net/search/tag`']" radar="1" rssbud="1"/>
## NEW 字幕组
### 分类
<Route author="nczitzk" example="/newzmz" path="/newzmz/:category?" :paramsDesc="['分类,见下表,默认为最近更新']">
| 最近更新 | 剧集推荐 | 电影推荐 | 纪录片推荐 | 动画推荐 | 真人秀推荐 |
| -------- | -------- | -------- | ---------- | -------- | ---------- |
| 1 | 2 | 3 | 4 | 5 | 6 |
</Route>
## Nyaa
### 搜索结果

View File

@ -320,6 +320,16 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
<Route author="maple3142" example="/facebook/page/SonetPCR" path="/facebook/page/:id" :paramsDesc="['專頁 id']" anticrawler="1"/>
## Gab
### 用戶時間線
<Route author="zphw" example="/gab/user/realdonaldtrump" path="/gab/user/:username" :paramsDesc="['用戶名']" />
### 熱門
<Route author="zphw" example="/gab/popular/hot" path="/gab/popular/:sort?" :paramsDesc="['排序方式, `hot` 為 Hot Posts, `top` 為 Top Posts。默認為 hot']" />
## iCity
### 用户动态

View File

@ -2941,7 +2941,7 @@ router.get('/grubstreet', require('./routes/grubstreet/index'));
router.get('/manhuadui/manhua/:name/:serial?', require('./routes/manhuadui/manhua'));
// 风之漫画
router.get('/fzdm/manhua/:id', require('./routes/fzdm/manhua'));
router.get('/fzdm/manhua/:id/:nums?', require('./routes/fzdm/manhua'));
// Aljazeera 半岛网
router.get('/aljazeera/news', require('./routes/aljazeera/news'));
@ -3204,6 +3204,12 @@ router.get('/scut/scet/notice', require('./routes/universities/scut/scet/notice'
// OneJAV
router.get('/onejav/:type/:key?', require('./routes/onejav/one'));
// 141jav
router.get('/141jav/:type/:key?', require('./routes/141jav/141jav'));
// 141ppv
router.get('/141ppv/:type/:key?', require('./routes/141ppv/141ppv'));
// CuriousCat
router.get('/curiouscat/user/:id', require('./routes/curiouscat/user'));
@ -3800,6 +3806,7 @@ router.get('/semiconductors/latest-news', require('./routes/semiconductors/lates
// VOA News
router.get('/voa/day-photos', require('./routes/voa/day-photos'));
// Voice of America
router.get('/voa/:language/:channel?', require('./routes/voa/index'));
@ -3861,6 +3868,13 @@ router.get('/booth.pm/shop/:subdomain', require('./routes/booth-pm/shop'));
// Minecraft feed the beast
router.get('/feed-the-beast/modpack/:modpackEntry', require('./routes/feed-the-beast/modpack'));
// Gab
router.get('/gab/user/:username', require('./routes/gab/user'));
router.get('/gab/popular/:sort?', require('./routes/gab/explore'));
// NEW字幕组
router.get('/newzmz/:category?', require('./routes/newzmz/index'));
// Phrack Magazine
router.get('/phrack', require('./routes/phrack/index'));

View File

@ -0,0 +1,37 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const type = ctx.params.type || 'new';
const key = type === 'day' ? ctx.params.key.slice(0, 4) + '/' + ctx.params.key.slice(4, 6) + '/' + ctx.params.key.slice(6, 8) : ctx.params.key || '';
const link = 'https://www.141jav.com' + `/${type === 'day' ? '' : type}${type === 'new' ? '' : '/' + key}`.replace('//', '/');
const response = await got({
method: 'get',
url: link,
});
const $ = cheerio.load(response.data);
const list = $('div.columns');
let itemPicUrl;
ctx.state.data = {
title: `141jav - ${type} ${key}`,
link: link,
item:
list &&
list
.map((index, item) => {
item = $(item);
itemPicUrl = item.find('img').attr('src');
return {
title: '【' + item.find('div.card-content.is-flex > h5 > a').text() + '】' + item.find('div.card-content.is-flex > h5 > span').text(),
description: `<img src="${itemPicUrl}"/><br/>Time: ${item.find('p.subtitle.is-6 > a').text()}<br/>Desc: ${item.find('p.level.has-text-grey-dark').text()}`,
link: item.find('div.card-content.is-flex > h5 > a').attr('href'),
enclosure_url: item.find('div.card-content.is-flex > a').attr('href'),
enclosure_type: 'application/x-bittorrent',
};
})
.get(),
};
};

View File

@ -0,0 +1,37 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const type = ctx.params.type || 'new';
const key = type === 'day' ? ctx.params.key.slice(0, 4) + '/' + ctx.params.key.slice(4, 6) + '/' + ctx.params.key.slice(6, 8) : ctx.params.key || '';
const link = 'https://www.141ppv.com' + `/${type === 'day' ? '' : type}${type === 'new' ? '' : '/' + key}`.replace('//', '/');
const response = await got({
method: 'get',
url: link,
});
const $ = cheerio.load(response.data);
const list = $('div.columns');
let itemPicUrl;
ctx.state.data = {
title: `141ppv - ${type} ${key}`,
link: link,
item:
list &&
list
.map((index, item) => {
item = $(item);
itemPicUrl = item.find('img').attr('src');
return {
title: '【' + item.find('div.card-content.is-flex > h5 > a').text() + '】' + item.find('div.card-content.is-flex > h5 > span').text(),
description: `<img src="${itemPicUrl}"/><br/>Time: ${item.find('p.subtitle.is-6 > a').text()}<br/>Desc: ${item.find('p.level.has-text-grey-dark').text()}`,
link: item.find('div.card-content.is-flex > h5 > a').attr('href'),
enclosure_url: item.find('div.card-content.is-flex > a').attr('href'),
enclosure_type: 'application/x-bittorrent',
};
})
.get(),
};
};

View File

@ -1,5 +1,4 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const response = await got({
@ -13,33 +12,15 @@ module.exports = async (ctx) => {
const data = response.data.data.list;
const items = await Promise.all(
data.map(async (item) => {
const link = item.web_url;
const summary = `<blockquote><p>${item.summary}</p></blockquote><img src="${item.pics}">`;
const fullText = await ctx.cache.tryGet(link, async () => {
const result = await got.get(link);
const $ = cheerio.load(result.data);
return $('#Main_Content_Val').html();
});
return {
title: item.title,
description: fullText ? summary + fullText : summary,
link: link,
pubDate: new Date(item.time * 1000),
author: item.author_name,
};
})
);
ctx.state.data = {
title: `财新网 - 首页`,
link: `http://www.caixin.com/`,
description: '财新网 - 首页',
item: items,
item: data.map((item) => ({
title: item.title,
description: `<p>${item.summary}</p><img src="${item.pics}">`,
link: item.web_url,
pubDate: new Date(item.time * 1000),
})),
};
};

View File

@ -2,8 +2,43 @@ const got = require('@/utils/got');
const host = 'https://manhua.fzdm.com';
const cheerio = require('cheerio');
const get_pic = (id, chapert, caches) => {
const picUrlPattern = RegExp(/var (mhurl1|mhurl)="(.*?)";/);
return caches.tryGet(`${host}/${id}/${chapert}/`, async () => {
let is_last_page = false;
let index = 0;
let pic_content = '';
while (!is_last_page) {
// eslint-disable-next-line no-await-in-loop
const response = await got.get(`${host}/${id}/${chapert}/index_${index}.html`, {
headers: {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36',
Host: 'manhua.fzdm.com',
'Accept-Encoding': 'gzip, deflate, br',
Connection: 'keep-alive',
},
});
const data = response.data;
if (response.data !== undefined) {
const picurl = data.match(picUrlPattern);
pic_content += `<img src='http://www-mipengine-org.mipcdn.com/i/p5.manhuapan.com/${picurl[picurl.length - 1]}'/><br/>`;
if (data.match('最后一页了') !== null) {
is_last_page = true;
}
} else {
pic_content += '';
is_last_page = true;
}
index += 1;
}
return pic_content;
});
};
module.exports = async (ctx) => {
const id = ctx.params.id;
const nums = ctx.params.nums || 1;
const comicPage = host + `/${id}/`;
const response = await got({
method: 'get',
@ -13,16 +48,24 @@ module.exports = async (ctx) => {
const $ = cheerio.load(data);
const list = $('div#content > li > a');
const comicTitle = $('div#content > img').attr('alt').replace(/漫画/, '');
const chapter_detail = await Promise.all(
list.splice(0, nums).map(async (item) => {
const pic_content = await get_pic(id, $(item).attr('href').replace('/', ''), ctx.cache);
return {
title: $(item).text().trim(),
description: pic_content,
link: item.link,
};
})
);
ctx.state.data = {
title: '风之动漫 - ' + comicTitle,
link: comicPage,
description: '风之动漫',
item: list
.map((i, item) => ({
title: $(item).text().trim(),
description: $(item).text().trim(),
link: comicPage + $(item).attr('href'),
}))
.get(),
item: chapter_detail.map((item) => ({
title: item.title,
description: item.description,
link: item.link,
})),
};
};

31
lib/routes/gab/explore.js Normal file
View File

@ -0,0 +1,31 @@
const cheerio = require('cheerio');
const got = require('@/utils/got');
module.exports = async (ctx) => {
const sort = ctx.params.sort || 'hot';
let baseURL = 'https://gab.com/api/v1/timelines/explore?page=1&sort_by=';
baseURL += sort === 'hot' ? 'hot' : 'top_today';
const response = await got.get(baseURL);
const result = await Promise.all(
response.data.map((item) => {
const media = item.media_attachments.map((item) => `<img src='${item.url}'>`).join('<br>');
const $ = cheerio.load(item.content);
return {
title: $.text() || 'Untitled',
description: item.content + (media && '<br>' + media),
link: item.url || baseURL,
pubDate: new Date(item.created_at).toISOString(),
};
})
);
ctx.state.data = {
title: `Gab - Popular posts`,
link: baseURL,
item: result,
};
};

32
lib/routes/gab/user.js Normal file
View File

@ -0,0 +1,32 @@
const cheerio = require('cheerio');
const got = require('@/utils/got');
module.exports = async (ctx) => {
const username = ctx.params.username;
const response = await got.get('https://gab.com/api/v1/account_by_username/' + username);
const id = response.data.id;
const gabs = await got.get(`https://gab.com/api/v1/accounts/${id}/statuses?exclude_replies=true`);
const result = await Promise.all(
gabs.data
.filter((item) => !item.reblog)
.map((item) => {
const media = item.media_attachments.map((item) => `<img src='${item.url}'>`).join('<br>');
const $ = cheerio.load(item.content);
return {
title: $.text() || 'Untitled',
description: item.content + (media && '<br>' + media),
link: item.url || `https://gab.com/${username}`,
pubDate: new Date(item.created_at).toISOString(),
};
})
);
ctx.state.data = {
title: `Gab - ${username}`,
link: `https://gab.com/${username}`,
item: result,
};
};

View File

@ -2,7 +2,7 @@ const { processFeed } = require('./utils');
module.exports = async (ctx) => {
const url = ctx.params.type ? `https://ja.porn-images-xxx.com/search/${ctx.params.type}/${encodeURIComponent(ctx.params.name)}/` : 'https://ja.porn-images-xxx.com/search/';
const items = await processFeed(url);
const items = await processFeed(ctx, url);
ctx.state.data = {
title: `${ctx.params.name || '新着画像一覧'} - エロ画像`,
link: url,

View File

@ -1,26 +1,46 @@
const cheerio = require('cheerio');
const got = require('@/utils/got');
exports.processFeed = async function processFeed(link) {
const host = 'https://ja.porn-images-xxx.com/';
exports.processFeed = async function processFeed(ctx, link) {
const response = await got.get(link);
const $ = cheerio.load(response.body);
const list = $('ul#image-list li');
const list = $('ul#image-list li')
.map(function (index, item) {
item = $(item);
return {
title: item.find('.image-list-item-title').text(),
link: item.find('.image-list-item-title > a').attr('href'),
date: item.find('.image-list-item-regist-date > span').text(),
};
})
.get();
return await Promise.all(
list.map(async (info) => {
const title = info.title.trim();
const date = info.date;
const itemUrl = host + info.link;
return (
list &&
list
.map((index, item) => {
item = $(item);
return {
title: item.find('.image-list-item-title').text(),
link: item.find('.image-list-item-title > a').attr('href'),
description: item
.find('.image-list-item-image')
.html()
.replace(/\/p=\d+x\d+/, ''),
pubDate: new Date(item.find('.image-list-item-regist-date').text()),
};
})
.get()
const cache = await ctx.cache.get(itemUrl);
if (cache) {
return Promise.resolve(JSON.parse(cache));
}
const response = await got.get(itemUrl);
const $ = cheerio.load(response.data);
const images = $('.icon-overlay > a > img');
const desc = cheerio.html(images);
const item = {
title: title,
link: itemUrl,
description: desc,
pubDate: new Date(date).toUTCString(),
};
if (desc) {
ctx.cache.set(itemUrl, JSON.stringify(item));
}
return Promise.resolve(item);
})
);
};

View File

@ -1,5 +1,4 @@
const cheerio = require('cheerio');
const path = require('path');
const { IgLoginRequiredError } = require('instagram-private-api');
const { ig, login } = require('./utils');
@ -55,7 +54,7 @@ module.exports = async (ctx) => {
logo = userInfo.hd_profile_pic_url_info.url;
const fullName = userInfo.full_name;
title = `${fullName} (@${username}) - Instagram`;
link = path.join('https://www.instagram.com', username);
link = `https://www.instagram.com/${username}`;
itemsRaw = await ig.feed.user(id).items();
break;
@ -64,7 +63,7 @@ module.exports = async (ctx) => {
const tag = nameOrId;
title = `#${tag}) - Instagram`;
link = path.join('https://www.instagram.com', 'explore', 'tags', tag);
link = `https://www.instagram.com/explore/tags/${tag}`;
itemsRaw = await (await ig.feed.tags(tag).items()).slice(1); // the 0 item is undefined for unknown reason
break;
@ -89,7 +88,7 @@ module.exports = async (ctx) => {
}
// Metadata
const url = path.join('https://www.instagram.com', 'p', item.code);
const url = `https://www.instagram.com/p/${item.code}`;
const pubDate = new Date(item.taken_at * 1000).toUTCString();
const title = summary.split('\n')[0];

View File

@ -0,0 +1,76 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const category = parseInt(ctx.params.category || '1');
const rootUrl = 'https://newzmz.com';
const response = await got({
method: 'get',
url: rootUrl,
});
const $ = cheerio.load(response.data);
const target = $('.rowMod').eq(category);
const links = await Promise.all(
target
.find('.slides li a')
.slice(0, 15)
.map((_, item) => {
item = $(item);
return {
title: item.text(),
link: `${rootUrl}${item.attr('href')}`,
};
})
.get()
.map(
async (item) =>
await ctx.cache.tryGet(item.link, async () => {
const resourceResponse = await got({
method: 'get',
url: item.link,
});
const $ = cheerio.load(resourceResponse.data);
item.link = $('.addgz').attr('href');
item.pubDate = new Date($('.duration').text().replace(/更新时间:/, '')).toUTCString();
return item;
})
)
);
const items = await Promise.all(
links.map(
async (item) =>
await ctx.cache.tryGet(item.link, async () => {
const detailResponse = await got({
method: 'get',
url: item.link,
});
const content = cheerio.load(detailResponse.data);
content('img, .link-name').remove();
content('a[title]').each(function () {
content(this).text(content(this).attr('title'));
});
item.description = content('.faq--area').html();
item.enclosure_type = 'application/x-bittorrent';
item.enclosure_url = content('a[title="磁力链下载"]').attr('href');
return item;
})
)
);
ctx.state.data = {
title: `${target.find('.row-header-title').text()} - NEW字幕组`,
link: rootUrl,
item: items,
};
};

View File

@ -34,7 +34,7 @@ module.exports = async (ctx) => {
title: item.find('.container h1').text(),
description: item.find('.notes-container').text() + '<img src="' + item.find('img').attr('src') + '">',
pubDate: targetDate[0],
link: 'https://www.notateslaapp.com' + item.find('.selector-container-notes a').attr('href'),
link: 'https://www.notateslaapp.com' + item.find('.notes-container > .button-container > a').attr('href'),
};
})
.get(),

View File

@ -44,7 +44,7 @@ module.exports = async ({ github, context, core }, body, number) => {
}
}
core.info('seems no route found, failing');
core.warning('seems no route found, failing');
await github.issues
.addLabels({
@ -56,6 +56,27 @@ module.exports = async ({ github, context, core }, body, number) => {
.catch((e) => {
core.warning(e);
});
await github.issues
.createComment({
issue_number: number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `自动检测失败, 请确认PR正文部分符合格式规范并重新开启, 详情请检查日志
Auto Route test failed, please check your PR body format and reopen pull request. Check logs for more details`,
})
.catch((e) => {
core.warning(e);
});
await github.pulls
.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_nulber: number,
state: 'closed',
})
.catch((e) => {
core.warning(e);
});
throw 'Please follow the PR rules: failed to detect route';
};