From a750363c5cdabf456ec36f746ff95d355793b106 Mon Sep 17 00:00:00 2001 From: CN_SZTL <22235437+1715173329@users.noreply.github.com> Date: Sun, 20 Sep 2020 13:37:31 +0800 Subject: [PATCH] luci-app-unblockmusic: add a new function for go version (#5493) * UnblockNeteaseMusic-Go: bump to 0.2.6 * luci-app-unblockmusic: drop outdated cloud servers * luci-app-unblockmusic: add a new function from go version --- package/lean/UnblockNeteaseMusicGo/Makefile | 4 ++-- package/lean/luci-app-unblockmusic/Makefile | 2 +- .../luasrc/model/cbi/unblockmusic.lua | 7 +++++-- .../luci-app-unblockmusic/root/etc/init.d/unblockmusic | 3 ++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/package/lean/UnblockNeteaseMusicGo/Makefile b/package/lean/UnblockNeteaseMusicGo/Makefile index 41dee1bc625a12..5b4c1710fdc486 100644 --- a/package/lean/UnblockNeteaseMusicGo/Makefile +++ b/package/lean/UnblockNeteaseMusicGo/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=UnblockNeteaseMusicGo -PKG_VERSION:=0.2.5 +PKG_VERSION:=0.2.6 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/cnsilvan/UnblockNeteaseMusic.git -PKG_SOURCE_VERSION:=aa1eb0186206671de9a6b4fa27d933bb306d4e25 +PKG_SOURCE_VERSION:=7ff431267eb2b2683ea25e1b3860447aa7b482e9 PKG_MAINTAINER:=Silvan PKG_SOURCE_SUBDIR:=$(PKG_NAME) diff --git a/package/lean/luci-app-unblockmusic/Makefile b/package/lean/luci-app-unblockmusic/Makefile index 19c70a46cc8594..ccc6f01c0b61d3 100644 --- a/package/lean/luci-app-unblockmusic/Makefile +++ b/package/lean/luci-app-unblockmusic/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-unblockmusic PKG_VERSION:=2.3.5 -PKG_RELEASE:=9 +PKG_RELEASE:=10 PKG_CONFIG_DEPENDS := \ CONFIG_UnblockNeteaseMusic_Go \ diff --git a/package/lean/luci-app-unblockmusic/luasrc/model/cbi/unblockmusic.lua b/package/lean/luci-app-unblockmusic/luasrc/model/cbi/unblockmusic.lua index 55a50b29a950aa..265a1bd6b99c5b 100644 --- a/package/lean/luci-app-unblockmusic/luasrc/model/cbi/unblockmusic.lua +++ b/package/lean/luci-app-unblockmusic/luasrc/model/cbi/unblockmusic.lua @@ -39,13 +39,16 @@ speedtype:depends("apptype", "go") cloudserver = s:option(Value, "cloudserver", translate("服务器位置")) cloudserver:value("cdn-shanghai.service.project-openwrt.eu.org:30000:30001", translate("[CTCGFW] 腾讯云上海(高音质)")) -cloudserver:value("hyird.xyz:30000:30001", translate("[hyird] 阿里云北京(高音质)")) -cloudserver:value("39.96.56.58:30000:30000", translate("[Sunsky] 阿里云北京(高音质)")) cloudserver.description = translate("自定义服务器格式为 IP[域名]:HTTP端口:HTTPS端口
如果服务器为LAN内网IP,需要将这个服务器IP放入例外客户端 (不代理HTTP和HTTPS)") cloudserver.default = "cdn-shanghai.service.project-openwrt.eu.org:30000:30001" cloudserver.rmempty = true cloudserver:depends("apptype", "cloud") +search_limit = s:option(Value, "search_limit", translate("搜索结果限制")) +search_limit.description = translate("在搜索页面显示其他平台搜索结果个数,可填(0-3)") +search_limit.default = "0" +search_limit:depends("apptype", "go") + flac = s:option(Flag, "flac_enabled", translate("启用无损音质")) flac.default = "1" flac.rmempty = false diff --git a/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic b/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic index 24612c0d94f4e8..9d7a11cfe75a46 100755 --- a/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic +++ b/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic @@ -65,6 +65,7 @@ ENABLE=$(uci_get_by_type unblockmusic enabled 0) TYPE=$(uci_get_by_type unblockmusic musicapptype default) AUTOUPDATE=$(uci_get_by_type unblockmusic autoupdate 0) APPTYPE=$(uci_get_by_type unblockmusic apptype go) +SEARCHLIMIT=$(uci_get_by_type unblockmusic search_limit 0) FLAC=$(uci_get_by_type unblockmusic flac_enabled 0) FORCE=$(uci_get_by_type unblockmusic force_enabled 0) @@ -187,7 +188,7 @@ start() if [ $FLAC -eq 1 ]; then ENABLE_FLAC="-b " fi - UnblockNeteaseMusic $ENABLE_FLAC -p 5200 -sp 5201 -m 0 -c /usr/share/UnblockNeteaseMusicGo/server.crt -k /usr/share/UnblockNeteaseMusicGo/server.key -m 0 -e >>/tmp/unblockmusic.log 2>&1 & + UnblockNeteaseMusic $ENABLE_FLAC -p 5200 -sp 5201 -m 0 -c /usr/share/UnblockNeteaseMusicGo/server.crt -k /usr/share/UnblockNeteaseMusicGo/server.key -m 0 -e -sl ${SEARCHLIMIT} -l /tmp/unblockmusic.log & echo "$(date -R) # UnblockNeteaseMusic Golang Version (http:5200, https:5201)" >>/tmp/unblockmusic.log else kill -9 $(busybox ps -w | grep 'sleep 60m' | grep -v grep | awk '{print $1}') >/dev/null 2>&1