UnblockNeteaseMusic 使用方法

简介

UnblockNeteaseMusic 是一个解锁网易云音乐已下架歌曲的开源项目。

使用方法

下文的使用方法均基于 CentOS 7。

基本用法

安装 Node.js 和 PM2

curl -sL https://rpm.nodesource.com/setup_12.x | bash -
yum install nodejs -y
npm install pm2 -g

下载 UnblockNeteaseMusic

git clone https://github.com/nondanee/UnblockNeteaseMusic.git && cd UnblockNeteaseMusic

UnblockNeteaseMusic 的配置参数如下:

$ unblockneteasemusic -h
usage: unblockneteasemusic [-v] [-p port] [-a address] [-u url] [-f host] [-o source [source ...]]
                           [-t token] [-e url] [-s] [-h]

optional arguments:
  -v,                      --version                          output the version number
  -p port,                 --port port                        specify server port
  -a address,              --address address                  specify server host
  -u url,                  --proxy-url url                    request through upstream proxy
  -f host,                 --force-host host                  force the netease server ip
  -o source [source ...],  --match-order source [source ...]  set priority of sources
  -t token,                --token token                      set up proxy authentication
  -e url,                  --endpoint url                     replace virtual endpoint with public host
  -s,                      --strict                           enable proxy limitation
  -h,                      --help                             output usage information

运行 UnblockNeteaseMusic

# iOS
pm2 start app.js --name="https_endpoit" -- -s -p port1:port2 -o kuwo qq migu -e https://music.163.com
# 非iOS
pm2 start app.js --name="http_endpoit" -- -s -p port1:port2 -o kuwo qq migu
# 保存进程
pm2 save
# 设置开机启动
pm2 startup

说明:

  1. 端口 -p port1:port2 和音源 -o kuwo qq migu 请根据自己需求修改。
  2. 由于新版 iOS 网易云音乐客户端强制检测音源是否为 HTTPS 路径,所以要对 iOS 与 非 iOS 分开进行配置。
  3. 由于 JOOX 音源默认为 HTTPS 路径,若服务器可使用 JOOX 音源,将 JOOX 设为默认音源可以同时适用所有客户端:
    pm2 start app.js --name="general" -- -s -p port1:port2 -o joox
  4. 若部署在公网服务器上,强烈推荐使用 -s 参数开启严格模式,限制代理范围为仅网易云音乐解锁所需域名和 IP,防止被滥用盗用。
  5. 端口部分 -p port1:port2 的写法参考 这里
  6. 目前已知的使用 PAC 模式的 BUG 为:手机微博客户端无法刷出内容,原因不明。(已修复)

在系统代理填入 http://server:port1/proxy.pac

  • macOS / iOS / iPadOS 需下载安装并信任 证书
  • Linux 启动客户端需增加 启动参数 --ignore-certificate-errors
  • Windows 需将网易云音乐客户端设置为「使用 IE 代理设置」

音源选择

目前所有可选用的音源如下表

参数音源音质描述
baidu百度音乐128kbps曲库很少,不推荐使用
jooxJOOX 音乐320kbps腾讯国际产品,曲库一般,仅限 香港,澳门,泰国,印尼,马来西亚,缅甸,南非 IP
kugou酷狗音乐128kbps曲库很少,不推荐使用
kuwo酷我音乐320kbps曲库全,对 IP 无限制
migu咪咕音乐320kbps曲库一般,仅限大陆 IP
qqQQ 音乐128kbps曲库一般,仅限大陆 IP
xiami虾米音乐/搜索接口被拦截要求移动滑块验证,目前不可用

匹配准确度

经测试,kuwo>qq>migu≈joox

推荐参数

大陆 IP:-o kuwo qq migu

非大陆 IP:-o kuwo joox

转发为 Shadowsocks

glider 是一个支持多种协议的代理转发软件。UnblockNeteaseMusic 只能提供 HTTP 代理,由于使用严格模式,需将代理进行分流,使用 glider 将 HTTP 转发为 Shadowsocks 协议后,适用的客户端也更加丰富。

服务端部署 glider

下载 glider

wget https://github.com/nadoo/glider/releases/download/v0.10.4/glider_0.10.4_linux_amd64.tar.gz

