luci-app-unblockneteasemusic: move to self-maintained repo

Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
This commit is contained in:
CN_SZTL 2021-01-17 02:10:57 +08:00
parent 9c6b466baa
commit 28a2c1240c
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
4 changed files with 29 additions and 28 deletions

View File

@ -56,8 +56,8 @@ function act_update_luci()
end
function update_core()
core_cloud_ver=luci.sys.exec("curl -s 'https://github.com/nondanee/UnblockNeteaseMusic/commits/master' |tr -d '\n' |grep -Eo 'commit\/[0-9a-z]+' |sed -n 1p |sed 's#commit/##g'")
core_cloud_ver_mini=luci.sys.exec("curl -s 'https://github.com/nondanee/UnblockNeteaseMusic/commits/master' |tr -d '\n' |grep -Eo 'BtnGroup-item.> [0-9a-z]+' |sed -n 1p |sed 's#BtnGroup-item.> ##g'")
core_cloud_ver=luci.sys.exec("curl -s 'https://github.com/1715173329/UnblockNeteaseMusic/commits/enhanced' |tr -d '\n' |grep -Eo 'commit\/[0-9a-z]+' |sed -n 1p |sed 's#commit/##g'")
core_cloud_ver_mini=luci.sys.exec("curl -s 'https://github.com/1715173329/UnblockNeteaseMusic/commits/enhanced' |tr -d '\n' |grep -Eo 'BtnGroup-item.> [0-9a-z]+' |sed -n 1p |sed 's#BtnGroup-item.> ##g'")
if not core_cloud_ver or not core_cloud_ver_mini then
return "1"
else
@ -82,4 +82,4 @@ function act_update_core()
luci.http.write_json({
ret = update_core();
})
end
end

View File

