forked from DIYgod/RSSHub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #774 from DIYgod/master
[pull] master from diygod:master
- Loading branch information
Showing
30 changed files
with
397 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{ if item.img }} | ||
<img src="{{ item.img }}"><br> | ||
{{ /if }} | ||
{{ if item.show }} | ||
{{ each item.show s }} | ||
{{ s }}<br> | ||
{{ /each }} | ||
{{ /if }} | ||
{{ item.desc }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const got = require('@/utils/got'); | ||
const cheerio = require('cheerio'); | ||
const { art } = require('@/utils/render'); | ||
const path = require('path'); | ||
|
||
module.exports = async (ctx) => { | ||
const { board = 'realtime' } = ctx.params; | ||
const link = `https://top.baidu.com/board?tab=${board}`; | ||
const { data: response } = await got(link); | ||
|
||
const $ = cheerio.load(response); | ||
|
||
const { data } = JSON.parse( | ||
$('#sanRoot') | ||
.contents() | ||
.filter((e) => e.nodeType === 8) | ||
.prevObject[0].data.match(/s-data:(.*)/)[1] | ||
); | ||
|
||
const items = data.cards[0].content.map((item) => ({ | ||
title: item.word, | ||
description: art(path.join(__dirname, 'templates/top.art'), { | ||
item, | ||
}), | ||
link: item.rawUrl, | ||
})); | ||
|
||
ctx.state.data = { | ||
title: `${data.curBoardName} - 百度热搜`, | ||
description: $('meta[name="description"]').attr('content'), | ||
link, | ||
item: items, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
const got = require('@/utils/got'); | ||
const cheerio = require('cheerio'); | ||
const { parseDate } = require('@/utils/parse-date'); | ||
const { art } = require('@/utils/render'); | ||
const path = require('path'); | ||
|
||
module.exports = async (ctx) => { | ||
const { id } = ctx.params; | ||
|
||
const { data: response } = await got(`https://www.iq.com/album/${id}`); | ||
|
||
const $ = cheerio.load(response); | ||
const nextData = JSON.parse($('#__NEXT_DATA__').text()); | ||
const { album } = nextData.props.initialState; | ||
|
||
const { | ||
data: { data: baseInfo }, | ||
} = await got(`https://pcw-api.iqiyi.com/album/album/baseinfo/${album.videoAlbumInfo.albumId}`); | ||
|
||
if (Object.keys(album.cacheAlbumList).length === 0) { | ||
throw Error(`${baseInfo.name} is not available in this server region.`); | ||
} | ||
|
||
let pos = 1; | ||
let hasMore = false; | ||
let epgs = []; | ||
do { | ||
const { | ||
data: { data }, | ||
// eslint-disable-next-line no-await-in-loop | ||
} = await got(`https://pcw-api.iq.com/api/v2/episodeListSource/${album.videoAlbumInfo.albumId}`, { | ||
searchParams: { | ||
platformId: 3, | ||
modeCode: 'intl', | ||
langCode: 'zh_cn', | ||
endOrder: album.videoAlbumInfo.maxOrder, | ||
startOrder: pos, | ||
}, | ||
}); | ||
epgs = [...epgs, ...data.epg]; | ||
pos = data.pos; | ||
hasMore = data.hasMore; | ||
} while (hasMore); | ||
|
||
const items = epgs.map((item) => ({ | ||
title: item.name, | ||
description: art(path.join(__dirname, 'templates/album.art'), { | ||
item, | ||
}), | ||
link: `https://www.iq.com/play/${item.playLocSuffix}`, | ||
pubDate: parseDate(item.initIssueTime), | ||
})); | ||
|
||
ctx.state.data = { | ||
title: baseInfo.name, | ||
description: baseInfo.description, | ||
image: album.videoAlbumInfo.albumFocus1024, | ||
link: `https://www.iq.com/album/${album.videoAlbumInfo.albumLocSuffix}`, | ||
item: items, | ||
allowEmpty: true, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
'/album/:id': ['TonyRL'], | ||
'/user/video/:uid': ['talengu'], | ||
}; |
Oops, something went wrong.
937fa4d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
rsshub-master – ./
rsshub-master-auto-bot-ty.vercel.app
rsshub-master-git-master-auto-bot-ty.vercel.app
rsshub-master.vercel.app