解压

tar zxvf glider_0.10.4_linux_amd64.tar.gz && cd glider_0.10.4_linux_amd64

复制二进制文件

cp glider /usr/bin/ && chmod +x /usr/bin/glider

创建配置文件,以适用于 iOS / iPadOS 为例

mkdir /etc/glider/ && vim /etc/glider/https-ss.conf

写入以下内容并保存,需自行修改加密方式 method,密码 password,Shadowsocks 监听的端口 port 及 UnblockNeteaseMusic 监听的端口 port1

# 开启调试模式,输出log
verbose=True

# Shadowsocks:
# Method:
#   AEAD Ciphers:
#     AEAD_AES_128_GCM AEAD_AES_192_GCM AEAD_AES_256_GCM AEAD_CHACHA20_POLY1305 AEAD_XCHACHA20_POLY1305
#   Stream Ciphers:
#     AES-128-CFB AES-128-CTR AES-192-CFB AES-192-CTR AES-256-CFB AES-256-CTR CHACHA20-IETF XCHACHA20 CHACHA20 RC4-MD5
#   Alias:
#     chacha20-ietf-poly1305 = AEAD_CHACHA20_POLY1305, xchacha20-ietf-poly1305 = AEAD_XCHACHA20_POLY1305
listen=ss://method:[email protected]:port

# 需转发的 UnblockNeteaseMusic HTTP 代理
forward=http://127.0.0.1:port1

通过 systemd 创建开机启动

vim /etc/systemd/system/glider-https-ss.service

写入以下内容并保存

[Unit]
Description=Glider UnblockNeteaseMusic Shadowsocks Service for iOS & iPadOS
After=network.target nss-lookup.target

[Service]
Type=simple
Restart=on-failure
LimitNOFILE=102400
CPUAccounting=yes
MemoryAccounting=yes

# NOTE: change to your glider path
ExecStart=/usr/bin/glider -config /etc/glider/https-ss.conf

# work with systemd v229 or later, so glider can listen on port below 1024 with none-root user
# CAP_NET_ADMIN: ipset
# CAP_NET_BIND_SERVICE: bind ports under 1024
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
NoNewPrivileges=true

[Install]
WantedBy=multi-user.target

启用 glider-https-ss.service

systemctl enable glider-https-ss.service

启动 glider-https-ss.service

systemctl start glider-https-ss.service

查看 glider-https-ss.service 状态

systemctl status glider-https-ss.service

客户端分流规则

以下规则均为 解锁网易云音乐+屏蔽客户端广告,其中服务器地址 server,端口 server,加密方式 cipher 及 密码 password 需自行修改。

Clash
mixed-port: 7890
allow-lan: false
mode: rule
log-level: info
external-controller: 127.0.0.1:9090
dns:
  enable: true
  listen: 0.0.0.0:53
  enhanced-mode: fake-ip
  nameserver:
    - 119.29.29.29
    - 223.5.5.5

proxies:
  - name: Unblock
    type: ss
    server: server
    port: port
    cipher: cipher
    password: password

proxy-groups:
  - name: Netease Music
    type: select
    proxies:
      - Unblock
      - DIRECT

