style: auto format

This commit is contained in:
GitHub Action
2021-02-23 00:10:45 +00:00
parent 0be82b2dd4
commit 3f0f53c48d
20 changed files with 176 additions and 181 deletions

View File

@@ -1187,7 +1187,7 @@
target: (params, url) => { target: (params, url) => {
const id = new URL(url).hash.match(/home\?id=(.*)/)[1]; const id = new URL(url).hash.match(/home\?id=(.*)/)[1];
return id ? `/ncm/user/playlist/${id}` : ''; return id ? `/ncm/user/playlist/${id}` : '';
} },
}, },
{ {
title: '云音乐 - 歌单歌曲', title: '云音乐 - 歌单歌曲',
@@ -1196,7 +1196,7 @@
target: (params, url) => { target: (params, url) => {
const id = new URL(url).hash.match(/playlist\?id=(.*)/)[1]; const id = new URL(url).hash.match(/playlist\?id=(.*)/)[1];
return id ? `/ncm/playlist/${id}` : ''; return id ? `/ncm/playlist/${id}` : '';
} },
}, },
{ {
title: '云音乐 - 歌手专辑', title: '云音乐 - 歌手专辑',
@@ -1205,7 +1205,7 @@
target: (params, url) => { target: (params, url) => {
const id = new URL(url).hash.match(/album\?id=(.*)/)[1]; const id = new URL(url).hash.match(/album\?id=(.*)/)[1];
return id ? `/ncm/artist/${id}` : ''; return id ? `/ncm/artist/${id}` : '';
} },
}, },
{ {
title: '云音乐 - 电台节目', title: '云音乐 - 电台节目',
@@ -1214,7 +1214,7 @@
target: (params, url) => { target: (params, url) => {
const id = new URL(url).hash.match(/djradio\?id=(.*)/)[1]; const id = new URL(url).hash.match(/djradio\?id=(.*)/)[1];
return id ? `/ncm/djradio/${id}` : ''; return id ? `/ncm/djradio/${id}` : '';
} },
}, },
], ],
}, },
@@ -2004,9 +2004,9 @@
target: (params) => { target: (params) => {
const id = params.id.match('(.*).html')[1]; const id = params.id.match('(.*).html')[1];
return id ? `/tencentvideo/playlist/${id}` : ''; return id ? `/tencentvideo/playlist/${id}` : '';
} },
}, },
] ],
}, },
'javbus.com': { 'javbus.com': {
_name: 'JavBus', _name: 'JavBus',
@@ -2745,7 +2745,6 @@
docs: 'https://docs.rsshub.app/social-media.html#fur-affinity', docs: 'https://docs.rsshub.app/social-media.html#fur-affinity',
source: '/browse/', source: '/browse/',
target: '/furaffinity/browse', target: '/furaffinity/browse',
}, },
{ {
title: '站点状态', title: '站点状态',

View File

@@ -118,12 +118,6 @@ pageClass: routes
<Route author="changlan" example="/blogs/jianning" path="/blogs/jianning" radar="1" rssbud="1"/> <Route author="changlan" example="/blogs/jianning" path="/blogs/jianning" radar="1" rssbud="1"/>
## 敬维博客
### 文章
<Route author="a180285" example="/blogs/jingwei.link" path="/blogs/jingwei.link"/>
## 劍心.回憶 ## 劍心.回憶
### 分类 ### 分类
@@ -172,6 +166,12 @@ pageClass: routes
</Route> </Route>
## 敬维博客
### 文章
<Route author="a180285" example="/blogs/jingwei.link" path="/blogs/jingwei.link"/>
## 每日安全 ## 每日安全
### 推送 ### 推送

View File

@@ -35,18 +35,18 @@ Compared to the official one, the RSS feed generated by RSSHub not only has more
</RouteEn> </RouteEn>
## ASML Holding N.V.
### Press releases & announcements
<RouteEn author="nczitzk" example="/asml/press-releases" path="/asml/press-releases"/>
## American Federation of Labor and Congress of Industrial Organizations ## American Federation of Labor and Congress of Industrial Organizations
### Blog ### Blog
<RouteEn author="nczitzk" example="/aflcio/blog" path="/aflcio/blog"/> <RouteEn author="nczitzk" example="/aflcio/blog" path="/aflcio/blog"/>
## ASML Holding N.V.
### Press releases & announcements
<RouteEn author="nczitzk" example="/asml/press-releases" path="/asml/press-releases"/>
## Bell Labs ## Bell Labs
### Event and News ### Event and News

View File

@@ -10,6 +10,18 @@ pageClass: routes
<Route author="HenryQW" example="/cfd/div_gbp" path="/cfd/div_gbp" /> <Route author="HenryQW" example="/cfd/div_gbp" path="/cfd/div_gbp" />
## DT 财经
### 数据侠专栏
<Route author="nczitzk" example="/dtcj/datahero" path="/dtcj/datahero/:category?" :paramsDesc="['分类,见下表,默认为全部']">
| 侠创 | 纽约数据科学学院 | RS 实验所 | 阿里云天池 |
| ---- | ---------------- | --------- | ---------- |
| 5 | 6 | 9 | 10 |
</Route>
## finviz ## finviz
### 美股股票新闻 ### 美股股票新闻
@@ -127,18 +139,6 @@ pageClass: routes
</Route> </Route>
## DT 财经
### 数据侠专栏
<Route author="nczitzk" example="/dtcj/datahero" path="/dtcj/datahero/:category?" :paramsDesc="['分类,见下表,默认为全部']">
| 侠创 | 纽约数据科学学院 | RS 实验所 | 阿里云天池 |
| ---- | ---------------- | --------- | ---------- |
| 5 | 6 | 9 | 10 |
</Route>
## 淘股吧股票论坛 ## 淘股吧股票论坛
### 论坛总版 ### 论坛总版

View File

@@ -126,6 +126,31 @@ pageClass: routes
见 [#AGE 动漫](/anime.html#age-dong-man) 见 [#AGE 动漫](/anime.html#age-dong-man)
## AV01av01.tv
### 演员
::: tip 提示
当没有给定排序类型时,默认为按上传时间排序及 mr
:::
<Route author="HXHL" example="/av01/actor/七沢みあ" path="/av01/actor/:name/:type?" :paramsDesc="['女优名,必选-仅限日语,可直接在网站上找到','排序顺序,可选-可以是`mr` `rd` `bw` `tr` `lg`']">
| 按上传时间排序 | 按上市时间排序 | 按观看次数排序 | 按评分排序 | 按时长排序 |
| -------------- | -------------- | -------------- | ---------- | ---------- |
| mr | rd | bw | tr | lg |
</Route>
### 分类
<Route author="HXHL" example="/av01/tag/中出し" path="/av01/tag/:name/:type?" :paramsDesc="['分类名,必选-仅限日语,可直接在网站上找到','排序顺序,可选-可以是`mr` `rd` `bw` `tr` `lg`']">
例如,路由 `/av01/tag/中出し` 应该输出 <https://www.av01.tv/tag/%E4%B8%AD%E5%87%BA%E3%81%97> 的排行榜单
</Route>
## Avgle ## Avgle
### 视频列表 ### 视频列表
@@ -1023,29 +1048,3 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
例如,路由 `/zimuzu/top/week/movie` 应该输出 <http://www.rrys2019.com/html/top/week_movie_list.html> 的排行榜单 例如,路由 `/zimuzu/top/week/movie` 应该输出 <http://www.rrys2019.com/html/top/week_movie_list.html> 的排行榜单
</Route> </Route>
## AV01av01.tv
### 演员
::: tip 提示
当没有给定排序类型时,默认为按上传时间排序及mr
:::
<Route author="HXHL" example="/av01/actor/七沢みあ" path="/av01/actor/:name/:type?" :paramsDesc="['女优名,必选-仅限日语,可直接在网站上找到','排序顺序,可选-可以是`mr` `rd` `bw` `tr` `lg`']">
| 按上传时间排序 | 按上市时间排序 | 按观看次数排序| 按评分排序|按时长排序|
| -------- | -------- |-------- |-------- |--------|
| mr | rd | bw | tr | lg |
</Route>
### 分类
<Route author="HXHL" example="/av01/tag/中出し" path="/av01/tag/:name/:type?" :paramsDesc="['分类名,必选-仅限日语,可直接在网站上找到','排序顺序,可选-可以是`mr` `rd` `bw` `tr` `lg`']">
例如,路由 `/av01/tag/中出し` 应该输出 <https://www.av01.tv/tag/%E4%B8%AD%E5%87%BA%E3%81%97> 的排行榜单
</Route>

View File

@@ -2174,6 +2174,12 @@ column 为 third 时可选的 category:
</Route> </Route>
## 亿欧网
### 资讯
<Route author="WenryXu" example="/iyiou" path="/iyiou"/>
## 有趣天文奇观 ## 有趣天文奇观
### 首页 ### 首页
@@ -2297,9 +2303,3 @@ QueryString:
### 全文 ### 全文
<Route author="HenryQW" example="/zzz" path="/zzz/index"/> <Route author="HenryQW" example="/zzz" path="/zzz/index"/>
## 亿欧网
### 资讯
<Route author="WenryXu" example="/iyiou" path="/iyiou"/>

View File

@@ -328,8 +328,8 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
类型 type 类型 type
| 艺术品 | 手工 | 音乐 | 写作 | | 艺术品 | 手工 | 音乐 | 写作 |
| ---- | ---- | ---- | ---- | | ------- | ------ | ----- | ------- |
| artwork | crafts | music | writing | | artwork | crafts | music | writing |
</Route> </Route>
@@ -362,7 +362,7 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
<Route author="TigerCubDen" example="/furaffinity/commissions/flashlioness" path="/furaffinity/commissions/:username" :paramsDesc="['用户名, 可在用户主页的链接处找到']" radar="1"/> <Route author="TigerCubDen" example="/furaffinity/commissions/flashlioness" path="/furaffinity/commissions/:username" :paramsDesc="['用户名, 可在用户主页的链接处找到']" radar="1"/>
### 用户的Shouts留言 ### 用户的 Shouts 留言
<Route author="TigerCubDen" example="/furaffinity/shouts/redodgft" path="/furaffinity/shouts/:username" :paramsDesc="['用户名, 可在用户主页的链接处找到']" radar="1"/> <Route author="TigerCubDen" example="/furaffinity/shouts/redodgft" path="/furaffinity/shouts/:username" :paramsDesc="['用户名, 可在用户主页的链接处找到']" radar="1"/>
@@ -374,7 +374,7 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
<Route author="TigerCubDen" example="/furaffinity/gallery/flashlioness" path="/furaffinity/gallery/:username/:nsfw?" :paramsDesc="['用户名, 可在用户主页的链接处找到', 'NSFW开关当值为 `1` 时不过滤NSFW内容']" radar="1"/> <Route author="TigerCubDen" example="/furaffinity/gallery/flashlioness" path="/furaffinity/gallery/:username/:nsfw?" :paramsDesc="['用户名, 可在用户主页的链接处找到', 'NSFW开关当值为 `1` 时不过滤NSFW内容']" radar="1"/>
### 用户的零碎(非正式)作品 ### 用户的零碎 (非正式) 作品
<Route author="TigerCubDen" example="/furaffinity/scraps/flashlioness" path="/furaffinity/scraps/:username/:nsfw?" :paramsDesc="['用户名, 可在用户主页的链接处找到', 'NSFW开关当值为 `1` 时不过滤NSFW内容']" radar="1"/> <Route author="TigerCubDen" example="/furaffinity/scraps/flashlioness" path="/furaffinity/scraps/:username/:nsfw?" :paramsDesc="['用户名, 可在用户主页的链接处找到', 'NSFW开关当值为 `1` 时不过滤NSFW内容']" radar="1"/>

View File

@@ -642,7 +642,6 @@ router.get('/hit/today/:category', require('./routes/universities/hit/today'));
// 哈尔滨工业大学(深圳) // 哈尔滨工业大学(深圳)
router.get('/hitsz/article/:category?', require('./routes/universities/hitsz/article')); router.get('/hitsz/article/:category?', require('./routes/universities/hitsz/article'));
// 哈尔滨工业大学(威海) // 哈尔滨工业大学(威海)
router.get('/hitwh/today', require('./routes/universities/hitwh/today')); router.get('/hitwh/today', require('./routes/universities/hitwh/today'));
@@ -2678,7 +2677,6 @@ router.get('/sustyjs', require('./routes/universities/sustyjs/sustyjs'));
router.get('/sustech/newshub-zh', require('./routes/universities/sustech/newshub-zh')); router.get('/sustech/newshub-zh', require('./routes/universities/sustech/newshub-zh'));
router.get('/sustech/bidding', require('./routes/universities/sustech/bidding')); router.get('/sustech/bidding', require('./routes/universities/sustech/bidding'));
// 广州大学 // 广州大学
router.get('/gzyjs', require('./routes/universities/gzyjs/gzyjs')); router.get('/gzyjs', require('./routes/universities/gzyjs/gzyjs'));
@@ -3970,5 +3968,4 @@ router.get('/iyiou', require('./routes/iyiou'));
// 香港商报 // 香港商报
router.get('/hkcd/pdf', require('./routes/hkcd/pdf')); router.get('/hkcd/pdf', require('./routes/hkcd/pdf'));
module.exports = router; module.exports = router;

View File

@@ -109,24 +109,24 @@ module.exports = async (ctx) => {
data_content = data_content.replace( data_content = data_content.replace(
new RegExp(`\\${item.text}`, 'g'), new RegExp(`\\${item.text}`, 'g'),
`<img alt="${item.text}" src="${item.url}"style="margin: -1px 1px 0px; display: inline-block; width: 20px; height: 20px; vertical-align: text-bottom;" title="" referrerpolicy="no-referrer">` `<img alt="${item.text}" src="${item.url}"style="margin: -1px 1px 0px; display: inline-block; width: 20px; height: 20px; vertical-align: text-bottom;" title="" referrerpolicy="no-referrer">`
); );
}); });
} }
// 作者信息 // 作者信息
let author = "哔哩哔哩番剧"; let author = '哔哩哔哩番剧';
if (item.desc.user_profile) { if (item.desc.user_profile) {
author = item.desc.user_profile.info.uname;} author = item.desc.user_profile.info.uname;
}
return { return {
title: getTitle(data), title: getTitle(data),
author : author, author: author,
description: `${parsed.new_desc || data_content || getDes(data)}${ description: `${parsed.new_desc || data_content || getDes(data)}${
origin && getOriginName(origin) ? `<br><br>//转发自: @${getOriginName(origin)}: ${getOriginTitle(origin.item || origin)}${getDes(origin.item || origin)}` : `${getOriginDes(origin)}` origin && getOriginName(origin) ? `<br><br>//转发自: @${getOriginName(origin)}: ${getOriginTitle(origin.item || origin)}${getDes(origin.item || origin)}` : `${getOriginDes(origin)}`
}${getIframe(data)}${getIframe(origin)}${imgHTML ? `<br>${imgHTML}` : ''}${videoHTML ? `<br>${videoHTML}` : ''}`, }${getIframe(data)}${getIframe(origin)}${imgHTML ? `<br>${imgHTML}` : ''}${videoHTML ? `<br>${videoHTML}` : ''}`,
pubDate: new Date(item.desc.timestamp * 1000).toUTCString(), pubDate: new Date(item.desc.timestamp * 1000).toUTCString(),
link: link, link: link,
}; };
}), }),
}; };
}; };

