Skip to content
Permalink
Browse files Browse the repository at this point in the history
feat: remove some routes for security reasons, !!! no-eval no-new-fun…
…c !!!
  • Loading branch information
DIYgod committed Jan 25, 2021
1 parent e8beb40 commit 7f1c430
Show file tree
Hide file tree
Showing 15 changed files with 12 additions and 329 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Expand Up @@ -53,6 +53,7 @@
"prettier/prettier": 0,
"no-await-in-loop": 2,
"require-atomic-updates": 0,
"no-prototype-builtins": 0
"no-prototype-builtins": 0,
"no-new-func": 2
}
}
16 changes: 0 additions & 16 deletions docs/game.md
Expand Up @@ -432,22 +432,6 @@ Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的

<Route author="KotoriK" example="/pcr/news-cn" path="/pcr/news-cn"/>

## 篝火营地

### 游戏资讯

<Route author="sintak" example="/gouhuo/news/switch" path="/gouhuo/news/:category" :paramsDesc="['资讯类型']">

| 精选 | 海外 | 原创 | PS4 | Xboxone | PC | Switch | 掌机 | 手游 | 新闻 | 评测 | 文化 | 视频 | 音频 | 折扣 |
| ---------- | -------- | ------- | --- | ------- | -- | ------ | -------- | ---------- | ---- | ------ | ------- | ----- | ----- | -------- |
| choiceness | overseas | orignal | ps4 | xboxone | pc | switch | handheld | mobilegame | news | review | culture | video | audio | discount |

</Route>

### 游戏攻略

<Route author="sintak" example="/gouhuo/strategy" path="/gouhuo/strategy"/>

## 怪物猎人世界

### 更新情报
Expand Down
6 changes: 0 additions & 6 deletions docs/live.md
Expand Up @@ -38,12 +38,6 @@ pageClass: routes

<Route author="DIYgod" example="/douyu/room/24422" path="/douyu/room/:id" :paramsDesc="['直播间 id, 可在主播直播间页 URL 中找到']"/>

## 黑白直播

### 直播间开播

<Route author="laampui" example="/heibaizhibo/room/195976" path="/heibaizhibo/room/:id" :paramsDesc="['直播间 id, 可在主播直播间页 URL 中找到']"/>

## 虎牙直播

### 直播间开播
Expand Down
4 changes: 0 additions & 4 deletions docs/new-media.md
Expand Up @@ -1936,10 +1936,6 @@ column 为 third 时可选的 category:

</Route>

### 数读

<Route author="laampui" example="/netease/news/data" path="/netease/news/data"/>

## 维基百科

### 中国大陆新闻动态
Expand Down
6 changes: 0 additions & 6 deletions docs/program-update.md
Expand Up @@ -418,12 +418,6 @@ pageClass: routes

<Route author="mrbruce516" example="/tesla" path="/tesla/update"/>

## 腾讯柠檬 Lab

### 柠檬精选 Mac Apps

<Route author="HenryQW" example="/tencent/lemon" path="/tencent/lemon"/>

## 腾讯云移动直播 SDK

### 更新日志
Expand Down
5 changes: 0 additions & 5 deletions docs/programming.md
Expand Up @@ -678,11 +678,6 @@ GitHub 官方也提供了一些 RSS:
<Route author="hellodword" example="/galaxylab" path="/galaxylab">
</Route>

## 前端技术文章

<Route author="laampui" example="/front-end-rss" path="/front-end-rss" :paramsDesc="['分类']">
</Route>

## 前端艺术家 && 飞冰早报

### 列表
Expand Down
14 changes: 0 additions & 14 deletions lib/router.js
Expand Up @@ -2072,10 +2072,6 @@ router.get('/pingwest/user/:uid/:type?', require('./routes/pingwest/user'));
// Hanime
router.get('/hanime/video', require('./routes/hanime/video'));

// 篝火营地
router.get('/gouhuo/news/:category', require('./routes/gouhuo'));
router.get('/gouhuo/strategy', require('./routes/gouhuo/strategy'));

