[ English follows Chinese ]
此工具帮助Mac网易云音乐的海外用户解除歌曲锁区限制(所谓锁区:很多歌曲仅限大陆地区播放)。
多数下架的歌曲也可以被恢复。【此处应有免责声明】
对用户比较友好。
为什么不使用Unblock-Youku等通用的反向代理解决方案?因为:
- Mac版网易云音乐没有内置代理接口,全局代理会使得网络通信变慢;即便使用PAC等,歌曲下载等较大流量也会变慢,并且不稳定
- 安全原因,请不要轻易相信商业代理服务器...
- 此工具最傻瓜,绿色😅
不同OS下的类似工具的评论区经常出现“买个会员不就好了”等言论,注意:
- 即便会员,该锁区也一样锁区,会员只是可以听网易版权歌曲
- 想了想还是算了,不说了
感谢一个Windows下类似工具提供的思路以及作者的博文。
此工具的使用、传播、修改均无需征得作者同意,同时作者对此不负一切责任。
需要条件:
下载该repo文件夹,不要修改任何文件名
安装python包Twisted和PyQuery(均可用pip安装)。
最新版本的Twisted需要更新pyOpenSSL才能使用。也可以选择装个旧版本。
在每次打开网易云音乐之前:
进入文件夹,双击NeteaseMusicHelper即可。等待提示信息成功之后可以关掉它,然后一片清净,开心听歌,不用善后。
默认使用wifi,如果使用有线网或其他方式,请将run_me.sh第12行的wi-fi改成相应的名称。可以用networksetup -listallnetworkservices指令查看
macOS 10.12,NeteaseMusic Version 1.5.6,python 2.7.10,年费会员。未测试任何其他情况,欢迎测试报bug谢谢。
见下方Inplementation details。这里只说两点:
- 歌单中所有歌曲都不再显示灰色,但点击部分下架歌曲(大陆也不能播放)后仍然可能提示“播放失败”。
- 目前对音频文件URL请求(也只有这一请求)采用的是cn-proxy提供的代理列表,缺省代理为作者的阿里云地址。
This tool helps abroad users of NeteaseMusic for macOS unblock songs that are allowed to play in mainland China only.
Why general solutions like Unblock-Youku are not recommended? Because:
- NeteaseMusic for macOS does not provide a proxy interface, so global proxy will slow down the network traffic; Even if PAC is used, when it comes to audio stream downloading, the latency and unstableness become annoying.
- For safety reasons, better not to trust commercial proxy servers.
- This tool is most lightweight and easy to use.
Thanks to a similar tool NeteaseReverseLadder on Windows and the author's blog.
Copyright: The author waives all rights, please feel free to use, share and modify this tool.
Prerequisites:
- Download this folder and do not change file names.
- Install Python package Twisted and PyQuery. You may also need to update pyOpenSSL or use a older version of Twisted.
Everytime before you launch NeteaseMusic:
Just enter the folder and double-click "NeteaseMusicHelper". See the success info and then be free to close it, enjoy your music.
macOS 10.12,NeteaseMusic Version 1.5.6,python 2.7.10, yearly-paid membership.
Other cases are not tested and your report is welcomed.
Part 1. Force NeteaseMusic to communicate with Netease servers through local proxy.
Methods that I tried:
- Use
pfctl
(package forwarding), likeiptables
on Linux. Not working normally & too less helpful documentations, given up. - Use proxychains, a preloader which hooks calls to sockets in dynamically linked programs and redirects it through proxies. It is basically a hack and hacks do not always work. Acting weired on NeteaseMusic for macOS, issue reported at #181. Remaining unsolved.
- Use
networksetup
, macOS network PAC. It works easily.
Part 2. Intercept, modify and redirect requests.
See NeteaseMusicProxy.py
(deployed as local proxy) and AudioRequestProxy.py
(deployed as domestic proxy).
Mainland proxy server is dynamically selected from http://cn-proxy.com/. Because those proxies can be unstable (may be refused by NeteaseMusic server), so an auto proxy selector will replace current proxy with new one or default one after a certain amount of request failures.