修复知乎首页视频无法正常播放的问题 close #383

This commit is contained in:
blackmatrix7 2021-08-20 19:45:33 +08:00
parent 1800f91853
commit 2af634ec88

View File

@ -184,7 +184,7 @@ let magicJS = MagicJS(scriptName, "INFO");
// 修正由于JS number类型精度问题导致JSON.parse精度丢失引起视频无法自动播放的问题
try {
if (element.hasOwnProperty("extra") && element["extra"].hasOwnProperty("type") && element["extra"]["type"] === "zvideo") {
let video_id = element["common_card"]["feed_content"]["video"]["customized_page_url"].match(/https?:\/\/www\.zhihu\.com\/[^?]*\?(videoID|content_id)=(\d*)/)[1];
let video_id = element["common_card"]["feed_content"]["video"]["customized_page_url"].match(/https?:\/\/www\.zhihu\.com\/[^=]*=(\d*)/)[1];
element["common_card"]["feed_content"]["video"]["id"] = video_id;
}
} catch (err) {