luci-app-unblockmusic: add flac switch for nodejs (#4302)

* Update unblockmusic.lua

* Update unblockmusic
This commit is contained in:
hyird 2020-04-14 09:21:40 +08:00 committed by GitHub
parent b97c4e8bb5
commit f4a9966616
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -30,7 +30,7 @@ speedtype:value("qq", translate("QQ音乐"))
speedtype:value("xiami", translate("虾米音乐")) speedtype:value("xiami", translate("虾米音乐"))
speedtype:value("baidu", translate("百度音乐")) speedtype:value("baidu", translate("百度音乐"))
speedtype:value("kugou", translate("酷狗音乐")) speedtype:value("kugou", translate("酷狗音乐"))
speedtype:value("kuwo", translate("酷我音乐(高音质/FLACの解锁可能性)")) speedtype:value("kuwo", translate("酷我音乐"))
speedtype:value("migu", translate("咕咪音乐")) speedtype:value("migu", translate("咕咪音乐"))
speedtype:value("joox", translate("JOOX音乐")) speedtype:value("joox", translate("JOOX音乐"))
speedtype.default = "kuwo" speedtype.default = "kuwo"
@ -47,8 +47,11 @@ cloudserver.default = "cdn-shanghai.service.project-openwrt.eu.org:30000:30001"
cloudserver.rmempty = true cloudserver.rmempty = true
cloudserver:depends("apptype", "cloud") cloudserver:depends("apptype", "cloud")
download_certificate=s:option(DummyValue,"opennewwindow",translate("HTTPS 证书")) flac = s:option(Flag, "flac_enabled", translate("启用无损音质"))
download_certificate.description = translate("<input type=\"button\" class=\"cbi-button cbi-button-apply\" value=\"下载CA根证书\" onclick=\"window.open('https://raw.githubusercontent.com/nondanee/UnblockNeteaseMusic/master/ca.crt')\" /><br />Mac/iOS客户端需要安装 CA根证书并信任<br />iOS系统需要在“设置 -> 通用 -> 关于本机 -> 证书信任设置”中,信任 UnblockNeteaseMusic Root CA <br />Linux 设备请在启用时加入 --ignore-certificate-errors 参数") flac.default = 1
flac.rmempty = false
flac.description = translate("目前仅支持酷我、QQ、咪咕")
flac:depends("apptype", "nodejs")
o = s:option(Flag, "autoupdate") o = s:option(Flag, "autoupdate")
o.title = translate("自动检查更新主程序") o.title = translate("自动检查更新主程序")
@ -57,6 +60,9 @@ o.rmempty = false
o.description = translate("每天自动检测并更新到最新版本") o.description = translate("每天自动检测并更新到最新版本")
o:depends("apptype", "nodejs") o:depends("apptype", "nodejs")
download_certificate=s:option(DummyValue,"opennewwindow",translate("HTTPS 证书"))
download_certificate.description = translate("<input type=\"button\" class=\"cbi-button cbi-button-apply\" value=\"下载CA根证书\" onclick=\"window.open('https://raw.githubusercontent.com/nondanee/UnblockNeteaseMusic/master/ca.crt')\" /><br />Mac/iOS客户端需要安装 CA根证书并信任<br />iOS系统需要在“设置 -> 通用 -> 关于本机 -> 证书信任设置”中,信任 UnblockNeteaseMusic Root CA <br />Linux 设备请在启用时加入 --ignore-certificate-errors 参数")
local ver = fs.readfile("/usr/share/UnblockNeteaseMusic/core_ver") or "0.00" local ver = fs.readfile("/usr/share/UnblockNeteaseMusic/core_ver") or "0.00"
o = s:option(Button, "restart",translate("手动更新")) o = s:option(Button, "restart",translate("手动更新"))

View File

@ -65,6 +65,7 @@ ENABLE=$(uci_get_by_type unblockmusic enabled 0)
TYPE=$(uci_get_by_type unblockmusic musicapptype default) TYPE=$(uci_get_by_type unblockmusic musicapptype default)
AUTOUPDATE=$(uci_get_by_type unblockmusic autoupdate 0) AUTOUPDATE=$(uci_get_by_type unblockmusic autoupdate 0)
APPTYPE=$(uci_get_by_type unblockmusic apptype go) APPTYPE=$(uci_get_by_type unblockmusic apptype go)
FLAC=$(uci_get_by_type unblockmusic flac_enabled 0)
CLOUD=$(uci_get_by_type unblockmusic cloudserver "127.0.0.1:5200:5201") CLOUD=$(uci_get_by_type unblockmusic cloudserver "127.0.0.1:5200:5201")
cloudadd=$(echo "$CLOUD" | awk -F ':' '{print $1}') cloudadd=$(echo "$CLOUD" | awk -F ':' '{print $1}')
@ -168,7 +169,9 @@ start()
fi fi
if [ "$APPTYPE" == "nodejs" ]; then if [ "$APPTYPE" == "nodejs" ]; then
if [ $FLAC -eq 1 ]; then
export ENABLE_FLAC=true export ENABLE_FLAC=true
fi
node /usr/share/UnblockNeteaseMusic/app.js -e http://music.163.com -p 5200:5201 $musictype >>/tmp/unblockmusic.log 2>&1 & node /usr/share/UnblockNeteaseMusic/app.js -e http://music.163.com -p 5200:5201 $musictype >>/tmp/unblockmusic.log 2>&1 &
add_cron add_cron
echo "$(date -R) # UnblockNeteaseMusic Nodejs Version (http:5200, https:5201)" >>/tmp/unblockmusic.log echo "$(date -R) # UnblockNeteaseMusic Nodejs Version (http:5200, https:5201)" >>/tmp/unblockmusic.log