LuckyPuppy514 / Play-With-MPV

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

能否支持 “使用 IINA 播放器打开” 功能? #25

Closed isaced closed 1 year ago

isaced commented 1 year ago

IINA 是 macOS 上的一款开源视频播放器,其 URL Schema:iina://weblink?url=在线视频地址

当然,如果可以支持自定义打开 URL 可以支持其他更多本地播放器就更好了

LuckyPuppy514 commented 1 year ago

v3.0.0 版本的时候本来就打算添加自定义播放器的,但是考虑到有些播放器很多参数可能不支持,所以暂时只添加了 potplayer (potplayer支持其实也不完善,比如不支持单独音频,B站就只能最高4K画质)

下个版本加上好了,但是也必须自定义的播放器支持:videoUrl,referer, origin 这三个参数
否则有些网站无法播放,其他参数不支持也会影响体验 😂

isaced commented 1 year ago

嗯能支持的话太赞了 🌹,目前我是将 ddys 的视频 URL 复制出来用 IINA 打开,是可用的

LuckyPuppy514 commented 1 year ago

看链接应该是可以了,但是我这边没有 mac 设备测试,你有空升级到最新版试试,可以的话麻烦通知一声 😂

升级到最新版

image

isaced commented 1 year ago

可以唤起 IINA,但是链接好像有问题无法播放(ddys)

VM12 content.js:1 Uncaught TypeError: chrome.runtime.onMessage.addListener(...) is not a function
    at VM12 content.js:1:13097
    at VM12 content.js:1:50776
    at VM12 content.js:1:50780
userscript.html?name=Play-With-MPV.user.js&id=1fe3766f-7b5f-42c1-a29e-b371f7fd693d:1294 

▶️🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽◀️
▶️                                                       ◀️
▶️                     Play-With-MPV                     ◀️
▶️                                                       ◀️
▶️    https://github.com/LuckyPuppy514/Play-With-MPV     ◀️
▶️                                                       ◀️
▶️                  © 2023 LuckyPuppy514                 ◀️
▶️                                                       ◀️
▶️🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼◀️

analytics.js:1          Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
beacon.min.js:1          Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
jquery-migrate.min.js?ver=3.3.2.1672295964:2 JQMIGRATE: Migrate is installed, version 3.3.2
/wp-content/plugins/hashbar-wp-notification-bar/assets/js/analytics.js:1          Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
/subddr/v/jp_drama/Brushup_Life/Brushup_Life_S01E01.ddr:1          Failed to load resource: the server responded with a status of 404 ()
userscript.html?name=Play-With-MPV.user.js&id=1fe3766f-7b5f-42c1-a29e-b371f7fd693d:1278 链接无效:undefined
userscript.html?name=Play-With-MPV.user.js&id=1fe3766f-7b5f-42c1-a29e-b371f7fd693d:1278 链接无效:undefined
userscript.html?name=Play-With-MPV.user.js&id=1fe3766f-7b5f-42c1-a29e-b371f7fd693d:1278 链接无效:undefined
DevTools failed to load source map: Could not load content for https://ddys.art/sm/31d5cd1b58ce5e6231e4ea03a69b2801a53e76e98152bc29dc82a494ed0a1ee6.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
userscript.html?name=Play-With-MPV.user.js&id=1fe3766f-7b5f-42c1-a29e-b371f7fd693d:1278 链接无效:undefined
VM94 content.js:1 Uncaught TypeError: chrome.runtime.onMessage.addListener(...) is not a function
    at VM94 content.js:1:13097
    at VM94 content.js:1:50776
    at VM94 content.js:1:50780
(anonymous) @ VM94 content.js:1
(anonymous) @ VM94 content.js:1
(anonymous) @ VM94 content.js:1
ddys.art/:1 Launched external handler for 'iina://weblink?url=https://p3-sign.douyinpic.com/obj/xigua-video-audit/f2f27dab2e4f478dbd84f205e1931b5b?x-expires=1988632800&x-signature=Fa3mc46siB6xNXQbLPjDHFt%2F8NQ%3D&filename=1.mp4'.
ddys.art/:1 Launched external handler for 'iina://weblink?url=https://p3-sign.douyinpic.com/obj/xigua-video-audit/f2f27dab2e4f478dbd84f205e1931b5b?x-expires=1988632800&x-signature=Fa3mc46siB6xNXQbLPjDHFt%2F8NQ%3D&filename=1.mp4'.
ddys.art/:1 Launched external handler for 'iina://weblink?url=https://p3-sign.douyinpic.com/obj/xigua-video-audit/f2f27dab2e4f478dbd84f205e1931b5b?x-expires=1988632800&x-signature=Fa3mc46siB6xNXQbLPjDHFt%2F8NQ%3D&filename=1.mp4'.
content.js:1 Uncaught TypeError: chrome.runtime.onMessage.addListener(...) is not a function
    at content.js:1:13097
    at content.js:1:50776
    at content.js:1:50780
(anonymous) @ content.js:1
(anonymous) @ content.js:1
(anonymous) @ content.js:1
isaced commented 1 year ago

应该是 ddys 的链接解析问题,换 996dm 测试是正常的,可以打开 IINA 播放

LuckyPuppy514 commented 1 year ago
https://p3-sign.douyinpic.com/obj/xigua-video-audit/f2f27dab2e4f478dbd84f205e1931b5b?x-expires=1988632800&x-signature=Fa3mc46siB6xNXQbLPjDHFt%2F8NQ%3D&filename=1.mp4

这个链接是有效的,mpv 可以播放,可能是参数有特殊字符跟命令中的字符冲突了 比如 mpv 就得用双引号引起来,否则会报错,你可以试试

iina://weblink?url="${videoUrl}"
isaced commented 1 year ago

试了下那应该是 encode 问题,url 参数内容都进行 URL Encode 即可

可以跳转并播放的链接:

iina://weblink?url=https%3A%2F%2Fp3-sign.douyinpic.com%2Fobj%2Fxigua-video-audit%2Ff2f27dab2e4f478dbd84f205e1931b5b%3Fx-expires%3D1988632800%26x-signature%3DFa3mc46siB6xNXQbLPjDHFt%252F8NQ%253D%26filename%3D1.mp4
LuckyPuppy514 commented 1 year ago

我考虑过得加个 URL 编码,本来打算过一两个版本弄,没想到 iina 就得弄了 😂

LuckyPuppy514 commented 1 year ago

升级到最新版,修改下参数试试,加个 E 就会进行 URL 编码了

iina://weblink?url=${EvideoUrl}

image

isaced commented 1 year ago

可以了,辛苦 👍