mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-01 14:57:14 +08:00
fix(route): fix radio canada by fixing regular expression to match correct data (#14630)
This commit is contained in:
@@ -31,10 +31,10 @@ export default async (ctx) => {
|
||||
});
|
||||
|
||||
const $ = load(detailResponse.data);
|
||||
const rcState = $('script:contains("window._rcState_ = JSON.parse")')
|
||||
const rcState = $('script:contains("window._rcState_ = ")')
|
||||
.text()
|
||||
.match(/JSON\.parse\((".*")\);/)[1];
|
||||
const rcStateJson = JSON.parse(JSON.parse(rcState));
|
||||
.match(/window\._rcState_ = (.*);/)[1];
|
||||
const rcStateJson = JSON.parse(rcState);
|
||||
const news = Object.values(rcStateJson.pagesV2.pages)[0];
|
||||
item.description = news.data.newsStory.body.html.replaceAll('\\n', '<br>');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user