rsshub 1.0.0-master.b8acfdb → 1.0.0-master.b9bcf4f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/config.js +6 -0
- package/lib/middleware/parameter.js +3 -3
- package/lib/radar-rules.js +0 -68
- package/lib/router.js +47 -55
- package/lib/routes/aeon/category.js +18 -27
- package/lib/routes/bookwalkertw/news.js +2 -2
- package/lib/routes/ccdi/scdc.js +10 -6
- package/lib/routes/coolapk/utils.js +2 -0
- package/lib/routes/copymanga/comic.js +3 -2
- package/lib/routes/dilbert/strip.js +7 -4
- package/lib/routes/douban/people/status.js +10 -5
- package/lib/routes/dykszx/news.js +5 -2
- package/lib/routes/futunn/highlights.js +39 -37
- package/lib/routes/gamer/gnn_index.js +1 -1
- package/lib/routes/gelonghui/user.js +1 -1
- package/lib/routes/gov/fmprc/fyrbt.js +1 -1
- package/lib/routes/hackerone/hacktivity.js +16 -14
- package/lib/routes/hexo/fluid.js +45 -0
- package/lib/routes/kbs/today.js +56 -0
- package/lib/routes/manhuagui/comic.js +74 -28
- package/lib/routes/mhgui/comic.js +74 -28
- package/lib/routes/ncm/playlist.js +2 -0
- package/lib/routes/ncm/userplayrecords.js +6 -2
- package/lib/routes/novel/axdzs.js +22 -12
- package/lib/routes/novel/biquge.js +1 -1
- package/lib/routes/picuki/profile.js +53 -14
- package/lib/routes/t66y/index.js +4 -4
- package/lib/routes/tencent/wechat/tgchannel.js +47 -10
- package/lib/routes/twmanhuagui/comic.js +74 -28
- package/lib/routes/vgn/index.js +1 -1
- package/lib/routes/weibo/super_index.js +2 -1
- package/lib/routes/weibo/user.js +26 -2
- package/lib/routes/youzhiyouxing/materials.js +29 -0
- package/lib/v2/423down/index.js +114 -0
- package/lib/v2/423down/maintainer.js +3 -0
- package/lib/v2/423down/radar.js +193 -0
- package/lib/v2/423down/router.js +3 -0
- package/lib/v2/acm-ecnu/contest.js +44 -0
- package/lib/v2/acm-ecnu/maintainer.js +3 -0
- package/lib/v2/acm-ecnu/radar.js +19 -0
- package/lib/v2/acm-ecnu/router.js +3 -0
- package/lib/v2/acm-ecnu/templates/description.art +3 -0
- package/lib/v2/agirls/index.js +71 -0
- package/lib/v2/agirls/maintainer.js +5 -0
- package/lib/v2/agirls/radar.js +25 -0
- package/lib/v2/agirls/router.js +5 -0
- package/lib/v2/agirls/templates/description.art +1 -0
- package/lib/v2/agirls/topic.js +71 -0
- package/lib/v2/agirls/topic_list.js +44 -0
- package/lib/v2/ahjzu/maintainer.js +3 -0
- package/lib/v2/ahjzu/news.js +57 -0
- package/lib/v2/ahjzu/radar.js +13 -0
- package/lib/v2/ahjzu/router.js +3 -0
- package/lib/v2/ajmide/index.js +29 -0
- package/lib/v2/ajmide/maintainer.js +3 -0
- package/lib/v2/ajmide/radar.js +16 -0
- package/lib/v2/ajmide/router.js +3 -0
- package/lib/v2/appledaily/index.js +69 -0
- package/lib/v2/appledaily/maintainer.js +3 -0
- package/lib/v2/appledaily/radar.js +157 -0
- package/lib/v2/appledaily/router.js +3 -0
- package/lib/v2/appledaily/templates/content.art +7 -0
- package/lib/v2/atcoder/contest.js +64 -0
- package/lib/v2/atcoder/maintainer.js +4 -0
- package/lib/v2/atcoder/post.js +38 -0
- package/lib/v2/atcoder/radar.js +22 -0
- package/lib/v2/atcoder/router.js +4 -0
- package/lib/v2/baozimh/index.js +49 -0
- package/lib/v2/baozimh/maintainer.js +3 -0
- package/lib/v2/baozimh/radar.js +13 -0
- package/lib/v2/baozimh/router.js +3 -0
- package/lib/v2/barronschina/index.js +70 -0
- package/lib/v2/barronschina/maintainer.js +3 -0
- package/lib/v2/barronschina/radar.js +13 -0
- package/lib/v2/barronschina/router.js +3 -0
- package/lib/v2/bendibao/maintainer.js +3 -0
- package/lib/{routes → v2}/bendibao/news.js +39 -22
- package/lib/v2/bendibao/radar.js +13 -0
- package/lib/v2/bendibao/router.js +3 -0
- package/lib/v2/blockbeats/index.js +50 -0
- package/lib/v2/blockbeats/maintainer.js +3 -0
- package/lib/v2/blockbeats/radar.js +19 -0
- package/lib/v2/blockbeats/router.js +3 -0
- package/lib/v2/cbirc/index.js +119 -0
- package/lib/v2/cbirc/maintainer.js +3 -0
- package/lib/v2/cbirc/radar.js +13 -0
- package/lib/v2/cbirc/router.js +3 -0
- package/lib/v2/cde/index.js +132 -0
- package/lib/v2/cde/maintainer.js +3 -0
- package/lib/v2/cde/radar.js +43 -0
- package/lib/v2/cde/router.js +3 -0
- package/lib/v2/cde/utils.js +20 -0
- package/lib/v2/chaoxing/maintainer.js +3 -0
- package/lib/v2/chaoxing/qk.js +59 -0
- package/lib/v2/chaoxing/radar.js +13 -0
- package/lib/v2/chaoxing/router.js +3 -0
- package/lib/v2/chaoxing/templates/description.art +3 -0
- package/lib/v2/cnbeta/index.js +15 -0
- package/lib/v2/cnbeta/maintainer.js +5 -0
- package/lib/v2/cnbeta/radar.js +25 -0
- package/lib/v2/cnbeta/router.js +4 -0
- package/lib/v2/cnbeta/type.js +42 -0
- package/lib/v2/cnbeta/utils.js +27 -0
- package/lib/v2/cnki/debut.js +62 -0
- package/lib/v2/cnki/journals.js +74 -0
- package/lib/v2/cnki/maintainer.js +4 -0
- package/lib/v2/cnki/radar.js +19 -0
- package/lib/v2/cnki/router.js +4 -0
- package/lib/v2/cnki/templates/desc.art +5 -0
- package/lib/v2/codeforces/contests.js +37 -0
- package/lib/v2/codeforces/maintainer.js +3 -0
- package/lib/v2/codeforces/radar.js +13 -0
- package/lib/v2/codeforces/router.js +3 -0
- package/lib/v2/codeforces/templates/contest.art +11 -0
- package/lib/{routes → v2}/cool18/index.js +17 -13
- package/lib/v2/cool18/maintainer.js +3 -0
- package/lib/v2/cool18/radar.js +13 -0
- package/lib/v2/cool18/router.js +3 -0
- package/lib/v2/cpcey/index.js +60 -0
- package/lib/v2/cpcey/maintainer.js +3 -0
- package/lib/v2/cpcey/radar.js +27 -0
- package/lib/v2/cpcey/router.js +3 -0
- package/lib/v2/cqwu/index.js +46 -0
- package/lib/v2/cqwu/maintainer.js +3 -0
- package/lib/v2/cqwu/radar.js +27 -0
- package/lib/v2/cqwu/router.js +3 -0
- package/lib/v2/ddosi/category.js +42 -0
- package/lib/v2/ddosi/index.js +41 -0
- package/lib/v2/ddosi/maintainer.js +4 -0
- package/lib/v2/ddosi/radar.js +19 -0
- package/lib/v2/ddosi/router.js +4 -0
- package/lib/{routes/everything → v2}/eventernote/actors.js +0 -0
- package/lib/v2/eventernote/maintainer.js +3 -0
- package/lib/v2/eventernote/radar.js +13 -0
- package/lib/v2/eventernote/router.js +3 -0
- package/lib/v2/filmdeepfocus/index.js +58 -0
- package/lib/v2/filmdeepfocus/maintainer.js +3 -0
- package/lib/v2/filmdeepfocus/radar.js +13 -0
- package/lib/v2/filmdeepfocus/router.js +3 -0
- package/lib/v2/firefox/index.js +69 -0
- package/lib/v2/firefox/maintainer.js +3 -0
- package/lib/v2/firefox/radar.js +13 -0
- package/lib/v2/firefox/router.js +3 -0
- package/lib/v2/firefox/templates/description.art +5 -0
- package/lib/v2/fortunechina/index.js +70 -0
- package/lib/v2/fortunechina/maintainer.js +3 -0
- package/lib/v2/fortunechina/radar.js +13 -0
- package/lib/v2/fortunechina/router.js +3 -0
- package/lib/{routes → v2}/ft/channel.js +1 -0
- package/lib/v2/ft/maintainer.js +4 -0
- package/lib/v2/ft/myft.js +44 -0
- package/lib/v2/ft/radar.js +24 -0
- package/lib/v2/ft/router.js +4 -0
- package/lib/{routes → v2}/ft/utils.js +19 -19
- package/lib/{routes → v2}/gamer/hot.js +15 -4
- package/lib/v2/gamer/maintainer.js +3 -0
- package/lib/v2/gamer/radar.js +13 -0
- package/lib/v2/gamer/router.js +3 -0
- package/lib/v2/gamersecret/index.js +60 -0
- package/lib/v2/gamersecret/maintainer.js +3 -0
- package/lib/v2/gamersecret/radar.js +31 -0
- package/lib/v2/gamersecret/router.js +3 -0
- package/lib/v2/github/comments.js +64 -0
- package/lib/v2/github/maintainer.js +3 -0
- package/lib/v2/github/radar.js +13 -0
- package/lib/v2/github/router.js +3 -0
- package/lib/v2/github/templates/comments-description.art +1 -0
- package/lib/v2/gov/beijing/kw/index.js +44 -0
- package/lib/v2/gov/guangdong/tqyb/sncsyjxh.js +37 -0
- package/lib/v2/gov/guangdong/tqyb/templates/sncsyjxh.art +5 -0
- package/lib/v2/gov/guangdong/tqyb/templates/tfxtq.art +1 -0
- package/lib/v2/gov/guangdong/tqyb/tfxtq.js +30 -0
- package/lib/v2/gov/maintainer.js +8 -0
- package/lib/v2/gov/radar.js +325 -0
- package/lib/v2/gov/router.js +8 -0
- package/lib/v2/gov/shanghai/rsj/ksxm.js +39 -0
- package/lib/v2/gov/shanghai/rsj/templates/ksxm.art +7 -0
- package/lib/v2/gov/shenzhen/hrss/szksy/index.js +41 -0
- package/lib/v2/gov/shenzhen/zzb/index.js +40 -0
- package/lib/v2/guduodata/daily.js +63 -0
- package/lib/v2/guduodata/maintainer.js +3 -0
- package/lib/v2/guduodata/radar.js +13 -0
- package/lib/v2/guduodata/router.js +3 -0
- package/lib/v2/guduodata/templates/daily.art +26 -0
- package/lib/v2/hackernews/index.js +97 -0
- package/lib/v2/hackernews/maintainer.js +3 -0
- package/lib/v2/hackernews/radar.js +13 -0
- package/lib/v2/hackernews/router.js +3 -0
- package/lib/v2/heu/job/list.js +2 -2
- package/lib/v2/hex-rays/index.js +47 -0
- package/lib/v2/hex-rays/maintainer.js +3 -0
- package/lib/v2/hex-rays/radar.js +13 -0
- package/lib/v2/hex-rays/router.js +3 -0
- package/lib/v2/hkepc/index.js +198 -0
- package/lib/v2/hkepc/maintainer.js +3 -0
- package/lib/v2/hkepc/radar.js +19 -0
- package/lib/v2/hkepc/router.js +3 -0
- package/lib/v2/hkepc/templates/description.art +1 -0
- package/lib/v2/hkepc/templates/image.art +1 -0
- package/lib/v2/ithome/zt.js +9 -1
- package/lib/v2/iwara/index.js +42 -0
- package/lib/v2/iwara/maintainer.js +3 -0
- package/lib/v2/iwara/radar.js +19 -0
- package/lib/v2/iwara/router.js +3 -0
- package/lib/v2/jandan/index.js +60 -0
- package/lib/v2/jandan/maintainer.js +4 -0
- package/lib/v2/jandan/radar.js +19 -0
- package/lib/v2/jandan/router.js +4 -0
- package/lib/v2/jandan/section.js +49 -0
- package/lib/v2/jandan/templates/description.art +4 -0
- package/lib/v2/kemono/index.js +99 -0
- package/lib/v2/kemono/maintainer.js +4 -0
- package/lib/v2/kemono/radar.js +13 -0
- package/lib/v2/kemono/router.js +3 -0
- package/lib/v2/knowmedia/index.js +38 -0
- package/lib/v2/knowmedia/maintainer.js +3 -0
- package/lib/v2/knowmedia/radar.js +31 -0
- package/lib/v2/knowmedia/router.js +3 -0
- package/lib/v2/knowmedia/templates/desc.art +3 -0
- package/lib/v2/lanqiao/author.js +63 -0
- package/lib/v2/lanqiao/courses.js +45 -0
- package/lib/v2/lanqiao/maintainer.js +5 -0
- package/lib/v2/lanqiao/questions.js +52 -0
- package/lib/v2/lanqiao/radar.js +25 -0
- package/lib/v2/lanqiao/router.js +5 -0
- package/lib/v2/lanqiao/templates/courseDesc.art +1 -0
- package/lib/v2/lanqiao/utils.js +12 -0
- package/lib/v2/lativ/index.js +42 -0
- package/lib/v2/lativ/maintainer.js +3 -0
- package/lib/v2/lativ/radar.js +13 -0
- package/lib/v2/lativ/router.js +3 -0
- package/lib/v2/lativ/templates/detail.art +9 -0
- package/lib/v2/learnku/maintainer.js +3 -0
- package/lib/v2/learnku/radar.js +13 -0
- package/lib/v2/learnku/router.js +3 -0
- package/lib/v2/learnku/templates/topic.art +14 -0
- package/lib/v2/learnku/topic.js +72 -0
- package/lib/v2/leiphone/index.js +25 -0
- package/lib/v2/leiphone/maintainer.js +5 -0
- package/lib/v2/leiphone/newsflash.js +19 -0
- package/lib/v2/leiphone/radar.js +25 -0
- package/lib/v2/leiphone/router.js +4 -0
- package/lib/v2/leiphone/utils.js +41 -0
- package/lib/v2/line/maintainer.js +3 -0
- package/lib/v2/line/radar.js +13 -0
- package/lib/v2/line/router.js +3 -0
- package/lib/v2/line/today.js +80 -0
- package/lib/v2/logonews/index.js +76 -0
- package/lib/v2/logonews/maintainer.js +8 -0
- package/lib/v2/logonews/radar.js +43 -0
- package/lib/v2/logonews/router.js +5 -0
- package/lib/v2/logonews/templates/description.art +4 -0
- package/lib/v2/medsci/index.js +67 -0
- package/lib/v2/medsci/maintainer.js +3 -0
- package/lib/v2/medsci/radar.js +13 -0
- package/lib/v2/medsci/router.js +3 -0
- package/lib/v2/mvm/index.js +6 -6
- package/lib/{routes → v2}/neea/index.js +0 -0
- package/lib/v2/neea/jlpt.js +52 -0
- package/lib/v2/neea/maintainer.js +4 -0
- package/lib/v2/neea/radar.js +13 -0
- package/lib/v2/neea/router.js +4 -0
- package/lib/v2/netease/maintainer.js +1 -0
- package/lib/v2/netease/radar.js +10 -2
- package/lib/v2/netease/router.js +1 -0
- package/lib/v2/netease/today.js +55 -0
- package/lib/v2/nifd/maintainer.js +3 -0
- package/lib/v2/nifd/radar.js +117 -0
- package/lib/v2/nifd/research.js +52 -0
- package/lib/v2/nifd/router.js +3 -0
- package/lib/v2/nikkei-cn/index.js +77 -0
- package/lib/v2/nikkei-cn/maintainer.js +3 -0
- package/lib/v2/nikkei-cn/radar.js +21 -0
- package/lib/v2/nikkei-cn/router.js +3 -0
- package/lib/v2/nju/gra.js +31 -0
- package/lib/v2/nju/jw.js +45 -0
- package/lib/v2/nju/maintainer.js +8 -0
- package/lib/v2/nju/radar.js +53 -0
- package/lib/v2/nju/rczp.js +38 -0
- package/lib/v2/nju/router.js +8 -0
- package/lib/v2/nju/scit.js +36 -0
- package/lib/v2/nju/zbb.js +81 -0
- package/lib/v2/nju/zcc.js +48 -0
- package/lib/v2/nodejs/blog.js +60 -0
- package/lib/v2/nodejs/maintainer.js +3 -0
- package/lib/v2/nodejs/radar.js +13 -0
- package/lib/v2/nodejs/router.js +3 -0
- package/lib/v2/now/maintainer.js +3 -0
- package/lib/v2/now/news.js +66 -0
- package/lib/v2/now/radar.js +13 -0
- package/lib/v2/now/router.js +3 -0
- package/lib/{routes → v2}/odaily/activity.js +7 -6
- package/lib/v2/odaily/maintainer.js +6 -0
- package/lib/{routes → v2}/odaily/newsflash.js +4 -3
- package/lib/{routes → v2}/odaily/post.js +16 -10
- package/lib/v2/odaily/radar.js +60 -0
- package/lib/v2/odaily/router.js +6 -0
- package/lib/{routes → v2}/odaily/user.js +8 -7
- package/lib/v2/odaily/utils.js +3 -0
- package/lib/v2/people/index.js +83 -0
- package/lib/v2/people/maintainer.js +3 -0
- package/lib/v2/people/radar.js +9 -1
- package/lib/v2/people/router.js +3 -0
- package/lib/{routes → v2}/people/xjpjh.js +0 -0
- package/lib/v2/qidiantu/index.js +87 -0
- package/lib/v2/qidiantu/maintainer.js +4 -0
- package/lib/v2/qidiantu/radar.js +19 -0
- package/lib/v2/qidiantu/router.js +3 -0
- package/lib/v2/ruc/hr.js +22 -16
- package/lib/v2/shmeea/index.js +44 -0
- package/lib/v2/shmeea/maintainer.js +3 -0
- package/lib/v2/shmeea/radar.js +13 -0
- package/lib/v2/shmeea/router.js +3 -0
- package/lib/v2/ssm/maintainer.js +3 -0
- package/lib/v2/ssm/news.js +38 -0
- package/lib/v2/ssm/radar.js +13 -0
- package/lib/v2/ssm/router.js +3 -0
- package/lib/v2/ssm/templates/news.art +1 -0
- package/lib/v2/swissinfo/index.js +1 -0
- package/lib/{routes → v2}/telegram/blog.js +3 -3
- package/lib/{routes → v2}/telegram/channel.js +2 -1
- package/lib/v2/telegram/maintainer.js +5 -0
- package/lib/v2/telegram/radar.js +35 -0
- package/lib/v2/telegram/router.js +5 -0
- package/lib/{routes → v2}/telegram/stickerpack.js +0 -0
- package/lib/v2/topys/index.js +66 -0
- package/lib/v2/topys/maintainer.js +3 -0
- package/lib/v2/topys/radar.js +13 -0
- package/lib/v2/topys/router.js +3 -0
- package/lib/v2/ucas/index.js +59 -0
- package/lib/v2/ucas/maintainer.js +3 -0
- package/lib/v2/ucas/rader.js +47 -0
- package/lib/v2/ucas/router.js +3 -0
- package/lib/v2/uibe/hr.js +19 -15
- package/lib/v2/ulapia/index.js +47 -0
- package/lib/v2/ulapia/maintainer.js +3 -0
- package/lib/v2/ulapia/radar.js +55 -0
- package/lib/v2/ulapia/research.js +38 -0
- package/lib/v2/ulapia/router.js +4 -0
- package/lib/v2/wallstreetcn/live.js +40 -0
- package/lib/v2/wallstreetcn/maintainer.js +5 -0
- package/lib/v2/wallstreetcn/news.js +61 -0
- package/lib/v2/wallstreetcn/radar.js +19 -0
- package/lib/v2/wallstreetcn/router.js +5 -0
- package/lib/{routes → v2}/wenku8/chapter.js +0 -0
- package/lib/v2/wenku8/index.js +52 -0
- package/lib/v2/wenku8/maintainer.js +5 -0
- package/lib/v2/wenku8/radar.js +85 -0
- package/lib/v2/wenku8/router.js +5 -0
- package/lib/{routes → v2}/wenku8/volume.js +0 -0
- package/lib/v2/xaut/index.js +72 -0
- package/lib/v2/xaut/jwc.js +65 -0
- package/lib/v2/xaut/maintainer.js +5 -0
- package/lib/v2/xaut/radar.js +23 -0
- package/lib/v2/xaut/router.js +5 -0
- package/lib/v2/xaut/rsc.js +67 -0
- package/lib/v2/zaker/index.js +65 -0
- package/lib/v2/zaker/maintainer.js +3 -0
- package/lib/v2/zaker/radar.js +19 -0
- package/lib/v2/zaker/router.js +3 -0
- package/lib/v2/zjgtjy/index.js +46 -0
- package/lib/v2/zjgtjy/maintainer.js +3 -0
- package/lib/v2/zjgtjy/radar.js +31 -0
- package/lib/v2/zjgtjy/router.js +3 -0
- package/package.json +1 -1
- package/lib/routes/cnbeta/home.js +0 -53
- package/lib/routes/cnbeta/topic.js +0 -75
- package/lib/routes/ft/myft.js +0 -46
- package/lib/routes/hackernews/story.js +0 -60
- package/lib/routes/hex-rays/index.js +0 -28
- package/lib/routes/hkepc/index.js +0 -164
- package/lib/routes/jandan/article.js +0 -62
- package/lib/routes/jandan/pic.js +0 -89
- package/lib/routes/learnku/topic.js +0 -53
- package/lib/routes/medsci/recommend.js +0 -51
- package/lib/routes/people/cpc/24h.js +0 -52
- package/lib/routes/people/env.js +0 -73
- package/lib/routes/people/opinion.js +0 -69
- package/lib/routes/topys/article.js +0 -55
- package/lib/routes/universities/cqwu/news.js +0 -39
- package/lib/routes/wallstreetcn/live.js +0 -44
- package/lib/routes/wallstreetcn/news.js +0 -33
- package/lib/routes/zaker/focusread.js +0 -65
- package/lib/routes/zaker/source.js +0 -66
|
@@ -4,10 +4,13 @@ const { parseDate } = require('@/utils/parse-date');
|
|
|
4
4
|
const timezone = require('@/utils/timezone');
|
|
5
5
|
const host = 'https://www.dykszx.com';
|
|
6
6
|
|
|
7
|
+
// disable ssl check
|
|
8
|
+
const options = { https: { rejectUnauthorized: false } };
|
|
9
|
+
|
|
7
10
|
const getContent = (href, caches) => {
|
|
8
11
|
const newsPage = `${host}${href}`;
|
|
9
12
|
return caches.tryGet(newsPage, async () => {
|
|
10
|
-
const response = await got.get(newsPage);
|
|
13
|
+
const response = await got.get(newsPage, options);
|
|
11
14
|
const data = response.data;
|
|
12
15
|
const $ = cheerio.load(data);
|
|
13
16
|
const newsTime = $('body > div:nth-child(3) > div.page.w > div.shuxing.w')
|
|
@@ -31,7 +34,7 @@ const newsTypeObj = {
|
|
|
31
34
|
|
|
32
35
|
module.exports = async (ctx) => {
|
|
33
36
|
const newsType = ctx.params.type || 'all';
|
|
34
|
-
const response = await got
|
|
37
|
+
const response = await got(host, options);
|
|
35
38
|
const data = response.data;
|
|
36
39
|
const $ = cheerio.load(data);
|
|
37
40
|
const newsList = $(newsTypeObj[newsType].selector).toArray();
|
|
@@ -1,56 +1,58 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
2
|
const cheerio = require('cheerio');
|
|
3
|
-
const
|
|
3
|
+
const timezone = require('@/utils/timezone');
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
5
|
|
|
5
6
|
module.exports = async (ctx) => {
|
|
6
7
|
const link = `https://news.futunn.com/main`;
|
|
7
8
|
|
|
8
9
|
const response = await got.get(link);
|
|
9
10
|
const $ = cheerio.load(response.data);
|
|
10
|
-
|
|
11
|
-
const
|
|
11
|
+
|
|
12
|
+
const contents = $('script:not([src]):contains("window._params")');
|
|
13
|
+
const params = contents.html().trim().slice(17, -1);
|
|
12
14
|
|
|
13
15
|
const newslist = JSON.parse(params).preList;
|
|
14
16
|
|
|
15
17
|
const out = await Promise.all(
|
|
16
|
-
newslist
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
18
|
+
newslist
|
|
19
|
+
.filter((info) => {
|
|
20
|
+
const url = new URL(info.url);
|
|
21
|
+
if (url.hostname !== 'news.futunn.com') {
|
|
22
|
+
// ignore videos.futunn.com
|
|
23
|
+
return false;
|
|
24
|
+
} else if (url.searchParams.get('src') !== '3') {
|
|
25
|
+
// ignore src=12 redirecting to mp.weixin.qq.com
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
29
|
+
})
|
|
30
|
+
.map((info) =>
|
|
31
|
+
ctx.cache.tryGet(info.url, async () => {
|
|
32
|
+
const response = await got({
|
|
33
|
+
url: info.url,
|
|
34
|
+
method: 'get',
|
|
35
|
+
headers: {
|
|
36
|
+
Referer: link,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const $ = cheerio.load(response.data);
|
|
41
|
+
const description = $('div.newsDetailBox div.main div.inner').html();
|
|
42
|
+
const date = $('div.timeBar').children().remove().end().text().trim();
|
|
43
|
+
|
|
44
|
+
info.link = info.url;
|
|
45
|
+
info.description = description;
|
|
46
|
+
info.pubDate = timezone(parseDate(date, 'YYYY/MM/DD HH:mm'), +8);
|
|
47
|
+
|
|
48
|
+
return info;
|
|
49
|
+
})
|
|
50
|
+
)
|
|
48
51
|
);
|
|
49
|
-
const outfilter = out.filter((t) => t.description !== '原文已被删除');
|
|
50
52
|
|
|
51
53
|
ctx.state.data = {
|
|
52
54
|
title: `富途牛牛要闻`,
|
|
53
55
|
link,
|
|
54
|
-
item:
|
|
56
|
+
item: out,
|
|
55
57
|
};
|
|
56
58
|
};
|
|
@@ -3,7 +3,7 @@ const got = require('@/utils/got');
|
|
|
3
3
|
const cheerio = require('cheerio');
|
|
4
4
|
|
|
5
5
|
module.exports = async (ctx) => {
|
|
6
|
-
const currentUrl = `https://www.gelonghui.com/user/${ctx.params.id}`;
|
|
6
|
+
const currentUrl = `https://www.gelonghui.com/user/${ctx.params.id}?type=article`;
|
|
7
7
|
const response = await got({
|
|
8
8
|
method: 'get',
|
|
9
9
|
url: currentUrl,
|
|
@@ -27,19 +27,21 @@ module.exports = async (ctx) => {
|
|
|
27
27
|
ctx.state.data = {
|
|
28
28
|
title: 'HackerOne Hacker Activity',
|
|
29
29
|
link: 'https://hackerone.com/hacktivity',
|
|
30
|
-
item: response.data.data.hacktivity_items.edges
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
item: response.data.data.hacktivity_items.edges
|
|
31
|
+
.filter((item) => item.node.type === 'Disclosed')
|
|
32
|
+
.map((item) => {
|
|
33
|
+
const author = item.node.reporter ? item.node.reporter.username : 'Someone';
|
|
34
|
+
const vendor = item.node.team.name;
|
|
35
|
+
const state = item.node.report.substate.replace(/^[a-z]/g, (L) => L.toUpperCase());
|
|
36
|
+
const severity = item.node.severity_rating ? item.node.severity_rating.replace(/^[a-z]/g, (L) => L.toUpperCase()) : 'No Rating';
|
|
37
|
+
const awarded = item.node.total_awarded_amount ? item.node.total_awarded_amount : 0;
|
|
38
|
+
return {
|
|
39
|
+
title: item.node.report.title,
|
|
40
|
+
description: `By ${author} to ${vendor} | ${state} | ${severity} | $${awarded}`,
|
|
41
|
+
author,
|
|
42
|
+
pubDate: new Date(item.node.latest_disclosable_activity_at).toUTCString(),
|
|
43
|
+
link: `https://hackerone.com/reports/${item.node.databaseId}`,
|
|
44
|
+
};
|
|
45
|
+
}),
|
|
44
46
|
};
|
|
45
47
|
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const cheerio = require('cheerio');
|
|
2
|
+
const got = require('@/utils/got');
|
|
3
|
+
|
|
4
|
+
module.exports = async (ctx) => {
|
|
5
|
+
const url = `http://${ctx.params.url}`;
|
|
6
|
+
const res = await got.get(`${url}/archives/`);
|
|
7
|
+
const $ = cheerio.load(res.data);
|
|
8
|
+
|
|
9
|
+
const list = $('.list-group-item');
|
|
10
|
+
|
|
11
|
+
const count = [];
|
|
12
|
+
for (let i = 0; i < Math.min(list.length, 5); i++) {
|
|
13
|
+
count.push(i);
|
|
14
|
+
}
|
|
15
|
+
const out = await Promise.all(
|
|
16
|
+
count.map(async (i) => {
|
|
17
|
+
const each = $(list[i]);
|
|
18
|
+
const storyLink = each.attr('href');
|
|
19
|
+
const item = {
|
|
20
|
+
title: each.find('.archive-post-title').text(),
|
|
21
|
+
link: new URL(storyLink, url),
|
|
22
|
+
};
|
|
23
|
+
const key = item.link;
|
|
24
|
+
const value = await ctx.cache.get(key);
|
|
25
|
+
|
|
26
|
+
if (value) {
|
|
27
|
+
item.description = value;
|
|
28
|
+
} else {
|
|
29
|
+
const storyDeatil = await got.get(item.link);
|
|
30
|
+
const data = storyDeatil.data;
|
|
31
|
+
const $ = cheerio.load(data);
|
|
32
|
+
item.pubDate = $('time').attr('datetime');
|
|
33
|
+
item.description = $('.markdown-body').html();
|
|
34
|
+
ctx.cache.set(key, item.description);
|
|
35
|
+
}
|
|
36
|
+
return Promise.resolve(item);
|
|
37
|
+
})
|
|
38
|
+
);
|
|
39
|
+
ctx.state.data = {
|
|
40
|
+
title: $('.navbar-brand strong').text(),
|
|
41
|
+
link: url,
|
|
42
|
+
description: $('[name=description]').attr('content'),
|
|
43
|
+
item: out,
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const timezone = require('@/utils/timezone');
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
const language = ctx.params.language || 'e';
|
|
8
|
+
|
|
9
|
+
const rootUrl = 'http://world.kbs.co.kr';
|
|
10
|
+
const currentUrl = `${rootUrl}/service/news_today.htm?lang=${language}`;
|
|
11
|
+
|
|
12
|
+
const response = await got({
|
|
13
|
+
method: 'get',
|
|
14
|
+
url: currentUrl,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const $ = cheerio.load(response.data);
|
|
18
|
+
|
|
19
|
+
const list = $('.comp_text_1x article')
|
|
20
|
+
.map((_, item) => {
|
|
21
|
+
item = $(item);
|
|
22
|
+
|
|
23
|
+
const a = item.find('h2 a');
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
title: a.text(),
|
|
27
|
+
category: item.find('.cate').text(),
|
|
28
|
+
link: `${rootUrl}/service${a.attr('href').replace('./', '/')}`,
|
|
29
|
+
pubDate: timezone(parseDate(item.find('.date').text()), +9),
|
|
30
|
+
};
|
|
31
|
+
})
|
|
32
|
+
.get();
|
|
33
|
+
|
|
34
|
+
const items = await Promise.all(
|
|
35
|
+
list.map((item) =>
|
|
36
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
37
|
+
const detailResponse = await got({
|
|
38
|
+
method: 'get',
|
|
39
|
+
url: item.link,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const content = cheerio.load(detailResponse.data);
|
|
43
|
+
|
|
44
|
+
item.description = content('.body_txt').html();
|
|
45
|
+
|
|
46
|
+
return item;
|
|
47
|
+
})
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
ctx.state.data = {
|
|
52
|
+
title: `Latest News | KBS WORLD`,
|
|
53
|
+
link: currentUrl,
|
|
54
|
+
item: items,
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -3,23 +3,47 @@ const cheerio = require('cheerio');
|
|
|
3
3
|
const got = require('@/utils/got');
|
|
4
4
|
const LZString = require('lz-string');
|
|
5
5
|
|
|
6
|
-
const getChapters = ($) =>
|
|
7
|
-
|
|
6
|
+
const getChapters = ($) => {
|
|
7
|
+
let time_mark = 100;
|
|
8
|
+
// 用于一次更新多个新章节的排序
|
|
9
|
+
let new_time_mark = 0;
|
|
10
|
+
return $('h4')
|
|
8
11
|
.toArray()
|
|
9
|
-
.reverse()
|
|
10
|
-
.reduce((acc, curr) => acc.concat($(curr).children('li').toArray()), [])
|
|
11
12
|
.map((ele) => {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
const categoryName = $(ele).text();
|
|
14
|
+
while (!$(ele.next).hasClass('chapter-list')) {
|
|
15
|
+
ele = ele.next;
|
|
16
|
+
}
|
|
17
|
+
ele = ele.next;
|
|
18
|
+
return $(ele)
|
|
19
|
+
.children('ul')
|
|
20
|
+
.toArray()
|
|
21
|
+
.reverse()
|
|
22
|
+
.reduce((acc, curr) => acc.concat($(curr).children('li').toArray()), [])
|
|
23
|
+
.map((ele) => {
|
|
24
|
+
const a = $(ele).children('a');
|
|
25
|
+
// 通过操作发布时间来对章节进行排序,如果是刚刚更新的单行本或者番外,保留最新更新时间
|
|
26
|
+
let pDate = new Date(new Date($.pubDate) - time_mark++ * 1000);
|
|
27
|
+
if (a.find('em').length > 0) {
|
|
28
|
+
// 对更新的章节也进行排序
|
|
29
|
+
pDate = new Date(new Date($.pubDate) - new_time_mark++ * 1000);
|
|
30
|
+
$.newChapterCnt++;
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
link: resolve('https://www.manhuagui.com/', a.attr('href')),
|
|
34
|
+
title: a.attr('title'),
|
|
35
|
+
pub_date: pDate,
|
|
36
|
+
num: a.find('i').text(),
|
|
37
|
+
guid: resolve('https://www.manhuagui.com/', a.attr('href')),
|
|
38
|
+
category: categoryName,
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
})
|
|
42
|
+
.reduce((acc, curr) => acc.concat(curr));
|
|
43
|
+
};
|
|
20
44
|
module.exports = async (ctx) => {
|
|
21
45
|
const { id } = ctx.params;
|
|
22
|
-
|
|
46
|
+
const chapterCnt = Number(ctx.params.chapterCnt || 0);
|
|
23
47
|
const { data } = await got.get(`https://www.manhuagui.com/comic/${id}/`);
|
|
24
48
|
const $ = cheerio.load(data);
|
|
25
49
|
|
|
@@ -30,24 +54,46 @@ module.exports = async (ctx) => {
|
|
|
30
54
|
$('#__VIEWSTATE').remove();
|
|
31
55
|
}
|
|
32
56
|
}
|
|
33
|
-
|
|
34
57
|
const bookTitle = $('.book-title > h1').text();
|
|
35
58
|
const bookIntro = $('#intro-all').text();
|
|
36
59
|
const coverImgSrc = $('.book-cover img').attr('src');
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
60
|
+
// 对最新更新的章节增加了pubDate
|
|
61
|
+
const reg = new RegExp('最近于.+更新至');
|
|
62
|
+
// 处理已下架的漫画
|
|
63
|
+
if ($('.status > span').text().indexOf('已下架') > 0) {
|
|
64
|
+
ctx.state.data = {
|
|
65
|
+
title: `看漫画 - ${bookTitle} 已下架`,
|
|
66
|
+
link: `https://www.manhuagui.com/comic/${id}/`,
|
|
67
|
+
description: bookIntro,
|
|
68
|
+
item: [{ link: `https://www.manhuagui.com/comic/${id}/`, title: bookTitle, description: '已下架' }],
|
|
69
|
+
};
|
|
70
|
+
} else {
|
|
71
|
+
const pub_date_str = $('.status > span').text().match(reg)[0].replace('最近于 [', '').replace('] 更新至', '');
|
|
72
|
+
// 为了能在闭包内访问到这个日期而不是每次需要处理这个最近更新日期
|
|
73
|
+
$.pubDate = new Date(pub_date_str).toUTCString();
|
|
74
|
+
$.newChapterCnt = 0;
|
|
75
|
+
const chapters = getChapters($);
|
|
76
|
+
const genResult = (chapter) => ({
|
|
77
|
+
link: chapter.link,
|
|
78
|
+
title: chapter.title,
|
|
79
|
+
pubDate: chapter.pub_date,
|
|
80
|
+
guid: chapter.guid,
|
|
81
|
+
category: chapter.category,
|
|
82
|
+
description: `
|
|
43
83
|
<h1>${chapter.num}</h1>
|
|
44
|
-
<img src=
|
|
84
|
+
<img src='${coverImgSrc}' />
|
|
45
85
|
`.trim(),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
86
|
+
});
|
|
87
|
+
const items = chapters.map(genResult);
|
|
88
|
+
let itemsLen = items.length;
|
|
89
|
+
if (chapterCnt > 0) {
|
|
90
|
+
itemsLen = chapterCnt < $.newChapterCnt ? $.newChapterCnt : chapterCnt;
|
|
91
|
+
}
|
|
92
|
+
ctx.state.data = {
|
|
93
|
+
title: `看漫画 - ${bookTitle}`,
|
|
94
|
+
link: `https://www.manhuagui.com/comic/${id}/`,
|
|
95
|
+
description: bookIntro,
|
|
96
|
+
item: items.slice(0, itemsLen),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
53
99
|
};
|
|
@@ -3,23 +3,47 @@ const cheerio = require('cheerio');
|
|
|
3
3
|
const got = require('@/utils/got');
|
|
4
4
|
const LZString = require('lz-string');
|
|
5
5
|
|
|
6
|
-
const getChapters = ($) =>
|
|
7
|
-
|
|
6
|
+
const getChapters = ($) => {
|
|
7
|
+
let time_mark = 0;
|
|
8
|
+
// 用于一次更新多个新章节的排序
|
|
9
|
+
let new_time_mark = 0;
|
|
10
|
+
return $('h4')
|
|
8
11
|
.toArray()
|
|
9
|
-
.reverse()
|
|
10
|
-
.reduce((acc, curr) => acc.concat($(curr).children('li').toArray()), [])
|
|
11
12
|
.map((ele) => {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
const categoryName = $(ele).text();
|
|
14
|
+
while (!$(ele.next).hasClass('chapter-list')) {
|
|
15
|
+
ele = ele.next;
|
|
16
|
+
}
|
|
17
|
+
ele = ele.next;
|
|
18
|
+
return $(ele)
|
|
19
|
+
.children('ul')
|
|
20
|
+
.toArray()
|
|
21
|
+
.reverse()
|
|
22
|
+
.reduce((acc, curr) => acc.concat($(curr).children('li').toArray()), [])
|
|
23
|
+
.map((ele) => {
|
|
24
|
+
const a = $(ele).children('a');
|
|
25
|
+
// 通过操作发布时间来对章节进行排序,如果是刚刚更新的单行本或者番外,保留最新更新时间
|
|
26
|
+
let pDate = new Date(new Date($.pubDate) - time_mark++ * 1000);
|
|
27
|
+
if (a.find('em').length > 0) {
|
|
28
|
+
// 对更新的章节也进行排序
|
|
29
|
+
pDate = new Date(new Date($.pubDate) - new_time_mark++ * 1000);
|
|
30
|
+
$.newChapterCnt++;
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
link: resolve('https://www.mhgui.com/', a.attr('href')),
|
|
34
|
+
title: a.attr('title'),
|
|
35
|
+
pub_date: pDate,
|
|
36
|
+
num: a.find('i').text(),
|
|
37
|
+
guid: resolve('https://www.mhgui.com/', a.attr('href')),
|
|
38
|
+
category: categoryName,
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
})
|
|
42
|
+
.reduce((acc, curr) => acc.concat(curr));
|
|
43
|
+
};
|
|
20
44
|
module.exports = async (ctx) => {
|
|
21
45
|
const { id } = ctx.params;
|
|
22
|
-
|
|
46
|
+
const chapterCnt = Number(ctx.params.chapterCnt || 0);
|
|
23
47
|
const { data } = await got.get(`https://www.mhgui.com/comic/${id}/`);
|
|
24
48
|
const $ = cheerio.load(data);
|
|
25
49
|
|
|
@@ -30,24 +54,46 @@ module.exports = async (ctx) => {
|
|
|
30
54
|
$('#__VIEWSTATE').remove();
|
|
31
55
|
}
|
|
32
56
|
}
|
|
33
|
-
|
|
34
57
|
const bookTitle = $('.book-title > h1').text();
|
|
35
58
|
const bookIntro = $('#intro-all').text();
|
|
36
59
|
const coverImgSrc = $('.book-cover img').attr('src');
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
60
|
+
// 对最新更新的章节增加了pubDate
|
|
61
|
+
const reg = new RegExp('最近于.+更新至');
|
|
62
|
+
// 处理已下架的漫画
|
|
63
|
+
if ($('.status > span').text().indexOf('已下架') > 0) {
|
|
64
|
+
ctx.state.data = {
|
|
65
|
+
title: `看漫画 - ${bookTitle} 已下架`,
|
|
66
|
+
link: `https://www.mhgui.com/comic/${id}/`,
|
|
67
|
+
description: bookIntro,
|
|
68
|
+
item: [{ link: `https://www.mhgui.com/comic/${id}/`, title: bookTitle, description: '已下架' }],
|
|
69
|
+
};
|
|
70
|
+
} else {
|
|
71
|
+
const pub_date_str = $('.status > span').text().match(reg)[0].replace('最近于 [', '').replace('] 更新至', '');
|
|
72
|
+
// 为了能在闭包内访问到这个日期而不是每次需要处理这个最近更新日期
|
|
73
|
+
$.pubDate = new Date(pub_date_str).toUTCString();
|
|
74
|
+
$.newChapterCnt = 0;
|
|
75
|
+
const chapters = getChapters($);
|
|
76
|
+
const genResult = (chapter) => ({
|
|
77
|
+
link: chapter.link,
|
|
78
|
+
title: chapter.title,
|
|
79
|
+
pubDate: chapter.pub_date,
|
|
80
|
+
guid: chapter.guid,
|
|
81
|
+
category: chapter.category,
|
|
82
|
+
description: `
|
|
43
83
|
<h1>${chapter.num}</h1>
|
|
44
|
-
<img src=
|
|
84
|
+
<img src='${coverImgSrc}' />
|
|
45
85
|
`.trim(),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
86
|
+
});
|
|
87
|
+
const items = chapters.map(genResult);
|
|
88
|
+
let itemsLen = items.length;
|
|
89
|
+
if (chapterCnt > 0) {
|
|
90
|
+
itemsLen = chapterCnt < $.newChapterCnt ? $.newChapterCnt : chapterCnt;
|
|
91
|
+
}
|
|
92
|
+
ctx.state.data = {
|
|
93
|
+
title: `看漫画 - ${bookTitle}`,
|
|
94
|
+
link: `https://www.mhgui.com/comic/${id}/`,
|
|
95
|
+
description: bookIntro,
|
|
96
|
+
item: items.slice(0, itemsLen),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
53
99
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
|
+
const config = require('@/config').value;
|
|
2
3
|
|
|
3
4
|
module.exports = async (ctx) => {
|
|
4
5
|
const id = ctx.params.id;
|
|
@@ -8,6 +9,7 @@ module.exports = async (ctx) => {
|
|
|
8
9
|
url: 'https://music.163.com/api/v3/playlist/detail',
|
|
9
10
|
headers: {
|
|
10
11
|
Referer: 'https://music.163.com/',
|
|
12
|
+
Cookie: config.ncm.cookies,
|
|
11
13
|
},
|
|
12
14
|
form: {
|
|
13
15
|
id,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
|
+
const config = require('@/config').value;
|
|
2
3
|
|
|
3
|
-
const headers = {
|
|
4
|
+
const headers = {
|
|
5
|
+
cookie: config.ncm.cookies,
|
|
6
|
+
Referer: 'https://music.163.com/',
|
|
7
|
+
};
|
|
4
8
|
|
|
5
9
|
function getItem(records) {
|
|
6
10
|
if (!records || records.length === 0) {
|
|
@@ -37,7 +41,7 @@ function getItem(records) {
|
|
|
37
41
|
|
|
38
42
|
module.exports = async (ctx) => {
|
|
39
43
|
const uid = ctx.params.uid;
|
|
40
|
-
const type = ctx.params.type || 0;
|
|
44
|
+
const type = parseInt(ctx.params.type) || 0;
|
|
41
45
|
|
|
42
46
|
const url = `http://music.163.com/api/v1/play/record?uid=${uid}&type=${type}`;
|
|
43
47
|
const response = await got({ url, headers });
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
2
|
const cheerio = require('cheerio');
|
|
3
3
|
|
|
4
|
-
const baseUrl = 'https://
|
|
4
|
+
const baseUrl = 'https://www.aixdzs.com';
|
|
5
5
|
|
|
6
6
|
module.exports = async (ctx) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
if (ctx.params.id2) {
|
|
8
|
+
const redirect = await got.head(`https://read.aixdzs.com/${ctx.params.id1}/${ctx.params.id2}/`, { followRedirect: false });
|
|
9
|
+
const redirectUrl = redirect.headers.location;
|
|
10
|
+
const novel = redirectUrl.substring(1 + redirectUrl.lastIndexOf('/'));
|
|
11
|
+
|
|
12
|
+
ctx.status = 301;
|
|
13
|
+
ctx.redirect(`/axdzs/${novel}`);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const novel = ctx.params.novel;
|
|
18
|
+
const novelUrl = `${baseUrl}/novel/${novel}/`;
|
|
19
|
+
const response = await got.get(novelUrl);
|
|
14
20
|
|
|
15
21
|
const data = response.data;
|
|
16
22
|
const $ = cheerio.load(data);
|
|
@@ -19,11 +25,15 @@ module.exports = async (ctx) => {
|
|
|
19
25
|
const description = $('meta[name="description"]').attr('content');
|
|
20
26
|
const lastChapter = $('.chapter').last().children();
|
|
21
27
|
const secondChapter = $('.chapter').last().prev().children();
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
let lastChapterUrl = lastChapter.attr('href');
|
|
29
|
+
let secondChapterUrl = secondChapter.attr('href');
|
|
30
|
+
if (lastChapterUrl.startsWith('/')) {
|
|
31
|
+
lastChapterUrl = baseUrl + lastChapterUrl;
|
|
32
|
+
secondChapterUrl = baseUrl + secondChapterUrl;
|
|
33
|
+
}
|
|
24
34
|
const lastChapterContent = await ctx.cache.tryGet(lastChapterUrl, async () => {
|
|
25
|
-
const
|
|
26
|
-
const $ = cheerio.load(
|
|
35
|
+
const res = await got.get(lastChapterUrl);
|
|
36
|
+
const $ = cheerio.load(res.data, { decodeEntities: false });
|
|
27
37
|
return $('.content').html();
|
|
28
38
|
});
|
|
29
39
|
// 以下需要判断最新章节是否已填充内容
|
|
@@ -3,7 +3,7 @@ const cheerio = require('cheerio');
|
|
|
3
3
|
const iconv = require('iconv-lite');
|
|
4
4
|
const asyncPool = require('tiny-async-pool');
|
|
5
5
|
|
|
6
|
-
const baseUrl = '
|
|
6
|
+
const baseUrl = 'http://www.biquge5200.com/';
|
|
7
7
|
// 获取小说的最新章节列表
|
|
8
8
|
module.exports = async (ctx) => {
|
|
9
9
|
const id = ctx.params.id; // 小说id
|