// Soul
router.get('/soul/:id', require('./routes/soul'));
router.get('/soul/posts/hot', require('./routes/soul/hot'));
Expand Down Expand Up @@ -2141,9 +2137,6 @@ router.get('/szse/rule', require('./routes/szse/rule'));
// 前端艺术家每日整理&&飞冰早报
router.get('/jskou/:type?', require('./routes/jskou/index'));

// 前端
router.get('/front-end-rss', require('./routes/frontend/index'));

// 国家应急广播
router.get('/cneb/yjxx', require('./routes/cneb/yjxx'));
router.get('/cneb/guoneinews', require('./routes/cneb/guoneinews'));
Expand Down Expand Up @@ -2178,9 +2171,6 @@ router.get('/sohu/mp/:id', require('./routes/sohu/mp'));
// 腾讯企鹅号
router.get('/tencent/news/author/:mid', require('./routes/tencent/news/author'));

// 腾讯柠檬精选
router.get('/tencent/lemon', require('./routes/tencent/lemon/index'));

// 奈菲影视
router.get('/nfmovies/:id?', require('./routes/nfmovies/index'));

Expand Down Expand Up @@ -3056,7 +3046,6 @@ router.get('/jike/user/:id', require('./routes/jike/user'));
// 网易新闻
router.get('/netease/news/rank/:category?/:type?/:time?', require('./routes/netease/news/rank'));
router.get('/netease/news/special/:type?', require('./routes/netease/news/special'));
router.get('/netease/news/data', require('./routes/netease/news/data'));

// 网易 - 网易号
router.get('/netease/dy/:id', require('./routes/netease/dy'));
Expand Down Expand Up @@ -3169,9 +3158,6 @@ router.get('/touhougarakuta/:language/:type', require('./routes/touhougarakuta')
// 猎趣TV
router.get('/liequtv/room/:id', require('./routes/liequtv/room'));

// 黑白直播
router.get('/heibaizhibo/room/:id', require('./routes/heibaizhibo/room'));

// Behance
router.get('/behance/:user/:type?', require('./routes/behance/index'));

Expand Down
27 changes: 0 additions & 27 deletions lib/routes/frontend/index.js

This file was deleted.

44 changes: 0 additions & 44 deletions lib/routes/gouhuo/cache.js

This file was deleted.

62 changes: 0 additions & 62 deletions lib/routes/gouhuo/index.js

This file was deleted.

35 changes: 0 additions & 35 deletions lib/routes/gouhuo/strategy.js

This file was deleted.

31 changes: 0 additions & 31 deletions lib/routes/heibaizhibo/room.js

This file was deleted.

20 changes: 10 additions & 10 deletions lib/routes/huxiu/utils.js
Expand Up @@ -15,13 +15,13 @@ const ProcessFeed = async (list, cache) => {

const $ = cheerio.load(response.data);

const __INITIAL_STATE__ = Function(
'let window={};' +
$('*')
.html()
.match(/window\.__INITIAL_STATE__.*};/gm)[0] +
'return window.__INITIAL_STATE__'
)();
// const __INITIAL_STATE__ = Function(
// 'let window={};' +
// $('*')
// .html()
// .match(/window\.__INITIAL_STATE__.*};/gm)[0] +
// 'return window.__INITIAL_STATE__'
// )();

$('.article__content')
.find('.lazyImg')
Expand All @@ -42,9 +42,9 @@ const ProcessFeed = async (list, cache) => {

let description = '';

if ('video_info' in __INITIAL_STATE__.articleDetail.articleDetail) {
description += `<video height="100%" poster="${__INITIAL_STATE__.articleDetail.articleDetail.video_info.cover}" controls src="${__INITIAL_STATE__.articleDetail.articleDetail.video_info.hd_link}"></video>`;
}
// if ('video_info' in __INITIAL_STATE__.articleDetail.articleDetail) {
// description += `<video height="100%" poster="${__INITIAL_STATE__.articleDetail.articleDetail.video_info.cover}" controls src="${__INITIAL_STATE__.articleDetail.articleDetail.video_info.hd_link}"></video>`;
// }
if ($('.top-img').html() !== null) {
description += $('.top-img').html();
}
Expand Down

1 comment on commit 7f1c430

@vercel
Copy link

@vercel vercel bot commented on 7f1c430 Jan 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.