yi-ji / NeteaseMusicAbroad

Unblock regional restrictions for NeteaseCloudMusic on macOS/Linux. 网易云音乐macOS/Linux解除歌曲锁区限制。
The Unlicense
398 stars 40 forks source link

macOS 10.14.4 & NeteaseMusic Version 1.5.10 & Python 3.6.8 ‘Killed: 9’ error #37

Closed yifanshi127 closed 5 years ago

yifanshi127 commented 5 years ago

作者您好!我在WiFi下用NeteaseMusicHelper打开网易云音乐发现歌曲名仍然为灰色。刷新和重启了很多次都没变化。检查过Automatic Proxy Configuration,确认已经勾上并且路径正确。:(

我的系统是MacOS Mojave 10.14.4 python版本是3.6.8 网易云音乐是1.5.10 (640)

执行NeteaseMusicProxy.py后的log如下: 2019-05-15 14:43:34+1000 [-] Log opened. 2019-05-15 14:43:38+1000 [-] NeteaseMusicProxyFactory starting on 32794 2019-05-15 14:43:38+1000 [-] Starting factory <main.NeteaseMusicProxyFactory object at 0x1066f3c18> Killed: 9

这个“Killed: 9”错误是不是表示运行package失败了呢?希望作者回复,谢谢!

yi-ji commented 5 years ago

之前有个bug改掉了,麻烦下载最新的NeteaseMusicAbroad试一下:)

yifanshi127 commented 5 years ago

之前有个bug改掉了,麻烦下载最新的NeteaseMusicAbroad试一下:)

谢谢回复!我试了3月16日的commit,还是有这个问题。 我搜了一下"Killed: 9"的原因,似乎是系统强制杀掉了NeteaseMusicHelper。是不是因为我系统内存不够了?(7.39GB/67.02GB可用)

yi-ji commented 5 years ago

不是内存问题,代码里有个逻辑是如果有多个helper进程就kill掉其他的(不会kill自己)。但是在我这里同样的环境没法复现你的问题。 试下直接把 NeteaseMusicProxy.py 的倒数第3行注释掉吧: # kill_existed()

yifanshi127 commented 5 years ago

不是内存问题,代码里有个逻辑是如果有多个helper进程就kill掉其他的(不会kill自己)。但是在我这里同样的环境没法复现你的问题。 试下直接把 NeteaseMusicProxy.py 的倒数第3行注释掉吧: # kill_existed()

我把kill_existed()注释后,用helper打开网易云后过了大约30秒还是被kill了。如果不注释kill_existed()的话,一启动网易云就会被kill。感觉好奇怪,明明代码里没有定义其他kill的情况。 def kill_existed(): pgrep = Popen(['pgrep', '-f', 'NeteaseMusicProxy'], stdout=PIPE, stdin=PIPE, stderr=STDOUT) existed = pgrep.communicate()[0].rstrip().split(b'\n') for pid in existed: if pid and int(pid) != os.getpid(): kill = Popen(['kill', '-9', pid], stderr=STDOUT) kill.communicate() time.sleep(3) 我对多进程方面不太懂,不过猜想是不是pid在我打开网易云之前就被占用了?为什么我在进程管理器里找不到端口32794?

yi-ji commented 5 years ago

lsof -n -i4TCP:32794 | grep LISTEN 看下什么输出? 把所有代码里面的32794换个别的端口号试试?

我把kill_existed()注释后,用helper打开网易云后过了大约30秒还是被kill了

如果不用helper直接python执行的话?

yifanshi127 commented 5 years ago

lsof -n -i4TCP:32794 | grep LISTEN 看下什么输出? 把所有代码里面的32794换个别的端口号试试?

我把kill_existed()注释后,用helper打开网易云后过了大约30秒还是被kill了

如果不用helper直接python执行的话?

把端口改后发现成功了!谢谢作者的耐心回复啦!😄