1
0
mirror of https://github.com/kenzok8/small-package synced 2025-09-20 19:11:30 +08:00

update-11.29

This commit is contained in:
github-actions[bot]
2021-11-29 20:30:58 +08:00
parent 687275ac7b
commit a6c7cdbfbd
14 changed files with 312 additions and 92 deletions

View File

@ -7,7 +7,10 @@
# 警告:对着屏幕的哥们,我们允许你使用此脚本,但不允许你抹去作者的信息,请保留这段话。
#
[ "$(uci -q get ksmbd.@globals[0].autoshare)" == "1" ] && exit 0;
[ "$(uci -q get ksmbd.@globals[0].autoshare)" == "1" ] && {
/etc/init.d/ksmbd restart
exit 0;
}
. /lib/functions.sh
. /lib/functions/service.sh

View File

@ -7,7 +7,10 @@
# 警告:对着屏幕的哥们,我们允许你使用此脚本,但不允许你抹去作者的信息,请保留这段话。
#
[ "$(uci -q get samba4.@samba[0].autoshare)" == "1" ] && exit 0;
[ "$(uci -q get samba4.@samba[0].autoshare)" == "1" ] && {
/etc/init.d/samba4 restart
exit 0;
}
. /lib/functions.sh
. /lib/functions/service.sh

View File

@ -54,7 +54,7 @@ e.default = 1
e = t:option(MultiValue, "koolproxy_rules", translate("内置规则"))
e.optional = false
e.rmempty = false
e.rmempty = true
e:value("koolproxy.txt", translate("静态规则"))
e:value("daily.txt", translate("每日规则"))
e:value("kp.dat", translate("视频规则"))
@ -62,7 +62,7 @@ e:value("user.txt", translate("自定义规则"))
e = t:option(MultiValue, "thirdparty_rules", translate("第三方规则"))
e.optional = false
e.rmempty = false
e.rmempty = true
e:value("adg.txt", translate("AdGuard规则"))
e:value("steven.txt", translate("Steven规则"))
e:value("yhosts.txt", translate("Yhosts规则"))

View File

