iyear / pure-live-core

✨ Make Live Pure Again
https://github.com/iyear/pure-live-core
GNU Affero General Public License v3.0
1.18k stars 142 forks source link

[BUG] 观看斗鱼直播时网络下载无法自动停止 且切换直播时小概率崩溃 #9

Closed VantIer closed 2 years ago

VantIer commented 2 years ago

请附上pure-live版本、环境、错误日志、直播间等一切相关信息,以便我们更好的解决问题。 发现一个疑似bug

版本: v0.1.0.211224-beta First Version 环境:树莓派 Zero 2W,64位官方系统(armv7) 直播间:斗鱼 歌神洞庭湖-洞主凯哥直播间

因为是zero 2w,性能略显拉跨的原因,我一直在边看直播边监视系统占用,无意间发现pure-live在看斗鱼直播时候,会以1mb每秒的速度进行下载(一个设备,只看一个直播间时),并且即使在切换直播/关闭浏览器的情况下仍然如此,此情况只出现在看斗鱼直播的时候(虎牙不怎么看,没试),bilibili直播无此问题(先打开bili直播,不下载;打开斗鱼,下载上传开始;切换到bili直播,上传停下载不停;关闭网页,同上),猜测虎牙的视频流处理有点缺陷?(下载转发上传倒是正常的,主要是关了/切换直播间上传停了但仍然下载的问题)

而且直播间切换时候小概率崩溃(斗鱼bili互切,bili自己切没事),程序会退出,但是是闪退还是报错我看不到(因为我的openwrt路由也比较拉跨,崩溃的时候会直接把网连带炸一下,ssh断开了就啥也看不到了),不好意思。这个也许是我的zero性能拉跨的问题吧,也许复现不了,就忽略就行。

iyear commented 2 years ago

斗鱼直播间有大流量是因为bilibili和虎牙无需本地直播流转发,斗鱼有跨域限制要走本地转发所以要下载直播流转发。

直播流转发没写关闭策略(之前要写后来忘了),会在正式版修复

互切崩溃我这里目前还没复现

iyear commented 2 years ago

log的话本地有文件输出的可以查看一下,同目录下log目录

iyear commented 2 years ago

e0242565e8430f44532360c75e958cd75258235c

修复直播流转发关闭

VantIer commented 2 years ago

哇,大佬修复神速,佩服佩服!闪退那个我看了下日志,都是正常信息,应该不是bug,是我树莓派和路由拉跨的原因,这个就忽略吧,不算问题了 我的日志内容类似这样

2021-12-29T00:14:44.955+0800 INFO srv_live/serve.go:64 heartbeat stopped {"id": "f2fc642a-dc6d-4872-8c5a-8be1e2664a5b"} 2021-12-29T00:14:45.390+0800 INFO srv_live/serve.go:80 receive stopped {"id": "f2fc642a-dc6d-4872-8c5a-8be1e2664a5b"} 2021-12-29T00:16:15.537+0800 INFO server/server.go:41 read config succ... 2021-12-29T00:16:15.988+0800 INFO server/server.go:52 init database succ... 2021-12-29T00:16:15.989+0800 INFO server/server.go:58 server runs on :8800,debug: false 2021-12-29T00:17:10.347+0800 INFO v1/serve.go:61 start serving... {"id": "3ea22a9c-865f-42d2-817c-31bbdaeb67ba", "room": "6154037", "plat": "bilibili"} 2021-12-29T00:17:10.470+0800 INFO srv_live/serve.go:21 connected to live danmaku server {"id": "3ea22a9c-865f-42d2-817c-31bbdaeb67ba"} 2021-12-29T00:17:10.471+0800 INFO srv_live/serve.go:36 entered the room {"id": "3ea22a9c-865f-42d2-817c-31bbdaeb67ba"} 2021-12-29T00:17:57.515+0800 INFO v1/serve.go:61 start serving... {"id": "15f82640-e2cd-4094-bf9b-3463dbbf8b56", "room": "138243", "plat": "douyu"} 2021-12-29T00:17:57.607+0800 INFO srv_live/serve.go:21 connected to live danmaku server {"id": "15f82640-e2cd-4094-bf9b-3463dbbf8b56"} 2021-12-29T00:17:57.608+0800 INFO srv_live/serve.go:36 entered the room {"id": "15f82640-e2cd-4094-bf9b-3463dbbf8b56"} 2021-12-29T00:18:11.358+0800 INFO v1/serve.go:61 start serving... {"id": "d2199a06-bba3-4133-adbc-4fc5b98fd0bd", "room": "6154037", "plat": "bilibili"} 2021-12-29T00:18:11.616+0800 INFO srv_live/serve.go:21 connected to live danmaku server {"id": "d2199a06-bba3-4133-adbc-4fc5b98fd0bd"} 2021-12-29T00:18:11.617+0800 INFO srv_live/serve.go:36 entered the room {"id": "d2199a06-bba3-4133-adbc-4fc5b98fd0bd"} 2021-12-29T00:20:05.321+0800 INFO server/server.go:41 read config succ... 2021-12-29T00:20:05.764+0800 INFO server/server.go:52 init database succ... 2021-12-29T00:20:05.764+0800 INFO server/server.go:58 server runs on :8800,debug: false 2021-12-29T00:20:42.452+0800 INFO v1/serve.go:61 start serving... {"id": "8dda96c1-7cd3-457c-91fe-d86f9e9c4e34", "room": "1603600", "plat": "bilibili"} 2021-12-29T00:20:42.564+0800 INFO srv_live/serve.go:21 connected to live danmaku server {"id": "8dda96c1-7cd3-457c-91fe-d86f9e9c4e34"} 2021-12-29T00:20:42.565+0800 INFO srv_live/serve.go:36 entered the room {"id": "8dda96c1-7cd3-457c-91fe-d86f9e9c4e34"}

中间可以看到 2021-12-29T00:18:11.617+0800 INFO srv_live/serve.go:36 entered the room {"id": "d2199a06-bba3-4133-adbc-4fc5b98fd0bd"} 2021-12-29T00:20:05.321+0800 INFO server/server.go:41 read config succ... 这样的,我觉得应该是占用太大被树莓派给杀了。不算问题了

另外感谢大佬做出这么好的东西!非常感谢!

iyear commented 2 years ago

应该是树莓派配置太低了的原因😂