rules:
  # Netease Music Advertising
  - DOMAIN,admusicpic.music.126.net,REJECT
  - DOMAIN,iadmat.nosdn.127.net,REJECT
  - DOMAIN,iadmusicmat.music.126.net,REJECT
  - DOMAIN,iadmusicmatvideo.music.126.net,REJECT

  # Netease Music
  - DOMAIN,api.iplay.163.com,Netease Music
  - DOMAIN,apm3.music.163.com,Netease Music
  - DOMAIN,apm.music.163.com,Netease Music
  - DOMAIN,interface3.music.163.com,Netease Music
  - DOMAIN,interface.music.163.com,Netease Music
  - DOMAIN,music.163.com,Netease Music
  - IP-CIDR,39.105.63.80/32,Netease Music,no-resolve
  - IP-CIDR,45.254.48.1/32,Netease Music,no-resolve
  - IP-CIDR,47.100.127.239/32,Netease Music,no-resolve
  - IP-CIDR,59.111.160.195/32,Netease Music,no-resolve
  - IP-CIDR,59.111.160.197/32,Netease Music,no-resolve
  - IP-CIDR,59.111.181.35/32,Netease Music,no-resolve
  - IP-CIDR,59.111.181.38/32,Netease Music,no-resolve
  - IP-CIDR,59.111.181.60/32,Netease Music,no-resolve
  - IP-CIDR,101.71.154.241/32,Netease Music,no-resolve
  - IP-CIDR,103.126.92.132/32,Netease Music,no-resolve
  - IP-CIDR,103.126.92.133/32,Netease Music,no-resolve
  - IP-CIDR,112.13.119.17/32,Netease Music,no-resolve
  - IP-CIDR,112.13.122.1/32,Netease Music,no-resolve
  - IP-CIDR,115.236.118.33/32,Netease Music,no-resolve
  - IP-CIDR,115.236.121.1/32,Netease Music,no-resolve
  - IP-CIDR,118.24.63.156/32,Netease Music,no-resolve
  - IP-CIDR,193.112.159.225/32,Netease Music,no-resolve
  - IP-CIDR,223.252.199.66/32,Netease Music,no-resolve
  - IP-CIDR,223.252.199.67/32,Netease Music,no-resolve

  # Final
  - MATCH,DIRECT
Surfboard
[General]
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local
dns-server = 119.29.29.29, 223.5.5.5, 1.2.4.8, system

[Proxy]
Unblock = ss, server, port, cipher, password, udp-relay=false

[Proxy Group]
Netease Music = select, Unblock, DIRECT

[Rule]
# Netease Music Advertising
DOMAIN,admusicpic.music.126.net,REJECT
DOMAIN,iadmat.nosdn.127.net,REJECT
DOMAIN,iadmusicmat.music.126.net,REJECT
DOMAIN,iadmusicmatvideo.music.126.net,REJECT

# Netease Music
DOMAIN,api.iplay.163.com,Netease Music
DOMAIN,apm3.music.163.com,Netease Music
DOMAIN,apm.music.163.com,Netease Music
DOMAIN,interface3.music.163.com,Netease Music
DOMAIN,interface.music.163.com,Netease Music
DOMAIN,music.163.com,Netease Music
IP-CIDR,39.105.63.80/32,Netease Music
IP-CIDR,45.254.48.1/32,Netease Music
IP-CIDR,47.100.127.239/32,Netease Music
IP-CIDR,59.111.160.195/32,Netease Music
IP-CIDR,59.111.160.197/32,Netease Music
IP-CIDR,59.111.181.35/32,Netease Music
IP-CIDR,59.111.181.38/32,Netease Music
IP-CIDR,59.111.181.60/32,Netease Music
IP-CIDR,101.71.154.241/32,Netease Music
IP-CIDR,103.126.92.132/32,Netease Music
IP-CIDR,103.126.92.133/32,Netease Music
IP-CIDR,112.13.119.17/32,Netease Music
IP-CIDR,112.13.122.1/32,Netease Music
IP-CIDR,115.236.118.33/32,Netease Music
IP-CIDR,115.236.121.1/32,Netease Music
IP-CIDR,118.24.63.156/32,Netease Music
IP-CIDR,193.112.159.225/32,Netease Music
IP-CIDR,223.252.199.66/32,Netease Music
IP-CIDR,223.252.199.67/32,Netease Music

# Final
FINAL,DIRECT
Quantumult
[SERVER]
Netease Music = shadowsocks, server, port, cipher, "password", upstream-proxy=false, upstream-proxy-auth=false

[SOURCE]

[BACKUP-SERVER]

[SUSPEND-SSID]

[POLICY]

[DNS]
119.29.29.29, 223.5.5.5, 1.2.4.8, system

[REWRITE]

[URL-REJECTION]

[TCP]
# Netease Music Advertising
HOST,admusicpic.music.126.net,REJECT
HOST,iadmat.nosdn.127.net,REJECT
HOST,iadmusicmat.music.126.net,REJECT
HOST,iadmusicmatvideo.music.126.net,REJECT

