Skip to content

Commit

Permalink
增加音源配置 (#1925)
Browse files Browse the repository at this point in the history
以解决苹果iOS和MacOS下无法使用的问题。参考nondanee/UnblockNeteaseMusic#65
  • Loading branch information
nivalxer authored and coolsnowwolf committed Oct 29, 2019
1 parent bc9b8b5 commit da1d65c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package/lean/luci-app-unblockmusic/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-unblockmusic
PKG_VERSION:=2.2.0
PKG_RELEASE:=2
PKG_RELEASE:=3

PKG_LICENSE:=Apache-2.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ speedtype:value("kuwo", translate("酷我音乐(高音质推荐)"))
speedtype:value("migu", translate("咕咪音乐"))
speedtype:value("joox", translate("JOOX音乐"))

endpoint = s:option(Value, "endpoint", translate("转发音源"))
endpoint.default = "https://music.163.com"
endpoint.rmempty = true
endpoint.description = translate("自定义转发音源<br />针对苹果系统设置请参考:https://github.com/nondanee/UnblockNeteaseMusic/issues/65")

return mp
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

config unblockmusic
option enabled '0'
option musicapptype 'kuwo'
option musicapptype 'default'
option port '5200'
option enable_ipset '1'
option endpoint 'https://music.163.com'


11 changes: 9 additions & 2 deletions package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ STOP=10
enable=$(uci get unblockmusic.@unblockmusic[0].enabled)
TYPE=$(uci get unblockmusic.@unblockmusic[0].musicapptype)
ROUTE_IP=$(uci get network.lan.ipaddr)
ENDPOINT=$(uci get unblockmusic.@unblockmusic[0].endpoint)

ipt_n="iptables -t nat"

Expand Down Expand Up @@ -56,10 +57,16 @@ start()

[ $enable -eq "0" ] && exit 0

endponintset="";

if [ -n "$ENDPOINT" ]; then
endponintset="-e ${ENDPOINT}"
fi

if [ $TYPE = "default" ]; then
node /usr/share/UnblockNeteaseMusic/app.js -p 5200:5201 >/tmp/unblockmusic.log 2>&1 &
node /usr/share/UnblockNeteaseMusic/app.js $endponintset -p 5200:5201 >/tmp/unblockmusic.log 2>&1 &
else
node /usr/share/UnblockNeteaseMusic/app.js -p 5200:5201 -o $TYPE >/tmp/unblockmusic.log 2>&1 &
node /usr/share/UnblockNeteaseMusic/app.js $endponintset -p 5200:5201 -o $TYPE >/tmp/unblockmusic.log 2>&1 &
fi

set_firewall
Expand Down

0 comments on commit da1d65c

Please sign in to comment.