xjbeta / iina-plus

Extra danmaku support for iina. (iina 弹幕支持
GNU General Public License v3.0
1.15k stars 69 forks source link

无法打开直播间/无法显示弹幕 #153

Open JoshYEn opened 2 years ago

JoshYEn commented 2 years ago

问题1: flv.js 无法打开Bilibili直播间(默认IINA播放器可以打开):

JSPlayerViewController.swift[540], webView(_:didFinish:): Finish
Danmaku.swift[222], loadCustomFont(_:): Danmaku font SimHei Regular, 24px.
JSPlayerViewController.swift[377], evaluateJavaScript(_:): evaluateJavaScript error Error Domain=WKErrorDomain Code=4 "发生了JavaScript异常" UserInfo={WKJavaScriptExceptionLineNumber=312, WKJavaScriptExceptionMessage=ReferenceError: Can't find variable: id, WKJavaScriptExceptionColumnNumber=34, WKJavaScriptExceptionSourceURL=file:///Applications/IINA+.app/Contents/Resources/WebFiles/flvplayer.js, NSLocalizedDescription=发生了JavaScript异常}
Danmaku.swift[460], webSocketDidOpen(_:): webSocketDidOpen
Danmaku.swift[515], webSocket(_:didReceiveMessageWith:): bililive connect success

问题2: IINA播放器无法打开斗鱼直播间(但这个直播间可以用flv.js打开):

MainViewController.swift[444], startSearchingUrl(_:directly:): douyuNotFoundRoomId

问题3: B站直播间+默认IINA播放器无法显示弹幕:

VideoDecoder.swift[79], prepareDanmakuFile(yougetJSON:id:): Ignore Danmaku download.
MainViewController.swift[426], startSearchingUrl(_:directly:): decodeUrl success: https://live.bilibili.com/6502978
JoshYEn commented 2 years ago

问题2定位到了…… 比如如下网址:https://www.douyu.com/topic/DOTA2TZB?rid=235520 可能是正则出问题了?

JoshYEn commented 2 years ago

关于问题2,目前斗鱼的网址都是douyu.com/topic/xxxxx?rid=xxxx

xjbeta commented 2 years ago
  1. B站直播最近也添加了referer 验证 由于WebKit 的安全机制 无法解决
  2. 下版本修复
  3. 官方版本的IINA 没有弹幕功能 用danmaku 或者插件版 的IINA
JoshYEn commented 2 years ago

谢谢回复。之前使用的是Danmaku Plugin,刚刚重新下载了1.3.0版IINA Danmaku,但提示无法打开文件或流。

JoshYEn commented 2 years ago

Log如下:

[   0.314][v][file] Opening -
[   0.314][i][file] Reading from stdin...
[   0.314][d][file] resize stream to 131072 bytes, drop 0 bytes
[   0.314][d][file] Stream opened successfully.
[   0.314][v][demux] Trying demuxers for level=normal.
[   0.314][d][demux] Trying demuxer: disc (force-level: normal)
[   0.314][d][demux] Trying demuxer: edl (force-level: normal)
[   0.314][d][demux] Trying demuxer: cue (force-level: normal)
[   0.314][d][demux] Trying demuxer: rawaudio (force-level: normal)
[   0.314][d][demux] Trying demuxer: rawvideo (force-level: normal)
[   0.314][d][demux] Trying demuxer: mkv (force-level: normal)
[   0.314][d][demux] Trying demuxer: libarchive (force-level: normal)
[   0.314][d][demux] Trying demuxer: lavf (force-level: normal)
[   0.315][v][lavf] No format found, try lowering probescore or forcing the format.
[   0.315][d][demux] Trying demuxer: mf (force-level: normal)
[   0.315][d][demux] Trying demuxer: playlist (force-level: normal)
[   0.315][d][demux] Trying demuxer: null (force-level: normal)
[   0.315][v][demux] Trying demuxers for level=unsafe.
[   0.315][d][demux] Trying demuxer: disc (force-level: unsafe)
[   0.315][d][demux] Trying demuxer: edl (force-level: unsafe)
[   0.315][d][demux] Trying demuxer: cue (force-level: unsafe)
[   0.315][d][demux] Trying demuxer: rawaudio (force-level: unsafe)
[   0.315][d][demux] Trying demuxer: rawvideo (force-level: unsafe)
[   0.315][d][demux] Trying demuxer: mkv (force-level: unsafe)
[   0.315][d][demux] Trying demuxer: libarchive (force-level: unsafe)
[   0.315][d][file] resize stream to 262144 bytes, drop 0 bytes
[   0.315][d][demux] Trying demuxer: lavf (force-level: unsafe)
[   0.316][d][file] resize stream to 131072 bytes, drop 0 bytes
[   0.316][v][lavf] No format found, try lowering probescore or forcing the format.
[   0.316][d][demux] Trying demuxer: mf (force-level: unsafe)
[   0.316][d][demux] Trying demuxer: playlist (force-level: unsafe)
[   0.316][d][demux] Trying demuxer: null (force-level: unsafe)
[   0.316][v][cplayer] Opening failed or was aborted: -
[   0.316][v][cplayer] Running hook: ytdl_hook/on_load_fail
[   0.316][v][ytdl_hook] full hook 
[   0.316][v][cplayer] finished playback, unrecognized file format (reason 4)
[   0.316][e][cplayer] Failed to recognize file format.
xjbeta commented 2 years ago

更换IINA 版本后 重启iina+

JoshYEn commented 2 years ago

您好,感谢回复。重启过的。。。能检索到的信息我都看了,包括wiki和您在一些issue下的回复,但是仍存在问题。 目前状态:

  1. 使用IINA Danmaku,提示无法打开文件或流
  2. 使用IINA Danmaku plugin,可以打开直播间,但没有弹幕,同时无任何提示。Log中好像没有看到什么相关的信息。 Plugin 版本Log如下:
    [   2.944][v][cplayer] Loading config '/Users/xx/Library/Application Support/com.colliderli.iina/watch_later/702E5A9801D2F7A5456E3E1CF4C5C93F'
    [   2.944][v][cplayer] Reading config file /Users/xx/Library/Application Support/com.colliderli.iina/watch_later/702E5A9801D2F7A5456E3E1CF4C5C93F
    [   2.944][v][cplayer] Applying profile 'default'...
    [   2.944][v][cplayer] Setting option 'volume' = '100.000000' (flags = 36)
    [   2.945][v][cplayer] Running hook: ytdl_hook/on_load
    [   2.945][v][ytdl_hook] ytdl:// hook 
    [   2.945][v][cplayer] Set property: script-opts="iinaPlusArgs=7b0a20202272617755726c22203a202268747470733a5c2f5c2f6c6976652e62696c6962696c692e636f6d5c2f33333738363430222c0a20202275726c7322203a205b0a202020202268747470733a5c2f5c2f636e2d686263642d63752d30322d31332e62696c69766964656f2e636f6d5c2f6c6976652d6276635c2f3830343037375c2f6c6976655f32333733303636365f383534333937395f626c757261792e666c763f657870697265733d31363534303032313833266c656e3d30266f693d32303538353234322670743d77656226716e3d313030303026747269643d31303030613336363862626436333166346438643834343838666337383065336234336426736967706172616d733d63646e2c657870697265732c6c656e2c6f692c70742c716e2c747269642663646e3d636e2d676f746368613031267369676e3d653930303832663231346463643264373732623264346264623861343061323726736b3d3438313830316632323230306162623061306131393232356430393335616462267032705f747970653d31267372633d353733343526736c3d3326667265655f747970653d3026666c6f77747970653d31266d616368696e657a6f6e653d6a642670703d72746d70267369643d636e2d686263642d63752d30322d31332663686173683d3126736368653d62616e26736f757263653d6f6e6574696572266f726465723d3126736974653d3363303135353965636430313161383930343562626434666532363930363838220a20205d2c0a202022706f727422203a2031393038302c0a2020226c696e657322203a205b0a20202020224c696e652031220a20205d2c0a2020226d707653637269707422203a2022666f7263652d6d656469612d7469746c653d5c22e68891e79a84e8af84e4bbb7e698afefbc8ce5a49ce585b0e5be88e5bcbaefbc8ce68abde4ba86e4b88de4ba8f5c222c7974646c3d5c226e6f5c222c72656665727265723d5c2268747470733a5c2f5c2f6c6976652e62696c6962696c692e636f6d5c2f5c22222c0a20202263757272656e745175616c69747922203a20302c0a20202263757272656e744c696e6522203a20302c0a2020227479706522203a20302c0a2020227175616c6974797322203a205b0a2020202022e58e9fe794bb222c0a2020202022e8939de58589222c0a2020202022e8b685e6b885222c0a2020202022e9ab98e6b885220a20205d0a7d" -> 1
    [   2.945][v][ytdl_hook] not a ytdl:// url 
    [   2.945][v][bdmv/bluray] Opening -
    [   2.945][v][file] Opening -
    [   2.945][i][file] Reading from stdin...
    [   2.945][d][file] resize stream to 131072 bytes, drop 0 bytes
    [   2.945][d][file] Stream opened successfully.
    [   2.945][v][demux] Trying demuxers for level=normal.
    [   2.945][d][demux] Trying demuxer: disc (force-level: normal)
    [   2.946][d][demux] Trying demuxer: edl (force-level: normal)
    [   2.946][d][demux] Trying demuxer: cue (force-level: normal)
    [   2.946][d][demux] Trying demuxer: rawaudio (force-level: normal)
    [   2.946][d][demux] Trying demuxer: rawvideo (force-level: normal)
    [   2.946][d][demux] Trying demuxer: mkv (force-level: normal)
    [   2.946][d][demux] Trying demuxer: libarchive (force-level: normal)
    [   2.949][d][demux] Trying demuxer: lavf (force-level: normal)
    [   2.949][d][cplayer] Run command: loadfile, flags=64, args=[url="https://cn-hbcd-cu-02-13.bilivideo.com/live-bvc/804077/live_23730666_8543979_bluray.flv?expires=1654002183&len=0&oi=20585242&pt=web&qn=10000&trid=1000a3668bbd631f4d8d84488fc780e3b43d&sigparams=cdn,expires,len,oi,pt,qn,trid&cdn=cn-gotcha01&sign=e90082f214dcd2d772b2d4bdb8a40a27&sk=481801f22200abb0a0a19225d0935adb&p2p_type=1&src=57345&sl=3&free_type=0&flowtype=1&machinezone=jd&pp=rtmp&sid=cn-hbcd-cu-02-13&chash=1&sche=ban&source=onetier&order=1&site=3c01559ecd011a89045bbd4fe2690688", flags="replace", options="force-media-title=我的评价是,夜兰很强,抽了不亏,ytdl=no,referrer=https://live.bilibili.com/"]
    [   2.949][d][global] config path: '/Users/xx/Library/Application Support/com.colliderli.iina/watch_later' -> '-'
    [   2.949][i][cplayer] Saving state.
    [   2.949][i][cplayer] Not seekable, or time unknown - not saving position.
    [   2.953][v][lavf] No format found, try lowering probescore or forcing the format.
    [   2.954][v][demux] Trying demuxers for level=unsafe.
    [   2.954][v][cplayer] Opening failed or was aborted: -
    [   2.954][v][cplayer] finished playback, success (reason 2)
    [   2.954][i][cplayer] 
    [   2.954][v][cplayer] Setting option 'force-media-title' = '我的评价是,夜兰很强,抽了不亏' (flags = 16)
    [   2.954][v][cplayer] Setting option 'ytdl' = 'no' (flags = 16)
    [   2.954][d][auto_profiles] Loading lua script @auto_profiles.lua...
    [   2.954][v][cplayer] Setting option 'referrer' = 'https://live.bilibili.com/' (flags = 16)
    [   2.954][v][cplayer] Running hook: ytdl_hook/on_load
    [   2.954][d][ytdl_hook] Exiting...
    [   2.955][d][auto_profiles] loading mp.defaults
    [   2.955][w][cplayer] client removed during hook handling
    [   2.955][v][ffmpeg] Opening https://cn-hbcd-cu-02-13.bilivideo.com/live-bvc/804077/live_23730666_8543979_bluray.flv?expires=1654002183&len=0&oi=20585242&pt=web&qn=10000&trid=1000a3668bbd631f4d8d84488fc780e3b43d&sigparams=cdn,expires,len,oi,pt,qn,trid&cdn=cn-gotcha01&sign=e90082f214dcd2d772b2d4bdb8a40a27&sk=481801f22200abb0a0a19225d0935adb&p2p_type=1&src=57345&sl=3&free_type=0&flowtype=1&machinezone=jd&pp=rtmp&sid=cn-hbcd-cu-02-13&chash=1&sche=ban&source=onetier&order=1&site=3c01559ecd011a89045bbd4fe2690688
    [   2.955][d][auto_profiles] loading @auto_profiles.lua
    [   2.957][d][auto_profiles] Exiting...
    [   2.977][d][ffmpeg] tcp: Starting connection attempt to 101.75.242.14 port 443
    [   2.984][v][cplayer] Set property: script-opts="" -> 1
    [   3.013][d][ffmpeg] tcp: Successfully connected to 101.75.242.14 port 443
    [   3.965][d][ffmpeg] resize stream to 131072 bytes, drop 0 bytes
    [   3.965][v][ffmpeg] Mime-type: 'video/x-flv'
    [   3.965][d][ffmpeg] Stream opened successfully.
xjbeta commented 2 years ago

首先command + Q 关闭所有 iina+ 和IINA 重现一遍无法打开的操作

iina+ 的顶部菜单 帮助 - log 文件 - 复制出来新建个txt IINA 的Log 文件夹里 iina.log mpv.log 总共3个文件 一起发来看看

建议使用插件版

JoshYEn commented 2 years ago

好的,我再试试。目前尝试了如下回复里的版本,问题解决,可以进入直播间并显示弹幕。 Originally posted by @yueqingyou in https://github.com/xjbeta/iina-plus/issues/129#issuecomment-1136721415

JoshYEn commented 2 years ago

使用v1.3.0-plguin(5)IINA+ 0.6.12

可进入直播间,但无弹幕显示,log如下:


IINA+ log:

AppDelegate.swift[36], applicationDidFinishLaunching(_:): App did finish launch
AppDelegate.swift[39], applicationDidFinishLaunching(_:): App Version 0.6.12 (Build 22053006)
AppDelegate.swift[40], applicationDidFinishLaunching(_:): macOS 版本12.4(版号21F79)
AppDelegate.swift[43], applicationDidFinishLaunching(_:): CoreData Path: /Users/ay/Library/Application Support/IINA+/DataModel.sqlite
AppDelegate.swift[67], initImageCache(): Image Cache Path: /Users/ay/Library/Caches/com.hackemist.SDImageCache/default
HttpServer.swift[274], prepareWebSiteFiles(): /Applications/IINA+.app/Contents/Resources/WebFiles
HttpServer.swift[275], prepareWebSiteFiles(): /Users/ay/Library/Application Support/com.xjbeta.iina-plus/WebFiles
HttpServer.swift[216], start(): Server has started ( port = 19080 ). Try to connect now...
SidebarViewController.swift[94], startNRMListening(): NetworkReachability reachable ethernetOrWiFi.
MainViewController.swift[419], startSearchingUrl(_:directly:): decodeUrl success: https://live.bilibili.com/3378640
VideoDecoder.swift[79], prepareDanmakuFile(yougetJSON:id:): Ignore Danmaku download.
Processes.swift[246], openWithURLScheme(_:): openWithURLScheme iina://open?url=-&mpv_script-opts=iinaPlusArgs%3D7b0a20202272617755726c22203a202268747470733a5c2f5c2f6c6976652e62696c6962696c692e636f6d5c2f33333738363430222c0a20202275726c7322203a205b0a202020202268747470733a5c2f5c2f636e2d686263642d63752d30322d31332e62696c69766964656f2e636f6d5c2f6c6976652d6276635c2f3238333336345c2f6c6976655f32333733303636365f383534333937395f626c757261792e666c763f657870697265733d31363534303033343436266c656e3d30266f693d32303538353234322670743d77656226716e3d313030303026747269643d31303030396233623334653266373066346161343838373431623863366661616437386326736967706172616d733d63646e2c657870697265732c6c656e2c6f692c70742c716e2c747269642663646e3d636e2d676f746368613031267369676e3d616639333633656637663766363331393565313938353464386163646334383026736b3d3438313830316632323230306162623061306131393232356430393335616462267032705f747970653d31267372633d353733343526736c3d3326667265655f747970653d3026666c6f77747970653d31266d616368696e657a6f6e653d6a642670703d72746d70267369643d636e2d686263642d63752d30322d31332663686173683d3126736368653d62616e26736f757263653d6f6e6574696572266f726465723d3126736974653d6466363331303238663538663039626466313838633764333333346463633237220a20205d2c0a202022706f727422203a2031393038302c0a2020226c696e657322203a205b0a20202020224c696e652031220a20205d2c0a2020226d707653637269707422203a2022666f7263652d6d656469612d7469746c653d5c22e68891e79a84e8af84e4bbb7e698afefbc8ce5a49ce585b0e5be88e5bcbaefbc8ce68abde4ba86e4b88de4ba8f5c222c7974646c3d5c226e6f5c222c72656665727265723d5c2268747470733a5c2f5c2f6c6976652e62696c6962696c692e636f6d5c2f5c22222c0a20202263757272656e745175616c69747922203a20302c0a20202263757272656e744c696e6522203a20302c0a2020227479706522203a20302c0a2020227175616c6974797322203a205b0a2020202022e58e9fe794bb222c0a2020202022e8939de58589222c0a2020202022e8b685e6b885222c0a2020202022e9ab98e6b885220a20205d0a7d.

iina.log mpv.log

xjbeta commented 2 years ago

主站视频的弹幕正常吗

随便打开一个本地的视频 然后在插件里加载这个弹幕文件 看能否正常显示弹幕 (删掉结尾的.txt) danmaku-252E00D7-3D17-4E89-A942-297F7FFC5F62.xml.txt

iina+ 设置里的“在浏览器中测试” 打开一下 看网页能不能打开(正常的话 整个网页都是空白的)

JoshYEn commented 2 years ago
  1. 主站视频的弹幕也没有
  2. 插件加载后没有显示弹幕
  3. 可以正常打开

p.s. IINA+设置中,端口是灰色的无法更改,不知是否正常

xjbeta commented 2 years ago

改过插件的设置吗 尤其是字体 (IINA 本体插件的设置里) 默认的是PingFang SC 按照上面的操作 重现一遍打开本地视频 加载xml 的操作 把iina.log 发来看看 (插件似乎有个bug 直接打开本地视频 不显示插件的按钮 先iina+ 开个B站视频 关掉之后再开个本地视频 然后加载xml 文件)

似乎是bug 忘记修了

JoshYEn commented 2 years ago

改过IINA+中的字体设置,我记得之前是SimHei,我改成了PingFang SC,插件没做更改,每次都是从DMG映像中直接拖拽替换。

确实存在这个bug,刚才的回复中,我是打开的主站视频,没有弹幕,然后直接加载xml,弹幕也没有显示。

打开主站视频加载本地弹幕 - log: iina.log

打开本地视频加载本地弹幕 - log: iina.log

xjbeta commented 2 years ago

log 看着没什么问题 是M1 吗

JoshYEn commented 2 years ago

是M1。20款

JoshYEn commented 2 years ago

破案了,我的插件是通过install from github选项安装的。第一次点击安装会失败,提示alert.plugin.install_error 这时再点一次Install可以安装成功。但是不知为何不能正常工作,无法显示弹幕。

截屏2022-05-31 22 41 17

下载文件本地安装就可以正常显示弹幕了。