Skip to content

Commit

Permalink
修复知乎首页视频无法正常播放的问题 close blackmatrix7#383
Browse files Browse the repository at this point in the history
  • Loading branch information
blackmatrix7 committed Aug 20, 2021
1 parent 1800f91 commit 2af634e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion script/zhihu/zhihu_plus.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2af634e

Please sign in to comment.