luci-app-unblockneteasemusic: bump to v2.8
This commit is contained in:
parent
57948b63e0
commit
92484fb631
@ -11,8 +11,8 @@ LUCI_TITLE:=LuCI support for UnblockNeteaseMusic
|
||||
LUCI_DEPENDS:=+bash +busybox +coreutils-nohup +curl +dnsmasq-full +ipset +libopenssl +node
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_NAME:=luci-app-unblockneteasemusic
|
||||
PKG_VERSION:=2.7
|
||||
PKG_RELEASE:=6
|
||||
PKG_VERSION:=2.8
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=[CTCGFW]Project-OpenWrt
|
||||
|
||||
|
||||
@ -12,17 +12,17 @@ enable.description = translate("启用本插件以解除网易云音乐播放限
|
||||
enable.default = 0
|
||||
enable.rmempty = false
|
||||
|
||||
music_source = s:option(ListValue, "music_source", translate("音源接口"))
|
||||
music_source = s:option(Value, "music_source", translate("音源接口"))
|
||||
music_source:value("default", translate("默认"))
|
||||
music_source:value("qq", translate("QQ音乐"))
|
||||
music_source:value("xiami", translate("虾米音乐"))
|
||||
music_source:value("baidu", translate("百度音乐"))
|
||||
music_source:value("kugou", translate("酷狗音乐"))
|
||||
music_source:value("kuwo", translate("酷我音乐"))
|
||||
music_source:value("migu", translate("咕咪音乐"))
|
||||
music_source:value("kugou", translate("酷狗音乐"))
|
||||
music_source:value("xiami", translate("虾米音乐"))
|
||||
music_source:value("baidu", translate("百度音乐"))
|
||||
music_source:value("joox", translate("JOOX音乐"))
|
||||
music_source:value("youtube", translate("Youtube音乐"))
|
||||
music_source.description = translate("音源调用接口")
|
||||
music_source.description = translate("自定义模式下,多个音源请用空格隔开")
|
||||
music_source.default = "default"
|
||||
music_source.rmempty = false
|
||||
|
||||
@ -37,6 +37,11 @@ youtube_key.description = translate("API Key申请地址:https://developers.go
|
||||
youtube_key.datatype = "string"
|
||||
youtube_key:depends("music_source", "youtube")
|
||||
|
||||
enable_flac = s:option(Flag, "enable_flac", translate("启用无损音质"))
|
||||
enable_flac.description = translate("目前仅支持QQ、酷我、咪咕音源")
|
||||
enable_flac.default = 0
|
||||
enable_flac.rmempty = false
|
||||
|
||||
auto_update = s:option(Flag, "auto_update", translate("启用自动更新"))
|
||||
auto_update.description = translate("启用后,每天将定时自动检查最新版本并更新")
|
||||
auto_update.default = 0
|
||||
|
||||
@ -4,6 +4,7 @@ config unblockneteasemusic
|
||||
option music_source 'default'
|
||||
option qq_cookie ''
|
||||
option youtube_key ''
|
||||
option enable_flac '0'
|
||||
option auto_update '1'
|
||||
option update_time '3'
|
||||
option daemon_enable '1'
|
||||
|
||||
@ -13,6 +13,9 @@ music_source="$(uci get unblockneteasemusic.@unblockneteasemusic[0].music_source
|
||||
qq_cookie="$(uci get unblockneteasemusic.@unblockneteasemusic[0].qq_cookie 2>"/dev/null")"
|
||||
youtube_key="$(uci get unblockneteasemusic.@unblockneteasemusic[0].youtube_key 2>"/dev/null")"
|
||||
|
||||
enable_flac="$(uci get unblockneteasemusic.@unblockneteasemusic[0].enable_flac)"
|
||||
[ "${enable_flac}" -eq "1" ] && flag_arg="ENABLE_FLAC=true"
|
||||
|
||||
endpoint_url="$(uci get unblockneteasemusic.@unblockneteasemusic[0].endpoint_url || echo "http://music.163.com")"
|
||||
hijack_ways="$(uci get unblockneteasemusic.@unblockneteasemusic[0].hijack_ways || echo "use_ipset")"
|
||||
|
||||
@ -68,7 +71,7 @@ ipset=/clientlog3.music.163.com/neteasemusic
|
||||
[ -z "$(iptables -t nat -L "KOOLPROXY" | grep "UnblockMusic" | sed 's/\/.*//')" ] && iptables -t nat -I "KOOLPROXY" -m set --match-set "neteasemusic" dst -j RETURN -m comment --comment "KP for UnblockMusic"
|
||||
|
||||
mkdir -p "/var/etc/"
|
||||
echo -e "/etc/init.d/unblockneteasemusic restart" > "/var/etc/unblockneteasemusic.include"
|
||||
echo "/etc/init.d/unblockneteasemusic restart" > "/var/etc/unblockneteasemusic.include"
|
||||
elif [ "${set_type}" = "stop" ]; then
|
||||
iptables -t nat -D "PREROUTING" -p tcp -m set --match-set "neteasemusic" dst -j "netease_cloud_music"
|
||||
iptables -t nat -D "ADBYBY" -m set --match-set "neteasemusic" dst -j RETURN -m comment --comment "AD for UnblockMusic"
|
||||
@ -115,7 +118,7 @@ set_ports(){
|
||||
iptables -I INPUT -p tcp --dport "${https_port}" -j ACCEPT
|
||||
|
||||
mkdir -p "/var/etc/"
|
||||
echo -e "/etc/init.d/unblockneteasemusic restart" > "/var/etc/unblockneteasemusic.include"
|
||||
echo "/etc/init.d/unblockneteasemusic restart" > "/var/etc/unblockneteasemusic.include"
|
||||
elif [ "${set_type}" = "stop" ]; then
|
||||
iptables -D INPUT -p tcp --dport "${http_port}" -j ACCEPT
|
||||
iptables -D INPUT -p tcp --dport "${https_port}" -j ACCEPT
|
||||
@ -133,25 +136,24 @@ start()
|
||||
[ ! -e "/usr/share/unblockneteasemusic/core/app.js" ] && { rm -f "/usr/share/unblockneteasemusic/local_ver"; bash "/usr/share/unblockneteasemusic/update.sh" "update_core_non_restart"; }
|
||||
[ ! -e "/usr/share/unblockneteasemusic/core/app.js" ] && { echo "Core Not Found, please download it before starting." >> "/tmp/unblockneteasemusic.log"; exit 1; }
|
||||
|
||||
if [ "${music_source}" = "qq" ];then
|
||||
[ -z "${qq_cookie}" ] && { echo "QQ cookie is not exsit, please enter it before starting."; exit 1; }
|
||||
qq_cookie_line="$(awk "/'cookie':/{print NR}" "/usr/share/unblockneteasemusic/core/src/provider/qq.js")"
|
||||
sed -i "${qq_cookie_line}d" "/usr/share/unblockneteasemusic/core/src/provider/qq.js"
|
||||
sed -i -e "${qq_cookie_line}i \\\t'cookie': '${qq_cookie}'" "/usr/share/unblockneteasemusic/core/src/provider/qq.js"
|
||||
elif [ "${music_source}" = "youtube" ];then
|
||||
[ -z "${youtube_key}" ] && { echo "Youtube API Key is not exsit, please enter it before starting."; exit 1; }
|
||||
sed -i '/const key = /d' "/usr/share/unblockneteasemusic/core/src/provider/youtube.js"
|
||||
sed -i -e "1i const key = '${youtube_key}'" "/usr/share/unblockneteasemusic/core/src/provider/youtube.js"
|
||||
fi
|
||||
[ -n "${qq_cookie}" ] && {
|
||||
qq_cookie_line="$(awk "/'cookie':/{print NR}" "/usr/share/unblockneteasemusic/core/src/provider/qq.js")";
|
||||
sed -i "${qq_cookie_line}d" "/usr/share/unblockneteasemusic/core/src/provider/qq.js";
|
||||
sed -i -e "${qq_cookie_line}i \\\t'cookie': '${qq_cookie}'" "/usr/share/unblockneteasemusic/core/src/provider/qq.js";
|
||||
}
|
||||
[ -n "${youtube_key}" ] && {
|
||||
sed -i '/const key = /d' "/usr/share/unblockneteasemusic/core/src/provider/youtube.js";
|
||||
sed -i -e "1i const key = '${youtube_key}'" "/usr/share/unblockneteasemusic/core/src/provider/youtube.js";
|
||||
}
|
||||
|
||||
{ [ -f "${self_issue_cert_crt}" ] && [ "${self_issue_cert_crt}" != "/usr/share/unblockneteasemusic/core/server.crt" ]; } && { ln -sf "${self_issue_cert_crt}" "/usr/share/unblockneteasemusic/core/server.crt"; sed -i "#${self_issue_cert_crt}#d"; echo "${self_issue_cert_crt}" >> "/etc/sysupgrade.conf"; }
|
||||
{ [ -f "${self_issue_cert_key}" ] && [ "${self_issue_cert_key}" != "/usr/share/unblockneteasemusic/core/server.key" ]; } && { ln -sf "${self_issue_cert_key}" "/usr/share/unblockneteasemusic/core/server.key"; sed -i "#${self_issue_cert_key}#d"; echo "${self_issue_cert_key}" >> "/etc/sysupgrade.conf"; }
|
||||
|
||||
[ "${hijack_ways}" = "use_hosts" ] && { http_port="80"; https_port="443"; }
|
||||
if [ "${music_source}" = "default" ]; then
|
||||
nohup node "/usr/share/unblockneteasemusic/core/app.js" -a "${addr}" -p "${http_port}":"${https_port}" -e "${endpoint_url}" ${netease_server_ip} ${proxy_server_ip} ${strict_mode} >> "/tmp/unblockneteasemusic.log" 2>&1 &
|
||||
nohup env ${flag_arg} node "/usr/share/unblockneteasemusic/core/app.js" -a "${addr}" -p "${http_port}":"${https_port}" -e "${endpoint_url}" ${netease_server_ip} ${proxy_server_ip} ${strict_mode} >> "/tmp/unblockneteasemusic.log" 2>&1 &
|
||||
else
|
||||
nohup node "/usr/share/unblockneteasemusic/core/app.js" -a "${addr}" -p "${http_port}":"${https_port}" -o "${music_source}" -e "${endpoint_url}" ${netease_server_ip} ${proxy_server_ip} ${strict_mode} >> "/tmp/unblockneteasemusic.log" 2>&1 &
|
||||
nohup env ${flag_arg} node "/usr/share/unblockneteasemusic/core/app.js" -a "${addr}" -p "${http_port}":"${https_port}" -o ${music_source} -e "${endpoint_url}" ${netease_server_ip} ${proxy_server_ip} ${strict_mode} >> "/tmp/unblockneteasemusic.log" 2>&1 &
|
||||
fi
|
||||
|
||||
set_type="start"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user