xfangfang / Macast

Macast is a cross-platform application which using mpv as DLNA Media Renderer.
https://xfangfang.github.io/Macast/
GNU General Public License v3.0
6.08k stars 381 forks source link

[BUG] 特定文件名或路径下无法加载内容 #149

Closed AnYiEE closed 2 years ago

AnYiEE commented 2 years ago

Versions

Bug recurrence

使用安卓设备以DLNA协议投屏,当文件名或任意一级文件夹名以.开头时,无法播放图片、视频和音乐,提示文件加载失败,将.去掉可正常播放。

xfangfang commented 2 years ago

可不可以按照issue模板提交问题?开发者看不到log怎么知道发什么了什么呢?

我刚刚使用魅族手机自带的投屏功能向Windows上的Macast投屏并没有出现任何问题。

因为我没办法找到所有的安卓手机来测试,一个更简单的办法是提供错误发生时的log。

AnYiEE commented 2 years ago

@xfangfang

INFO:cherrypy.access.2102951101640:192.168.10.100 - - [10/Sep/2022:15:42:53] "GET /description.xml HTTP/1.1" 200 2197 "" "Android/12 UPnP/1.0 Cling/2.0"
INFO:cherrypy.access.2102951101640:192.168.10.100 - - [10/Sep/2022:15:42:53] "GET /dlna/AVTransport.xml HTTP/1.1" 200 21114 "" "Android/12 UPnP/1.0 Cling/2.0"
INFO:cherrypy.access.2102951101640:192.168.10.100 - - [10/Sep/2022:15:42:53] "GET /dlna/RenderingControl.xml HTTP/1.1" 200 8536 "" "Android/12 UPnP/1.0 Cling/2.0"
INFO:cherrypy.access.2102951101640:192.168.10.100 - - [10/Sep/2022:15:42:53] "GET /dlna/ConnectionManager.xml HTTP/1.1" 200 5432 "" "Android/12 UPnP/1.0 Cling/2.0"
INFO:Protocol:ConnectionManager_GetProtocolInfo {}
INFO:Protocol:********************res: ConnectionManager_GetProtocolInfo
INFO:cherrypy.access.2102951101640:192.168.10.100 - - [10/Sep/2022:15:42:53] "POST /ConnectionManager/action HTTP/1.1" 200 16820 "" "Android/12 UPnP/1.0 Cling/2.0"
ERROR:Protocol:ADD SUBSCRIBE:!!!!!!!AVTransport
ERROR:Protocol:SUBSCRIBE: http://192.168.10.100:8081/upnp/dev/b54d4cc1-5eb5-48c8-bdfe-35757b4b7360/svc/upnp-org/AVTransport/event/cb
ERROR:Protocol:SUBSCRIBE ADD
----------------------------- 192.168.10.100:8081
INFO:cherrypy.access.2102951101640:192.168.10.100 - - [10/Sep/2022:15:42:58] "SUBSCRIBE /AVTransport/event HTTP/1.1" 200 - "" "Android/12 UPnP/1.0 Cling/2.0"
ERROR:Protocol:ADD SUBSCRIBE:!!!!!!!RenderingControl
ERROR:Protocol:SUBSCRIBE: http://192.168.10.100:8081/upnp/dev/b54d4cc1-5eb5-48c8-bdfe-35757b4b7360/svc/upnp-org/RenderingControl/event/cb
ERROR:Protocol:SUBSCRIBE ADD
----------------------------- 192.168.10.100:8081
INFO:cherrypy.access.2102951101640:192.168.10.100 - - [10/Sep/2022:15:42:58] "SUBSCRIBE /RenderingControl/event HTTP/1.1" 200 - "" "Android/12 UPnP/1.0 Cling/2.0"
INFO:Protocol:********************res: {'CurrentTransportState': 'STOPPED', 'CurrentTransportStatus': 'OK', 'CurrentSpeed': 1}
INFO:Protocol:AVTransport_Seek {'InstanceID': '0', 'Unit': 'ABS_TIME', 'Target': '00:00:15'}
INFO:cherrypy.access.2102951101640:192.168.10.100 - - [10/Sep/2022:15:42:58] "POST /AVTransport/action HTTP/1.1" 200 399 "" "Android/12 UPnP/1.0 Cling/2.0"
INFO:Protocol:********************res: {}
INFO:cherrypy.access.2102951101640:192.168.10.100 - - [10/Sep/2022:15:42:58] "POST /AVTransport/action HTTP/1.1" 200 224 "" "Android/12 UPnP/1.0 Cling/2.0"
INFO:Protocol:AVTransport_SetAVTransportURI {'InstanceID': '0', 'CurrentURI': 'http://192.168.10.100:39047/03b6893d-eaf8-4681-9d32-6cf853c9d3a6.mp4', 'CurrentURIMetaData': None}
INFO:Protocol:http://192.168.10.100:39047/03b6893d-eaf8-4681-9d32-6cf853c9d3a6.mp4
ERROR:Protocol:'NoneType' object has no attribute 'encode'
ERROR:Protocol:None
INFO:MPVRenderer:{'event': 'start-file', 'playlist_entry_id': 1}
INFO:Protocol:********************res: {}
INFO:main:renderer_av_uri: http://192.168.10.100:39047/03b6893d-eaf8-4681-9d32-6cf853c9d3a6.mp4
index:  0
INFO:cherrypy.access.2102951101640:192.168.10.100 - - [10/Sep/2022:15:42:58] "POST /AVTransport/action HTTP/1.1" 200 237 "" "Android/12 UPnP/1.0 Cling/2.0"
INFO:Protocol:AVTransport_Play {'InstanceID': '0', 'Speed': '1'}
INFO:Protocol:********************res: {}
INFO:cherrypy.access.2102951101640:192.168.10.100 - - [10/Sep/2022:15:42:58] "POST /AVTransport/action HTTP/1.1" 200 224 "" "Android/12 UPnP/1.0 Cling/2.0"
INFO:MPVRenderer:{'event': 'tracks-changed'}
INFO:MPVRenderer:{'event': 'end-file', 'reason': 'error', 'playlist_entry_id': 1, 'file_error': 'loading failed'}
INFO:main:renderer_av_stop
INFO:MPVRenderer:{'event': 'idle'}
ERROR:Protocol:REMOVE SUBSCRIBE:!!!!!!!AVTransport
ERROR:Protocol:REMOVE SUBSCRIBE:!!!!!!!RenderingControl
INFO:cherrypy.access.2102951101640:192.168.10.100 - - [10/Sep/2022:15:43:04] "UNSUBSCRIBE /AVTransport/event HTTP/1.1" 200 - "" "Android/12 UPnP/1.0 Cling/2.0"
INFO:cherrypy.access.2102951101640:192.168.10.100 - - [10/Sep/2022:15:43:04] "UNSUBSCRIBE /RenderingControl/event HTTP/1.1" 200 - "" "Android/12 UPnP/1.0 Cling/2.0"
INFO:Protocol:AVTransport_Stop {'InstanceID': '0'}
INFO:Protocol:********************res: {}
INFO:cherrypy.access.2102951101640:192.168.10.100 - - [10/Sep/2022:15:43:04] "POST /AVTransport/action HTTP/1.1" 200 224 "" "Android/12 UPnP/1.0 Cling/2.0"
INFO:Protocol:Remove client: uuid:76b0e422-eb97-4e58-84ef-935348eb1e2d
INFO:Protocol:Remove client: uuid:4f9390d1-4bde-47c1-976e-39d79db23e8a

MIUI13,使用自带的文件管理,当文件名或文件所处文件夹名以.开头时无法播放,去掉.正常。

AnYiEE commented 2 years ago

通知内容是“File error, loading failed”

xfangfang commented 2 years ago

我刚刚尝试用小米手机向小米电视投相册内的点开头视频,同样出现问题。

我想这个应该是miui自己的问题,可以去向miui反馈一下

xfangfang commented 2 years ago

通过log能看到Macast拿到的链接是:http://192.168.10.100:39047/03b6893d-eaf8-4681-9d32-6cf853c9d3a6.mp4

这个地址明显是miui在投本地视频时投过来的,手机应该会在本地做一个哈希表来映射到本地的视频,我猜应该是miui在做这步映射的时候因为什么原因映射错了。