# Netease Music
HOST,api.iplay.163.com,Netease Music
HOST,apm3.music.163.com,Netease Music
HOST,apm.music.163.com,Netease Music
HOST,interface3.music.163.com,Netease Music
HOST,interface.music.163.com,Netease Music
HOST,music.163.com,Netease Music
IP-CIDR,39.105.63.80/32,Netease Music
IP-CIDR,45.254.48.1/32,Netease Music
IP-CIDR,47.100.127.239/32,Netease Music
IP-CIDR,59.111.160.195/32,Netease Music
IP-CIDR,59.111.160.197/32,Netease Music
IP-CIDR,59.111.181.35/32,Netease Music
IP-CIDR,59.111.181.38/32,Netease Music
IP-CIDR,59.111.181.60/32,Netease Music
IP-CIDR,101.71.154.241/32,Netease Music
IP-CIDR,103.126.92.132/32,Netease Music
IP-CIDR,103.126.92.133/32,Netease Music
IP-CIDR,112.13.119.17/32,Netease Music
IP-CIDR,112.13.122.1/32,Netease Music
IP-CIDR,115.236.118.33/32,Netease Music
IP-CIDR,115.236.121.1/32,Netease Music
IP-CIDR,118.24.63.156/32,Netease Music
IP-CIDR,193.112.159.225/32,Netease Music
IP-CIDR,223.252.199.66/32,Netease Music
IP-CIDR,223.252.199.67/32,Netease Music

# Final
FINAL,DIRECT

[GLOBAL]

[HOST]

[STATE]
STATE,AUTO

[MITM]
Shadowrocket
[General]
bypass-system = true
skip-proxy = 192.168.0.0/16, 193.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, 127.0.0.1, 17.0.0.0/8, localhost, *.local
bypass-tun = 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.2.0/24, 192.88.99.0/24, 192.168.0.0/16, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4, 255.255.255.255/32
dns-server = 119.29.29.29, 223.5.5.5, 1.2.4.8, system

[Rule]
# Netease Music Advertising
DOMAIN,admusicpic.music.126.net,REJECT
DOMAIN,iadmat.nosdn.127.net,REJECT
DOMAIN,iadmusicmat.music.126.net,REJECT
DOMAIN,iadmusicmatvideo.music.126.net,REJECT

# Netease Music
DOMAIN,api.iplay.163.com,Netease Music
DOMAIN,apm3.music.163.com,Netease Music
DOMAIN,apm.music.163.com,Netease Music
DOMAIN,interface3.music.163.com,Netease Music
DOMAIN,interface.music.163.com,Netease Music
DOMAIN,music.163.com,Netease Music
IP-CIDR,39.105.63.80/32,Netease Music
IP-CIDR,45.254.48.1/32,Netease Music
IP-CIDR,47.100.127.239/32,Netease Music
IP-CIDR,59.111.160.195/32,Netease Music
IP-CIDR,59.111.160.197/32,Netease Music
IP-CIDR,59.111.181.35/32,Netease Music
IP-CIDR,59.111.181.38/32,Netease Music
IP-CIDR,59.111.181.60/32,Netease Music
IP-CIDR,101.71.154.241/32,Netease Music
IP-CIDR,103.126.92.132/32,Netease Music
IP-CIDR,103.126.92.133/32,Netease Music
IP-CIDR,112.13.119.17/32,Netease Music
IP-CIDR,112.13.122.1/32,Netease Music
IP-CIDR,115.236.118.33/32,Netease Music
IP-CIDR,115.236.121.1/32,Netease Music
IP-CIDR,118.24.63.156/32,Netease Music
IP-CIDR,193.112.159.225/32,Netease Music
IP-CIDR,223.252.199.66/32,Netease Music
IP-CIDR,223.252.199.67/32,Netease Music

# Final
FINAL,DIRECT

评论

  1. 江楮
    Safari 14.0
    2月前
    2020-9-01 1:53:09

    可不可以加个转v2+ws的方法,ss日渐失联,感谢🙏

    • DesperadoJ 博主
      Chrome 85.0.4183.83
      2月前
      2020-9-05 0:07:52

      过一段时间忙完手头的事情之后会考虑添加

  2. lulu123
    Safari 13.0.1
    4周前
    2020-9-20 22:42:27

    我发现我用小火箭代理ss 是不需要装证书的 哈哈

发送评论 编辑评论


|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