mirror of
https://github.com/blackmatrix7/ios_rule_script.git
synced 2024-12-25 08:39:18 +08:00
修复知乎首页视频无法正常播放的问题 close #383
This commit is contained in:
parent
1800f91853
commit
2af634ec88
@ -184,7 +184,7 @@ let magicJS = MagicJS(scriptName, "INFO");
|
|||||||
// 修正由于JS number类型精度问题,导致JSON.parse精度丢失,引起视频无法自动播放的问题
|
// 修正由于JS number类型精度问题,导致JSON.parse精度丢失,引起视频无法自动播放的问题
|
||||||
try {
|
try {
|
||||||
if (element.hasOwnProperty("extra") && element["extra"].hasOwnProperty("type") && element["extra"]["type"] === "zvideo") {
|
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;
|
element["common_card"]["feed_content"]["video"]["id"] = video_id;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user