@ -4,7 +4,27 @@ local dsp = require "luci.dispatcher"
-%>
#display{
display: flex;
padding: 10px;
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-pack: center;
-webkit-box-align: center;
display: -moz-box;
-moz-box-orient: horizontal;
-moz-box-pack: center;
-moz-box-align: center;
display: -o-box;
-o-box-orient: horizontal;
-o-box-pack: center;
-o-box-align: center;
display: -ms-box;
-ms-box-orient: horizontal;
-ms-box-pack: center;
-ms-box-align: center;
display: box;
box-orient: horizontal;
box-pack: center;
box-align: center;
}
table.imagetable {
@ -14,6 +34,7 @@ table.imagetable {
border-width: 1px;
border-color: #999999;
border-collapse: collapse;
padding-top:10px;
}
<!--
table.imagetable th {
@ -34,7 +55,7 @@ table.imagetable td {
<script type="text/javascript" src="<%=resource%>/echarts.min.js"></script>
<script type="text/javascript" src="<%=resource%>/echarts.min.js?v=5.0"></script>
<script type="text/javascript">//<![CDATA[
window.onload =function(){
@ -297,7 +318,7 @@ table.imagetable td {
hostname=st[i].hostname;
}
var tr = tb.insertRow(-1);
//tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
tr.className = 'tr cbi-rowstyle-' + ((i % 2) + 1);
tr.insertCell(-1).innerHTML = st[i].appname;
tr.insertCell(-1).innerHTML = hostname;
tr.insertCell(-1).innerHTML = st[i].mac;
@ -320,6 +341,11 @@ table.imagetable td {
tr.insertCell(-1).innerHTML = total_time_str;
tr.insertCell(-1).innerHTML = action_status;
var childs = tr.childNodes;
Array.prototype.forEach.call(childs,function(child){
child.className = 'td';
});
}
}
@ -329,23 +355,23 @@ table.imagetable td {
//]]></script>
<fieldset class="cbi-section">
<div class="cbi-section cbi-tblsection">
<div id="display">
<div id="main" style="width: 500px;height:300px;"></div>
<div id="main2" style="width: 400px;height:300px;"></div>
<div id="main" style="min-width: 600px;height:300px;"></div>
<div id="main2" style="min-width: 600px;height:300px;"></div>
</div>
<table class="imagetable" id="user_status_table">
<tr>
<th ><%:App Name%></th>
<th ><%:Hostname%></th>
<th ><%:Mac%></th>
<th><%:Start Time%></th>
<th><%:Visit Time%></th>
<th><%:Filter Status%></th>
<table class="table cbi-section-table" id="user_status_table">
<tr class="tr table-titles">
<th class="th"><%:App Name%></th>
<th class="th"><%:Hostname%></th>
<th class="th"><%:Mac%></th>
<th class="th"><%:Start Time%></th>
<th class="th"><%:Visit Time%></th>
<th class="th"><%:Filter Status%></th>
</tr>
<tr>
<td colspan="8"><em><br /><%:Collecting data...%></em></td>
<tr class="tr table-titles">
<td class="td" colspan="8"><em><br /><%:Collecting data...%></em></td>
</tr>
</table>
</fieldset>
</div>

View File

@ -1,32 +1,6 @@
<style type="text/css">
<%
local dsp = require "luci.dispatcher"
-%>
table.imagetable {
font-family: verdana,arial,sans-serif;
font-size:11px;
color:#333333;
border-width: 1px;
border-color: #999999;
border-collapse: collapse;
}
<!--
table.imagetable th {
background:#f5f5f5
border-width: 0px;
padding: 5px;
border-style: solid;
border-color: #999999;
}
table.imagetable td {
background:#ffffffff
border-width: 0px;
padding: 5px;
border-style: solid;
border-color: #999999;
}-->
</style>
<script type="text/javascript">//<![CDATA[
XHR.poll(5, '<%=url('admin/network/dev_app_status')%>', null,
function(x, st)
@ -48,7 +22,7 @@ table.imagetable td {
hostname=devlist[i].hostname;
}
var tr = tb.insertRow(-1);
//tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
tr.className = 'tr cbi-rowstyle-' + ((i % 2) + 1);
tr.insertCell(-1).innerHTML = i + 1;
tr.insertCell(-1).innerHTML = hostname;
tr.insertCell(-1).innerHTML = "<a href='<%=url('admin/network/appfilter/')%>"+devlist[i].mac+"'>"+devlist[i].mac+"</a>";
@ -64,10 +38,16 @@ table.imagetable td {
app_list_str="--"
}
tr.insertCell(-1).innerHTML = app_list_str;
if (devlist[i].online == 1)
if (devlist[i].online == 1){
tr.insertCell(-1).innerHTML = "<%:Online%>";
else
}else{
tr.insertCell(-1).innerHTML = "<%:Offline%>";
}
var childs = tr.childNodes;
Array.prototype.forEach.call(childs,function(child){
child.className = 'td';
});
}
}
}
@ -76,19 +56,19 @@ table.imagetable td {
//]]></script>
<fieldset class="cbi-section">
<legend><%:Client List%></legend>
<table class="imagetable" id="user_status_table">
<tr>
<th ><%:Id%></th>
<th ><%:Hostname%></th>
<th ><%:Mac%></th>
<th ><%:Ip%></th>
<th><%:Common App(TOP5)%></th>
<th><%:Online Status%></th>
<div class="cbi-section cbi-tblsection">
<h3><%:Client List%></h3>
<table class="table cbi-section-table" id="user_status_table">
<tr class="tr table-titles">
<th class="th"><%:Id%></th>
<th class="th"><%:Hostname%></th>
<th class="th"><%:Mac%></th>
<th class="th"><%:Ip%></th>
<th class="th"><%:Common App(TOP5)%></th>
<th class="th"><%:Online Status%></th>
</tr>
<tr>
<td colspan="8"><em><br /><%:Collecting data...%></em></td>
<tr class="tr">
<td class="td" colspan="8"><em><br /><%:Collecting data...%></em></td>
</tr>
</table>
</fieldset>
</div>

View File

@ -969,7 +969,7 @@ function action_refresh_log()
line_trans = line
ex_match = false
while true do
ex_keys = {"^Sec%-Fetch%-Mode", "^User%-Agent", "^Access%-Control", "^Accept", "^Origin", "^Referer", "^Connection"}
ex_keys = {"^Sec%-Fetch%-Mode", "^User%-Agent", "^Access%-Control", "^Accept", "^Origin", "^Referer", "^Connection", "^Pragma", "^Cache-"}
for key=1, #ex_keys do
if string.find (line, ex_keys[key]) then
ex_match = true

View File

@ -452,7 +452,7 @@ o:depends("netflix_domains_prefetch", "1")
o.template = "openclash/download_netflix_domains"
o = s:taboption("stream_enhance", Flag, "stream_auto_select", font_red..bold_on..translate("Auto Select Unlock Proxy")..bold_off..font_off)
o.description = translate("Auto Select Proxy For Streaming Unlock, Support Netflix and Disney Plus")
o.description = translate("Auto Select Proxy For Streaming Unlock, Support Netflix, Disney Plus, HBO And YouTube Premium")
o.default=0
o = s:taboption("stream_enhance", Value, "stream_auto_select_interval", translate("Auto Select Interval(min)"))
@ -476,7 +476,7 @@ o.description = translate("It Will Be Searched According To The Keywords When Au
o:depends("stream_auto_select_netflix", "1")
o = s:taboption("stream_enhance", Flag, "stream_auto_select_disney", translate("Disney Plus Auto Select"))
o.default=1
o.default=0
o:depends("stream_auto_select", "1")
o = s:taboption("stream_enhance", Value, "stream_auto_select_group_key_disney", translate("Disney Plus Group Filter Keywords"))
@ -485,6 +485,26 @@ o.placeholder = "Disney|迪士尼"
o.description = translate("It Will Be Searched According To The Keywords When Auto Search Group Fails")
o:depends("stream_auto_select_disney", "1")
o = s:taboption("stream_enhance", Flag, "stream_auto_select_hbo", translate("HBO Auto Select"))
o.default=0
o:depends("stream_auto_select", "1")
o = s:taboption("stream_enhance", Value, "stream_auto_select_group_key_hbo", translate("HBO Group Filter Keywords"))
o.default = "HBO"
o.placeholder = "HBO"
o.description = translate("It Will Be Searched According To The Keywords When Auto Search Group Fails")
o:depends("stream_auto_select_hbo", "1")
o = s:taboption("stream_enhance", Flag, "stream_auto_select_ytb", translate("YouTube Premium Auto Select"))
o.default=0
o:depends("stream_auto_select", "1")
o = s:taboption("stream_enhance", Value, "stream_auto_select_group_key_ytb", translate("YouTube Premium Group Filter Keywords"))
o.default = "YouTube|油管"
o.placeholder = "YouTube|油管"
o.description = translate("It Will Be Searched According To The Keywords When Auto Search Group Fails")
o:depends("stream_auto_select_ytb", "1")
---- update Settings
o = s:taboption("rules_update", Flag, "other_rule_auto_update", translate("Auto Update"))
o.description = font_red..bold_on..translate("Auto Update Other Rules")..bold_off..font_off

View File

@ -2453,8 +2453,8 @@ msgstr "流媒体增强"
msgid "Auto Select Unlock Proxy"
msgstr "自动选择解锁节点"
msgid "Auto Select Proxy For Streaming Unlock, Support Netflix and Disney Plus"
msgstr "自动 NetflixDisney Plus 选择解锁节点"
msgid "Auto Select Proxy For Streaming Unlock, Support Netflix, Disney Plus, HBO And YouTube Premium"
msgstr "自动选择解锁节点,支持 NetflixDisney Plus、HBO 和 YouTube Premium"
msgid "Auto Select Interval(min)"
msgstr "自动选择(检测)间隔(分钟)"
@ -2471,18 +2471,39 @@ msgstr "Netflix 策略组筛选关键字"
msgid "Disney Plus Group Filter Keywords"
msgstr "Disney Plus 策略组筛选关键字"
msgid "HBO Group Filter Keywords"
msgstr "HBO 策略组筛选关键字"
msgid "YouTube Premium Group Filter Keywords"
msgstr "YouTube Premium 策略组筛选关键字"
msgid "Tip: Start Auto Select Proxy For Netflix Unlock..."
msgstr "提示开始自动选择检测Netflix 解锁节点..."
msgid "Tip: Start Auto Select Proxy For Disney Plus Unlock..."
msgstr "提示开始自动选择检测Disney Plus 解锁节点..."
msgid "Tip: Start Auto Select Proxy For HBO Unlock..."
msgstr "提示开始自动选择检测HBO 解锁节点..."
msgid "Tip: Start Auto Select Proxy For YouTube Premium Unlock..."
msgstr "提示开始自动选择检测YouTube Premium 解锁节点..."
msgid "Netflix Group:"
msgstr "Netflix 策略组:"
msgid "Disney Group:"
msgstr "Disney 策略组:"
msgid "HBO Group:"
msgstr "HBO 策略组:"
msgid "YouTube Premium Group:"
msgstr "YouTube Premium 策略组:"
msgid "full support"
msgstr "完整解锁"
msgid "full support, area:"
msgstr "完整解锁,区域:"
@ -2511,10 +2532,25 @@ msgid "unlock test faild! start auto select unlock proxy..."
msgstr "解锁检测失败!开始进行解锁节点自动选择..."
msgid "It Will Be Searched According To The Keywords When Auto Search Group Fails"
msgstr "策略组自动搜索失败时将会根据关键字进行搜索"
msgstr "策略组自动获取失败时将会根据关键字进行匹配"
msgid "Netflix Auto Select"
msgstr "Netflix 自动选择"
msgid "Disney Plus Auto Select"
msgstr "Disney Plus 自动选择"
msgid "HBO Auto Select"
msgstr "HBO 自动选择"
msgid "YouTube Premium Auto Select"
msgstr "YouTube Premium 自动选择"
msgid "not support Premium!"
msgstr "不支持 Premium"
msgid "not support Premium! the type of group is not select, auto select could not work!"
msgstr "不支持 Premium当前策略组类型非 Select无法进行自动选择"
msgid "not support Premium! start auto select unlock proxy..."
msgstr "不支持 Premium开始进行解锁节点自动选择..."

View File

@ -2013,6 +2013,7 @@ get_config()
dns_port=$(uci -q get openclash.config.dns_port)
tolerance=$(uci -q get openclash.config.tolerance)
custom_fallback_filter=$(uci -q get openclash.config.custom_fallback_filter)
netflix_domains_prefetch=$(uci -q get openclash.config.netflix_domains_prefetch || echo 0)
append_wan_dns=$(uci -q get openclash.config.append_wan_dns || echo 1)
store_fakeip=$(uci -q get openclash.config.store_fakeip || echo 1)
_koolshare=$(cat /usr/lib/os-release 2>/dev/null |grep OPENWRT_RELEASE 2>/dev/null |grep -i koolshare 2>/dev/null)
@ -2048,7 +2049,7 @@ start()
config_foreach yml_auth_get "authentication"
yml_auth_custom "$CONFIG_FILE"
yml_dns_custom "$enable_custom_dns" "$CONFIG_FILE" "$append_wan_dns" "$ipv6_dns"
/usr/share/openclash/yml_change.sh 2>/dev/null "$LOGTIME" "$en_mode" "$enable_custom_dns" "$da_password" "$cn_port" "$proxy_port" "$CONFIG_FILE" "$ipv6_enable" "$http_port" "$socks_port" "$lan_ip" "$log_level" "$proxy_mode" "$intranet_allowed" "$en_mode_tun" "$stack_type" "$dns_port" "$core_type" "$mixed_port" "$tproxy_port" "$ipv6_dns" "$store_fakeip"
/usr/share/openclash/yml_change.sh 2>/dev/null "$LOGTIME" "$en_mode" "$enable_custom_dns" "$da_password" "$cn_port" "$proxy_port" "$CONFIG_FILE" "$ipv6_enable" "$http_port" "$socks_port" "$lan_ip" "$log_level" "$proxy_mode" "$intranet_allowed" "$en_mode_tun" "$stack_type" "$dns_port" "$core_type" "$mixed_port" "$tproxy_port" "$ipv6_dns" "$store_fakeip" "$netflix_domains_prefetch"
/usr/share/openclash/yml_rules_change.sh 2>/dev/null "$LOGTIME" "$rule_source" "$enable_custom_clash_rules" "$CONFIG_FILE" "$enable_rule_proxy" "$CONFIG_NAME"
yml_custom_rule_provider
yml_game_custom

View File

@ -107,6 +107,8 @@ swdist.apple.com
#Google
lens.l.google.com
stun.l.google.com
#Netflix
+.nflxvideo.net
#FinalFantasy XIV
*.square-enix.com
*.finalfantasyxiv.com

View File

@ -19,7 +19,7 @@ if enable == 0 then os.exit(0) end
if not type then os.exit(0) end
function unlock_auto_select()
local key_group, region, now, proxy, group_match, proxy_default, auto_get_group, info
local key_group, region, now, proxy, group_match, proxy_default, auto_get_group, info, group_now
local port = uci:get("openclash", "config", "cn_port")
local passwd = uci:get("openclash", "config", "dashboard_password") or ""
local ip = luci.sys.exec("uci -q get network.lan.ipaddr |awk -F '/' '{print $1}' 2>/dev/null |tr -d '\n'")
@ -27,13 +27,17 @@ function unlock_auto_select()
local key_groups = {}
local tested_proxy = {}
local gorup_i18 = "Group:"
local hbo_full_support = "full support"
local full_support = "full support, area:"
local only_original = "only support homemade!"
local ytb_no_pre = "not support Premium!"
local test_faild = "unlock test faild!"
local test_start = "Start auto select unlock proxy..."
local original_no_select = "only support homemade! the type of group is not select, auto select could not work!"
local ytb_no_select = "not support Premium! the type of group is not select, auto select could not work!"
local faild_no_select = "unlock test faild! the type of group is not select, auto select could not work!"
local original_test_start = "only support homemade! start auto select unlock proxy..."
local ytb_test_start = "not support Premium! start auto select unlock proxy..."
local faild_test_start = "unlock test faild! start auto select unlock proxy..."
if not ip or ip == "" then
@ -58,6 +62,10 @@ function unlock_auto_select()
luci.sys.call('curl -sL --limit-rate 5k https://www.netflix.com >/dev/null 2>&1 &')
elseif type == "Disney" then
luci.sys.call('curl -sL --limit-rate 5k https://www.disneyplus.com >/dev/null 2>&1 &')
elseif type == "HBO" then
luci.sys.call('curl -sL --limit-rate 5k https://play.hbonow.com >/dev/null 2>&1 &')
elseif type == "YouTube Premium" then
luci.sys.call('curl -sL --limit-rate 5k https://m.youtube.com/premium >/dev/null 2>&1 &')
end
os.execute("sleep 1")
local con = luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://%s:%s/connections', passwd, ip, port))
@ -76,6 +84,16 @@ function unlock_auto_select()
auto_get_group = con.connections[i].chains[#(con.connections[i].chains)]
break
end
elseif type == "HBO" then
if string.match(con.connections[i].metadata.host, "play%.hbonow%.com") then
auto_get_group = con.connections[i].chains[#(con.connections[i].chains)]
break
end
elseif type == "YouTube Premium" then
if string.match(con.connections[i].metadata.host, "m%.youtube%.com") then
auto_get_group = con.connections[i].chains[#(con.connections[i].chains)]
break
end
end
end
end
@ -85,6 +103,10 @@ function unlock_auto_select()
key_group = uci:get("openclash", "config", "stream_auto_select_group_key_netflix") or "netflix|奈飞"
elseif type == "Disney" then
key_group = uci:get("openclash", "config", "stream_auto_select_group_key_disney") or "disney|迪士尼"
elseif type == "HBO" then
key_group = uci:get("openclash", "config", "stream_auto_select_group_key_hbo") or "hbo"
elseif type == "YouTube Premium" then
key_group = uci:get("openclash", "config", "stream_auto_select_group_key_ytb") or "YouTobe|油管"
end
string.gsub(key_group, '[^%|]+', function(w) table.insert(key_groups, w) end)
if #key_groups == 0 then table.insert(key_groups, type) end
@ -114,15 +136,27 @@ function unlock_auto_select()
group_match = true
--test now proxy
region = proxy_unlock_test()
now = os.date("%Y-%m-%d %H:%M:%S").." "..type.." "..gorup_i18..""..group_show..""..now_name..""
if table_include(groups, now_name) then
now = os.date("%Y-%m-%d %H:%M:%S").." "..type.." "..gorup_i18..""..group_show..""
else
now = os.date("%Y-%m-%d %H:%M:%S").." "..type.." "..gorup_i18..""..group_show..""..now_name..""
end
if status ~= 2 then
region = proxy_unlock_test()
end
if status == 2 then
print(now..full_support..""..region.."")
if type ~= "HBO" then
print(now..full_support..""..region.."")
else
print(now..hbo_full_support)
end
break
elseif status == 1 then
print(now..original_test_start)
if type ~= "YouTube Premium" then
print(now..original_test_start)
else
print(now..ytb_test_start)
end
else
print(now..faild_test_start)
end
@ -144,7 +178,12 @@ function unlock_auto_select()
end
for p = 1, #(proxies) do
proxy = proxies[p]
now = os.date("%Y-%m-%d %H:%M:%S").." "..type.." "..gorup_i18..""..group_show..""..proxy..""
if table_include(groups, proxy) then
group_now = get_group_now(info, proxy)
now = os.date("%Y-%m-%d %H:%M:%S").." "..type.." "..gorup_i18..""..group_show..""..group_now..""
else
now = os.date("%Y-%m-%d %H:%M:%S").." "..type.." "..gorup_i18..""..group_show..""..proxy..""
end
--skip tested proxy
while true do
if table_include(tested_proxy, proxy) then
@ -159,10 +198,18 @@ function unlock_auto_select()
luci.sys.exec(string.format("curl -sL -m 3 --retry 2 -w %%{http_code} -o /dev/null -H 'Authorization: Bearer %s' -H 'Content-Type:application/json' -X PUT -d '{\"name\":\"%s\"}' http://%s:%s/proxies/%s", passwd, proxy, ip, port, urlencode(group_name)))
region = proxy_unlock_test()
if status == 2 then
print(now..full_support..""..region.."")
if type ~= "HBO" then
print(now..full_support..""..region.."")
else
print(now..hbo_full_support)
end
elseif status == 1 then
table.insert(original, {group_name, proxy})
print(now..only_original)
if type ~= "YouTube Premium" then
table.insert(original, {group_name, proxy})
print(now..only_original)
else
print(now..ytb_no_pre)
end
else
print(now..test_faild)
end
@ -188,12 +235,24 @@ function unlock_auto_select()
table.insert(tested_proxy, now_name)
end
region = proxy_unlock_test()
now = os.date("%Y-%m-%d %H:%M:%S").." "..type.." "..gorup_i18..""..group_show..""..now_name..""
if table_include(groups, now_name) then
now = os.date("%Y-%m-%d %H:%M:%S").." "..type.." "..gorup_i18..""..group_show..""
else
now = os.date("%Y-%m-%d %H:%M:%S").." "..type.." "..gorup_i18..""..group_show..""..now_name..""
end
if status == 2 then
print(now..full_support..""..region.."")
if type ~= "HBO" then
print(now..full_support..""..region.."")
else
print(now..hbo_full_support)
end
elseif status == 1 then
table.insert(original, {group_name, value.all[i]})
print(now..original_no_select)
if type ~= "YouTube Premium" then
table.insert(original, {group_name, value.all[i]})
print(now..original_no_select)
else
print(now..ytb_no_select)
end
else
print(now..faild_no_select)
end
@ -219,10 +278,18 @@ function unlock_auto_select()
else
region = proxy_unlock_test()
if status == 2 then
print(now..full_support..""..region.."")
if type ~= "HBO" then
print(now..full_support..""..region.."")
else
print(now..hbo_full_support)
end
break
elseif status == 1 then
print(now..original_no_select)
if type ~= "YouTube Premium" then
print(now..original_no_select)
else
print(now..ytb_no_select)
end
else
print(now..faild_no_select)
end
@ -241,6 +308,10 @@ function proxy_unlock_test()
region = netflix_unlock_test()
elseif type == "Disney" then
region = disney_unlock_test()
elseif type == "HBO" then
region = hbo_unlock_test()
elseif type == "YouTube Premium" then
region = ytb_unlock_test()
end
return region
end
@ -258,6 +329,19 @@ function table_include(table, value)
return false
end
function get_group_now(info, group)
if table_include(groups, group) then
while table_include(groups, group) do
for _, value in pairs(info.proxies) do
if value.name == group then
group = value.now
end
end
end
end
return group
end
function get_proxy(info, group, name)
--group maybe a proxy
proxies = {}
@ -314,7 +398,6 @@ function get_proxy(info, group, name)
for _, value in pairs(info.proxies) do
if value.name == name then
group_name = name
now_name = value.now
table.insert(proxies, group)
group_type = value.type
end
@ -331,6 +414,7 @@ function get_proxy(info, group, name)
group_show = name .. "" .. group
end
end
now_name = value.now
group = value.now
break
end
@ -371,6 +455,7 @@ function netflix_unlock_test()
status = 2
string.gsub(info.url_effective, '[^/]+', function(w) table.insert(result, w) end)
region = string.upper(string.match(result[3], "^%a+"))
if region == "TITLE" then region = "US" end
elseif info.http_code == 404 then
status = 1
else
@ -386,17 +471,17 @@ function disney_unlock_test()
local url2 = "https://www.disneyplus.com"
local headers = '-H "Accept-Language: en" -H "authorization: Bearer ZGlzbmV5JmJyb3dzZXImMS4wLjA.Cu56AgSfBTDag5NiRA81oLHkDZfu5L3CKadnefEAY84" -H "Content-Type: application/x-www-form-urlencoded"'
local auth = '"grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&latitude=0&longitude=0&platform=browser&subject_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJiNDAzMjU0NS0yYmE2LTRiZGMtOGFlOS04ZWI3YTY2NzBjMTIiLCJhdWQiOiJ1cm46YmFtdGVjaDpzZXJ2aWNlOnRva2VuIiwibmJmIjoxNjIyNjM3OTE2LCJpc3MiOiJ1cm46YmFtdGVjaDpzZXJ2aWNlOmRldmljZSIsImV4cCI6MjQ4NjYzNzkxNiwiaWF0IjoxNjIyNjM3OTE2LCJqdGkiOiI0ZDUzMTIxMS0zMDJmLTQyNDctOWQ0ZC1lNDQ3MTFmMzNlZjkifQ.g-QUcXNzMJ8DwC9JqZbbkYUSKkB1p4JGW77OON5IwNUcTGTNRLyVIiR8mO6HFyShovsR38HRQGVa51b15iAmXg&subject_token_type=urn%3Abamtech%3Aparams%3Aoauth%3Atoken-type%3Adevice"'
local httpcpde = luci.sys.exec(string.format("curl -sL -m 10 --retry 2 -o /dev/null -w %%{http_code} %s -H 'User-Agent: %s' -d %s -XPOST %s", headers, UA, auth, url))
local httpcode = luci.sys.exec(string.format("curl -sL -m 10 --retry 2 -o /dev/null -w %%{http_code} %s -H 'User-Agent: %s' -d %s -XPOST %s", headers, UA, auth, url))
local region
if tonumber(httpcpde) == 200 then
local url_effective = luci.sys.exec(string.format("curl -sL -m 10 --retry 2 -o /dev/null -w %%{url_effective} -H 'User-Agent: %s' %s", UA, url2))
if tonumber(httpcode) == 200 then
local url_effective = luci.sys.exec(string.format("curl -sL -m 10 --retry 2 -o /dev/null -w %%{url_effective} -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url2))
if url_effective == "https://disneyplus.disney.co.jp/" then
region = "JP"
return region
elseif string.find(url_effective,"hotstar") then
return "Unknow"
end
local region = luci.sys.exec(string.format("curl -sL -m 10 --retry 2 -H 'User-Agent: %s' %s |grep 'Region: ' |awk '{print $2}' |tr -d '\n'", UA, url2))
local region = luci.sys.exec(string.format("curl -sL -m 10 --retry 2 -H 'Content-Type: application/json' -H 'User-Agent: %s' %s |grep 'Region: ' |awk '{print $2}' |tr -d '\n'", UA, url2))
if region and region ~= "" then
status = 2
return region
@ -408,4 +493,50 @@ function disney_unlock_test()
end
end
function hbo_unlock_test()
status = 0
local url = "https://play.hbonow.com/"
local httpcode = luci.sys.exec(string.format("curl -sL -m 10 --retry 2 -o /dev/null -w %%{http_code} -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
if tonumber(httpcode) == 200 then
local url_effective = luci.sys.exec(string.format("curl -sL -m 10 --retry 2 -o /dev/null -w %%{url_effective} -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
if string.find(url_effective,"play%.hbonow%.com") then
status = 2
return
else
return
end
else
return
end
end
function ytb_unlock_test()
status = 0
local url = "https://m.youtube.com/premium"
local httpcode = luci.sys.exec(string.format("curl -sL -m 3 -o /dev/null -w %%{http_code} -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
local region
if tonumber(httpcode) == 200 then
local data = luci.sys.exec(string.format("curl -sL -m 3 -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
if string.find(data,"is not available in your country") then
status = 1
return "Unknow"
end
region = luci.sys.exec(string.format("curl -sL -m 3 -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s |awk -F ',\"GL\":' '{print $2}'|awk -F ',' '{print $1}' |sed 's/\"//g' |tr -d '\\n'", UA, url))
if region and region ~= "" then
status = 2
return region
else
if not string.find(data,"www%.google%.cn") then
status = 2
return "US"
else
status = 1
return "Unknow"
end
end
else
return "Unknow"
end
end
unlock_auto_select()

View File

@ -34,6 +34,8 @@ do
stream_auto_select_interval_now=$(uci -q get openclash.config.stream_auto_select_interval || echo 30)
stream_auto_select_netflix=$(uci -q get openclash.config.stream_auto_select_netflix || echo 0)
stream_auto_select_disney=$(uci -q get openclash.config.stream_auto_select_disney || echo 0)
stream_auto_select_hbo=$(uci -q get openclash.config.stream_auto_select_hbo || echo 0)
stream_auto_select_ytb=$(uci -q get openclash.config.stream_auto_select_ytb || echo 0)
enable=$(uci -q get openclash.config.enable)
if [ "$enable" -eq 1 ]; then
@ -129,7 +131,7 @@ fi
##Dler Cloud Checkin
/usr/share/openclash/openclash_dler_checkin.lua >/dev/null 2>&1
##NETFLIX_UNLOCK_CHECK
##STREAMING_UNLOCK_CHECK
if [ "$stream_auto_select" -eq 1 ]; then
[ "$stream_auto_select_interval" -ne "$stream_auto_select_interval_now" ] && STREAM_AUTO_SELECT=1 && stream_auto_select_interval="$stream_auto_select_interval_now"
if [ "$STREAM_AUTO_SELECT" -ne 0 ]; then
@ -142,6 +144,14 @@ fi
LOG_OUT "Tip: Start Auto Select Proxy For Disney Plus Unlock..."
/usr/share/openclash/openclash_streaming_unlock.lua "Disney" >> $LOG_FILE
fi
if [ "$stream_auto_select_hbo" -eq 1 ]; then
LOG_OUT "Tip: Start Auto Select Proxy For HBO Unlock..."
/usr/share/openclash/openclash_streaming_unlock.lua "HBO" >> $LOG_FILE
fi
if [ "$stream_auto_select_ytb" -eq 1 ]; then
LOG_OUT "Tip: Start Auto Select Proxy For YouTube Premium Unlock..."
/usr/share/openclash/openclash_streaming_unlock.lua "YouTube Premium" >> $LOG_FILE
fi
fi
fi
STREAM_AUTO_SELECT=$(expr "$STREAM_AUTO_SELECT" + 1)

View File

@ -153,6 +153,14 @@ if '$2' == 'fake-ip' then
Value['dns']['fake-ip-filter']=Value['dns']['fake-ip-filter'].uniq
end
end
if ${23} == 1 then
if Value['dns'].has_key?('fake-ip-filter') and not Value['dns']['fake-ip-filter'].to_a.empty? then
Value['dns']['fake-ip-filter'].insert(-1,'+.nflxvideo.net')
Value['dns']['fake-ip-filter']=Value['dns']['fake-ip-filter'].uniq
else
Value['dns'].merge!({'fake-ip-filter'=>['+.nflxvideo.net']})
end
end
end;
rescue Exception => e
puts '${LOGTIME} Error: Set Fake-IP-Filter Error,【' + e.message + '】'

View File

@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=shadowsocks-rust
PKG_VERSION:=1.12.3
PKG_VERSION:=1.12.4
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE_HEADER:=shadowsocks-v$(PKG_VERSION)
@ -69,7 +69,7 @@ define Package/shadowsocks-rust/Default
endef
endef
SHADOWSOCKS_COMPONENTS:=sslocal ssmanager ssserver ssurl
SHADOWSOCKS_COMPONENTS:=sslocal ssmanager ssserver ssurl ssservice
define shadowsocks-rust/templates
$(foreach component,$(SHADOWSOCKS_COMPONENTS),
$(call Package/shadowsocks-rust/Default,$(component))