luci-app-unblockmusic: support iOS 13 and NeteaseMusic new version https protocal

This commit is contained in:
LEAN-ESX 2019-10-29 00:05:19 -07:00
parent 3c5b1e1455
commit e3cc276ff6
2 changed files with 31 additions and 6 deletions

View File

@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-unblockmusic
PKG_VERSION:=2.2.0
PKG_RELEASE:=3
PKG_RELEASE:=5
PKG_LICENSE:=Apache-2.0
@ -19,7 +19,7 @@ LUCI_TITLE:=LuCI support for Unblock NeteaseCloudMusic
LUCI_DEPENDS:=+UnblockNeteaseMusic +bash +dnsmasq-full +ipset
LUCI_PKGARCH:=all
PKG_MAINTAINER:=<https://github.com/maxlicheng/luci-app-unblockmusic>
PKG_MAINTAINER:=lean
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -1,6 +1,6 @@
mp = Map("unblockmusic", translate("解锁网易云灰色歌曲"))
mp.description = translate("原理:采用 [QQ/虾米/百度/酷狗/酷我/咕咪/JOOX]等音源 替换网易云变灰歌曲链接<br />具体使用方法可查看github<br />https://github.com/maxlicheng/luci-app-unblockmusic")
mp.description = translate("采用 [QQ/虾米/百度/酷狗/酷我/咕咪/JOOX]等音源,替换网易云变灰歌曲链接")
mp:section(SimpleSection).template = "unblockmusic/unblockmusic_status"
@ -11,7 +11,7 @@ s.addremove=false
enabled = s:option(Flag, "enabled", translate("启用解锁"))
enabled.default = 0
enabled.rmempty = false
enabled.description = translate("启用后,路由器自动分流解锁,大部分设备无需设置代理。<br />苹果系列设备需要设置 WIFI/有线代理方式为自动即可")
enabled.description = translate("启用后,路由器自动分流解锁,大部分设备无需设置代理。<br />苹果系列设备需要设置 WIFI/有线代理方式为 自动 ,并安装 CA根证书并信任。")
speedtype = s:option(ListValue, "musicapptype", translate("音源选择"))
speedtype:value("default", translate("默认"))
@ -24,9 +24,34 @@ speedtype:value("kuwo", translate("酷我音乐(高音质推荐)"))
speedtype:value("migu", translate("咕咪音乐"))
speedtype:value("joox", translate("JOOX音乐"))
endpoint = s:option(Value, "endpoint", translate("转发音源"))
endpoint = s:option(Value, "endpoint", translate("转发HTTPS音源地址"))
endpoint.default = "https://music.163.com"
endpoint.rmempty = true
endpoint.description = translate("自定义转发音源<br />针对苹果系统设置请参考https://github.com/nondanee/UnblockNeteaseMusic/issues/65")
endpoint.description = translate("默认为 https://music.163.com")
o = s:option(Button,"certificate",translate("HTTPS 证书"))
o.inputtitle = translate("下载 CA 根证书")
o.description = translate("iOS 13 系统需要在“设置 -> 通用 -> 关于本机 -> 证书信任设置” 中,信任 UnblockNeteaseMusic Root CA )")
o.inputstyle = "reload"
o.write = function()
Download()
end
function Download()
local t,e
t=nixio.open("/usr/share/UnblockNeteaseMusic/ca.crt","r")
luci.http.header('Content-Disposition','attachment; filename="ca.crt"')
luci.http.prepare_content("application/octet-stream")
while true do
e=t:read(nixio.const.buffersize)
if(not e)or(#e==0)then
break
else
luci.http.write(e)
end
end
t:close()
luci.http.close()
end
return mp