View File

@@ -25,7 +25,7 @@ module.exports = async (ctx) => {
const data = response.data; const data = response.data;
const $ = cheerio.load(data, { const $ = cheerio.load(data, {
xmlMode: true xmlMode: true,
}); });
const list = $('item'); const list = $('item');
@@ -41,15 +41,16 @@ module.exports = async (ctx) => {
// 遍历此前获取的数据 // 遍历此前获取的数据
item: item:
list && list &&
list.map((index, item) => { list
item = $(item); .map((index, item) => {
return { item = $(item);
title: item.find("title").text(), return {
description: item.find("description").text(), title: item.find('title').text(),
link: item.find("link").text(), description: item.find('description').text(),
pubDate: new Date(item.find("pubDate").text()).toUTCString(), link: item.find('link').text(),
}; pubDate: new Date(item.find('pubDate').text()).toUTCString(),
}) };
.get(), })
.get(),
}; };
}; };

View File

@@ -24,7 +24,7 @@ module.exports = async (ctx) => {
const data = response.data; const data = response.data;
const $ = cheerio.load(data, { const $ = cheerio.load(data, {
xmlMode: true xmlMode: true,
}); });
const list = $('item'); const list = $('item');
@@ -40,16 +40,17 @@ module.exports = async (ctx) => {
// 遍历此前获取的数据 // 遍历此前获取的数据
item: item:
list && list &&
list.map((index, item) => { list
item = $(item); .map((index, item) => {
return { item = $(item);
title: item.find("title").text(), return {
description: item.find("description").text(), title: item.find('title').text(),
link: item.find("link").text(), description: item.find('description').text(),
pubDate: new Date(item.find("pubDate").text()).toUTCString(), link: item.find('link').text(),
author: username, pubDate: new Date(item.find('pubDate').text()).toUTCString(),
}; author: username,
}) };
.get(), })
.get(),
}; };
}; };

