LuckyPuppy514 / Play-With-MPV

使用 MPV 播放网页中的视频
MIT License
509 stars 14 forks source link

标题中特殊字符报错 #145

Open verygoodlee opened 3 months ago

verygoodlee commented 3 months ago

https://www.bilibili.com/video/BV1Qr42147pQ image 看报错位置是在这里,可能是标题中 𝘾𝙝𝙚𝙘𝙠𝙡𝙞𝙨𝙩 造成的,不是常规的英文字符,有点特殊 https://github.com/LuckyPuppy514/Play-With-MPV/blob/d4f6dd11a234b8e90e81796d351cec90cc263941/play-with-mpv.user.js#L1903-L1905

edit: 控制台输入'𝘾𝙝𝙚𝙘𝙠𝙡𝙞𝙨𝙩'.length竟然是18,一个字符占2个长度 image 应该是它造成substring()截在了半个字符的位置,导致encodeURIComponent()报错 image

verygoodlee commented 3 months ago

换成 #125 中的截取方式没问题,抓异常的方式还是很稳定

LuckyPuppy514 commented 3 months ago

处理起来还有点麻烦,还是先用 #125 的办法了 😂 v4.0.7 已更新