@ -42,6 +42,27 @@ replace_music_source.description = translate("当音乐音质低于指定数值
replace_music_source.default = "dont_replace"
replace_music_source.rmempty = false
use_custom_cookie = s:option(Flag, "use_custom_cookie", translate("使用自定义 Cookie"))
use_custom_cookie.description = translate("使用自定义 Cookie 请求音源接口")
use_custom_cookie.default = 0
use_custom_cookie.rmempty = false
neteasemusic_cookie = s:option(Value, "neteasemusic_cookie", translate("NeteaseMusic Cookie"))
neteasemusic_cookie.description = translate("在 music.163.com 获取需要MUSIC_U值")
neteasemusic_cookie.datatype = "string"
neteasemusic_cookie:depends("use_custom_cookie", 1)
qq_cookie = s:option(Value, "qq_cookie", translate("QQ Cookie"))
qq_cookie.description = translate("在 y.qq.com 获取需要uin和qm_keyst值")
qq_cookie.placeholder = "uin=; qm_keyst="
qq_cookie.datatype = "string"
qq_cookie:depends("use_custom_cookie", 1)
youtube_key = s:option(Value, "youtube_key", translate("Youtube API Key"))
youtube_key.description = translate("API Key申请地址https://developers.google.com/youtube/v3/getting-started#before-you-start")
youtube_key.datatype = "string"
youtube_key:depends("use_custom_cookie", 1)
use_remote_qq_server = s:option(Flag, "use_remote_qq_server", translate("使用云端QQ音源解析"))
use_remote_qq_server.description = translate("通过云端服务器以获取QQ音源信息无需开通QQ绿钻")
use_remote_qq_server.default = 0
@ -124,27 +145,6 @@ hijack.description = translate("如果使用Hosts劫持程序监听的HTTP/HT
hijack.default = "dont_hijack"
hijack:depends("advanced_mode", 1)
use_custom_cookie = s:option(Flag, "use_custom_cookie", translate("使用自定义 Cookie"))
use_custom_cookie.description = translate("使用自定义 Cookie 请求音源接口")
use_custom_cookie.default = 0
use_custom_cookie:depends("advanced_mode", 1)
neteasemusic_cookie = s:option(Value, "neteasemusic_cookie", translate("NeteaseMusic Cookie"))
neteasemusic_cookie.description = translate("在 music.163.com 获取需要MUSIC_U值")
neteasemusic_cookie.datatype = "string"
neteasemusic_cookie:depends("use_custom_cookie", 1)
qq_cookie = s:option(Value, "qq_cookie", translate("QQ Cookie"))
qq_cookie.description = translate("在 y.qq.com 获取需要uin和qm_keyst值")
qq_cookie.placeholder = "uin=; qm_keyst="
qq_cookie.datatype = "string"
qq_cookie:depends("use_custom_cookie", 1)
youtube_key = s:option(Value, "youtube_key", translate("Youtube API Key"))
youtube_key.description = translate("API Key申请地址https://developers.google.com/youtube/v3/getting-started#before-you-start")
youtube_key.datatype = "string"
youtube_key:depends("use_custom_cookie", 1)
keep_core_when_upgrade = s:option(Flag, "keep_core_when_upgrade", translate("升级时保留核心程序"))
keep_core_when_upgrade.description = translate("默认情况下在OpenWrt升级后会导致核心程序丢失开启此选项后会保留当前下载的核心程序")
keep_core_when_upgrade.default = 0

View File

@ -4,6 +4,7 @@ config unblockneteasemusic
option music_source 'default'
option enable_flac '0'
option replace_music_source 'dont_replace'
option use_custom_cookie '0'
option use_remote_qq_server '0'
option auto_update '1'
option update_time '3'

View File

@ -55,7 +55,7 @@ function update_luci(){
}
function check_core_latest_version(){
core_latest_ver="$(curl -s https://github.com/nondanee/UnblockNeteaseMusic/commits/master |tr -d '\n' |grep -Eo 'commit\/[0-9a-z]+' |sed -n 1p |sed 's#commit/##g')"
core_latest_ver="$(curl -s https://github.com/1715173329/UnblockNeteaseMusic/commits/enhanced |tr -d '\n' |grep -Eo 'commit\/[0-9a-z]+' |sed -n 1p |sed 's#commit/##g')"
[ -z "${core_latest_ver}" ] && { echo -e "\nFailed to check latest core version, please try again later." >> "/tmp/$NAME.log"; exit 1; }
if [ ! -e "/usr/share/$NAME/core_local_ver" ]; then
clean_log
@ -80,10 +80,10 @@ function update_core(){
mkdir -p "/usr/share/$NAME/core" > "/dev/null" 2>&1
rm -rf /usr/share/$NAME/core/* > "/dev/null" 2>&1
curl -sL "https://github.com/nondanee/UnblockNeteaseMusic/archive/master.tar.gz" -o "/usr/share/$NAME/core/core.tar.gz" > "/dev/null" 2>&1
curl -sL "https://github.com/1715173329/UnblockNeteaseMusic/archive/enhanced.tar.gz" -o "/usr/share/$NAME/core/core.tar.gz" > "/dev/null" 2>&1
tar -zxf "/usr/share/$NAME/core/core.tar.gz" -C "/usr/share/$NAME/core/" > "/dev/null" 2>&1
mv /usr/share/$NAME/core/UnblockNeteaseMusic-master/* "/usr/share/$NAME/core/"
rm -rf "/usr/share/$NAME/core/core.tar.gz" "/usr/share/$NAME/core/UnblockNeteaseMusic-master" > "/dev/null" 2>&1
mv /usr/share/$NAME/core/UnblockNeteaseMusic-enhanced/* "/usr/share/$NAME/core/"
rm -rf "/usr/share/$NAME/core/core.tar.gz" "/usr/share/$NAME/core/UnblockNeteaseMusic-enhanced" > "/dev/null" 2>&1
if [ ! -e "/usr/share/$NAME/core/app.js" ]; then
echo -e "Failed to download core." >> "/tmp/$NAME.log"