View File

@@ -25,8 +25,7 @@ module.exports = async (ctx) => {
// 判断传入的参数type分别为artwork、crafts、music、writing // 判断传入的参数type分别为artwork、crafts、music、writing
if (type === 'artwork') { if (type === 'artwork') {
data = data.artwork; data = data.artwork;
} } else if (type === 'crafts') {
else if (type === 'crafts') {
data = data.crafts; data = data.crafts;
} else if (type === 'music') { } else if (type === 'music') {
data = data.music; data = data.music;

View File

@@ -32,17 +32,18 @@ module.exports = async (ctx) => {
// 遍历此前获取的数据 // 遍历此前获取的数据
item: item:
list && list &&
list.map((index, item) => { list
item = $(item); .map((index, item) => {
return { item = $(item);
title: item.find("title").text(), return {
description: item.find("description").text(), title: item.find('title').text(),
link: item.find("link").text(), description: item.find('description').text(),
pubDate: new Date(item.find("pubDate").text()).toUTCString(), link: item.find('link').text(),
author: username, pubDate: new Date(item.find('pubDate').text()).toUTCString(),
}; author: username,
}) };
.get(), })
.get(),
}; };
}; };

View File

@@ -24,7 +24,7 @@ module.exports = async (ctx) => {
// 使用 cheerio 加载返回的 HTML // 使用 cheerio 加载返回的 HTML
const data = response.data; const data = response.data;
const $ = cheerio.load(data, { const $ = cheerio.load(data, {
xmlMode: true xmlMode: true,
}); });
const list = $('item'); const list = $('item');
@@ -40,16 +40,17 @@ module.exports = async (ctx) => {
// 遍历此前获取的数据 // 遍历此前获取的数据
item: item:
list && list &&
list.map((index, item) => { list
item = $(item); .map((index, item) => {
return { item = $(item);
title: item.find("title").text(), return {
description: item.find("description").text(), title: item.find('title').text(),
link: item.find("link").text(), description: item.find('description').text(),
pubDate: new Date(item.find("pubDate").text()).toUTCString(), link: item.find('link').text(),
author: username, pubDate: new Date(item.find('pubDate').text()).toUTCString(),
}; author: username,
}) };
.get(), })
.get(),
}; };
}; };

View File

@@ -24,7 +24,7 @@ module.exports = async (ctx) => {
// 使用 cheerio 加载返回的 HTML // 使用 cheerio 加载返回的 HTML
const data = response.data; const data = response.data;
const $ = cheerio.load(data, { const $ = cheerio.load(data, {
xmlMode: true xmlMode: true,
}); });
const list = $('item'); const list = $('item');
@@ -39,17 +39,18 @@ module.exports = async (ctx) => {
// 遍历此前获取的数据 // 遍历此前获取的数据
item: item:
list && list &&
list.map((index, item) => { list
item = $(item); .map((index, item) => {
return { item = $(item);
title: item.find("title").text(), return {
description: item.find("description").text(), title: item.find('title').text(),
link: item.find("link").text(), description: item.find('description').text(),
pubDate: new Date(item.find("pubDate").text()).toUTCString(), link: item.find('link').text(),
// 由于源API未提供作者信息故无author pubDate: new Date(item.find('pubDate').text()).toUTCString(),
}; // 由于源API未提供作者信息故无author
}) };
.get(), })
.get(),
}; };
}; };

View File

@@ -3,7 +3,7 @@ const got = require('@/utils/got');
module.exports = async (ctx) => { module.exports = async (ctx) => {
// 传入参数 // 传入参数
const username = String(ctx.params.username); const username = String(ctx.params.username);
// 发起 HTTP GET 请求 // 发起 HTTP GET 请求
const response = await got({ const response = await got({
method: 'get', method: 'get',

View File

@@ -14,10 +14,10 @@ module.exports = async (ctx) => {
const status = data.online; const status = data.online;
let description = ''; let description = '';
if (Object.keys(data)[0] === "online") { if (Object.keys(data)[0] === 'online') {
description = `Status: ${Object.keys(data)[0]} <br> Guests: ${status.guests} <br>Registered: ${status.registered} <br> Other: ${status.other} <br>Total: ${status.total} <br> Fa Server Time: ${data.fa_server_time}`; description = `Status: ${Object.keys(data)[0]} <br> Guests: ${status.guests} <br>Registered: ${status.registered} <br> Other: ${status.other} <br>Total: ${status.total} <br> Fa Server Time: ${data.fa_server_time}`;
} else { } else {
description = "offline"; description = 'offline';
} }
const item = []; const item = [];
item.push({ item.push({
@@ -26,7 +26,6 @@ module.exports = async (ctx) => {
link: `https://www.furaffinity.net/`, link: `https://www.furaffinity.net/`,
}); });
ctx.state.data = { ctx.state.data = {
// 源标题 // 源标题
title: `Fur Affinity Status`, title: `Fur Affinity Status`,
@@ -37,5 +36,4 @@ module.exports = async (ctx) => {
item: item, item: item,
}; };
}; };

View File

@@ -48,20 +48,18 @@ module.exports = async (ctx) => {
const favorites_food = artist_information['Favorite Food']; const favorites_food = artist_information['Favorite Food'];
const contact_information = data.contact_information; const contact_information = data.contact_information;
let contact_result = "null"; let contact_result = 'null';
// 对一个或多个用户联系方式进行遍历 // 对一个或多个用户联系方式进行遍历
if (contact_information !== "null") { if (contact_information !== 'null') {
contact_result = ""; contact_result = '';
for (let i = 0; i < contact_information.length; i++) { for (let i = 0; i < contact_information.length; i++) {
for (const j in contact_information[i]) { for (const j in contact_information[i]) {
if (j === "title") { if (j === 'title') {
contact_result += `Title: ${contact_information[i][j]} <br> `; contact_result += `Title: ${contact_information[i][j]} <br> `;
} } else if (j === 'name') {
else if (j === "name") {
contact_result += `Name: ${contact_information[i][j]} <br> `; contact_result += `Name: ${contact_information[i][j]} <br> `;
} } else if (j === 'link') {
else if (j === "link") {
contact_result += `Link: ${contact_information[i][j]} <br> `; contact_result += `Link: ${contact_information[i][j]} <br> `;
} }
} }
@@ -85,7 +83,6 @@ module.exports = async (ctx) => {
link: `https://www.furaffinity.net/user/${username}/`, link: `https://www.furaffinity.net/user/${username}/`,
}); });
ctx.state.data = { ctx.state.data = {
// 源标题 // 源标题
title: `Userpage of ${data.name}`, title: `Userpage of ${data.name}`,
@@ -96,5 +93,4 @@ module.exports = async (ctx) => {
item: item, item: item,
}; };
}; };

View File

@@ -3,23 +3,23 @@ const cheerio = require('cheerio');
const iconv = require('iconv-lite'); const iconv = require('iconv-lite');
const encodeMap = { const encodeMap = {
"$$$": "7", $$$: '7',
"$$$$": "f", $$$$: 'f',
"$$$_": "e", $$$_: 'e',
"$$_": "6", $$_: '6',
"$$_$": "d", $$_$: 'd',
"$$__": "c", $$__: 'c',
"$_$": "5", $_$: '5',
"$_$$": "b", $_$$: 'b',
"$_$_": "a", $_$_: 'a',
"$__": "4", $__: '4',
"$__$": "9", $__$: '9',
"$___": "8", $___: '8',
"_": "u", _: 'u',
"_$$": "3", _$$: '3',
"_$_": "2", _$_: '2',
"__$": "1", __$: '1',
"___": "0", ___: '0',
}; };
const tokenPattern = /[A-Z]\.([$_]+)|(\/?\\+)/g; const tokenPattern = /[A-Z]\.([$_]+)|(\/?\\+)/g;
const contentPattern = /\\74\\160\\76[0-9a-fu/\\]+?\\74\/\\160\\76/g; const contentPattern = /\\74\\160\\76[0-9a-fu/\\]+?\\74\/\\160\\76/g;
@@ -55,22 +55,24 @@ module.exports = async (ctx) => {
if (encoded) { if (encoded) {
// 提取编码后的正文内容进行复原 // 提取编码后的正文内容进行复原
const rawText = html; const rawText = html;
let rawContent = ""; let rawContent = '';
for (const match of rawText.matchAll(tokenPattern)) { for (const match of rawText.matchAll(tokenPattern)) {
if (match[1] in encodeMap) { if (match[1] in encodeMap) {
rawContent += encodeMap[match[1]]; rawContent += encodeMap[match[1]];
} }
if (match[2]) { if (match[2]) {
rawContent += match[2].replace("\\\\\\\\", "\\").replace("\\\\", "\\"); rawContent += match[2].replace('\\\\\\\\', '\\').replace('\\\\', '\\');
} }
} }
const decodedContentArr = []; const decodedContentArr = [];
for (const contentPar of rawContent.matchAll(contentPattern)) { for (const contentPar of rawContent.matchAll(contentPattern)) {
const decodedStr = contentPar[0].replace(regex16, function (match, grp) { const decodedStr = contentPar[0]
return String.fromCharCode(parseInt(grp, 16)); .replace(regex16, function (match, grp) {
}).replace(regex8, function (match, grp) { return String.fromCharCode(parseInt(grp, 16));
return String.fromCharCode(parseInt(grp, 8)); })
}); .replace(regex8, function (match, grp) {
return String.fromCharCode(parseInt(grp, 8));
});
decodedContentArr.push(decodedStr); decodedContentArr.push(decodedStr);
} }
encoded.before(decodedContentArr); encoded.before(decodedContentArr);

View File

@@ -9,7 +9,7 @@ let token = null;
const authorizationInfo = { const authorizationInfo = {
client_id: 'MOBrBDS8blbauoSck0ZfDbtuzpyT', client_id: 'MOBrBDS8blbauoSck0ZfDbtuzpyT',
client_secret: 'lsACyCD94FhDUtGTXi3QzcFE2uU1hqtDaKeqrdwj', client_secret: 'lsACyCD94FhDUtGTXi3QzcFE2uU1hqtDaKeqrdwj',
hash_secret: '28c1fdd170a5204386cb1313c7077b34f83e4aaf4aa829ce78c231e05b0bae2c' hash_secret: '28c1fdd170a5204386cb1313c7077b34f83e4aaf4aa829ce78c231e05b0bae2c',
}; };
async function refreshToken() { async function refreshToken() {