mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-03 10:12:50 +00:00
Update subexport.cpp
GitHub CI / macOS ${{ matrix.arch }} Build (arm, subconverter_darwinarm, macos-14) (push) Waiting to run
GitHub CI / macOS ${{ matrix.arch }} Build (x86, subconverter_darwin64, macos-13) (push) Waiting to run
GitHub CI / Windows ${{ matrix.arch }} Build (amd64, subconverter_win64, x86_64, MINGW64) (push) Waiting to run
GitHub CI / Windows ${{ matrix.arch }} Build (x86, subconverter_win32, i686, MINGW32) (push) Waiting to run
GitHub CI / Linux ${{ matrix.arch }} Build (aarch64, subconverter_aarch64, ubuntu-latest) (push) Failing after 38s
GitHub CI / Linux ${{ matrix.arch }} Build (amd64, subconverter_linux64, ubuntu-latest) (push) Failing after 16s
GitHub CI / Linux ${{ matrix.arch }} Build (armv7, subconverter_armv7, ubuntu-latest) (push) Failing after 19s
GitHub CI / Linux ${{ matrix.arch }} Build (x86, subconverter_linux32, ubuntu-latest) (push) Failing after 22s
Publish Docker Image / Build ${{ matrix.platform }} Image (ubuntu-latest, linux/386) (push) Failing after 6m49s
Publish Docker Image / Build ${{ matrix.platform }} Image (ubuntu-latest, linux/arm/v7) (push) Has been cancelled
Publish Docker Image / Build ${{ matrix.platform }} Image (ubuntu-latest, linux/arm64) (push) Has been cancelled
Publish Docker Image / Merge (push) Has been cancelled
Publish Docker Image / Build ${{ matrix.platform }} Image (ubuntu-latest, linux/amd64) (push) Has been cancelled
GitHub CI / macOS ${{ matrix.arch }} Build (arm, subconverter_darwinarm, macos-14) (push) Waiting to run
GitHub CI / macOS ${{ matrix.arch }} Build (x86, subconverter_darwin64, macos-13) (push) Waiting to run
GitHub CI / Windows ${{ matrix.arch }} Build (amd64, subconverter_win64, x86_64, MINGW64) (push) Waiting to run
GitHub CI / Windows ${{ matrix.arch }} Build (x86, subconverter_win32, i686, MINGW32) (push) Waiting to run
GitHub CI / Linux ${{ matrix.arch }} Build (aarch64, subconverter_aarch64, ubuntu-latest) (push) Failing after 38s
GitHub CI / Linux ${{ matrix.arch }} Build (amd64, subconverter_linux64, ubuntu-latest) (push) Failing after 16s
GitHub CI / Linux ${{ matrix.arch }} Build (armv7, subconverter_armv7, ubuntu-latest) (push) Failing after 19s
GitHub CI / Linux ${{ matrix.arch }} Build (x86, subconverter_linux32, ubuntu-latest) (push) Failing after 22s
Publish Docker Image / Build ${{ matrix.platform }} Image (ubuntu-latest, linux/386) (push) Failing after 6m49s
Publish Docker Image / Build ${{ matrix.platform }} Image (ubuntu-latest, linux/arm/v7) (push) Has been cancelled
Publish Docker Image / Build ${{ matrix.platform }} Image (ubuntu-latest, linux/arm64) (push) Has been cancelled
Publish Docker Image / Merge (push) Has been cancelled
Publish Docker Image / Build ${{ matrix.platform }} Image (ubuntu-latest, linux/amd64) (push) Has been cancelled
This commit is contained in:
1 parent
75a7b1c84c
commit
3971468034
1 file changed
+22
-38
@@ -662,7 +662,8 @@ proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGroupCo
|
|||||||
yamlnode["Proxy"] = proxies;
|
yamlnode["Proxy"] = proxies;
|
||||||
|
|
||||||
|
|
||||||
for (const ProxyGroupConfig &x: extra_proxy_group) {
|
for(const ProxyGroupConfig &x : extra_proxy_group)
|
||||||
|
{
|
||||||
YAML::Node singlegroup;
|
YAML::Node singlegroup;
|
||||||
string_array filtered_nodelist;
|
string_array filtered_nodelist;
|
||||||
|
|
||||||
@@ -672,27 +673,8 @@ proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGroupCo
|
|||||||
else
|
else
|
||||||
singlegroup["type"] = x.TypeStr();
|
singlegroup["type"] = x.TypeStr();
|
||||||
|
|
||||||
switch (x.Type) {
|
switch(x.Type)
|
||||||
case ProxyGroupType::Select:
|
{
|
||||||
case ProxyGroupType::Relay:
|
|
||||||
break;
|
|
||||||
case ProxyGroupType::LoadBalance:
|
|
||||||
singlegroup["strategy"] = x.StrategyStr();
|
|
||||||
[[fallthrough]];
|
|
||||||
case ProxyGroupType::URLTest:
|
|
||||||
if (!x.Lazy.is_undef())
|
|
||||||
singlegroup["lazy"] = x.Lazy.get();
|
|
||||||
[[fallthrough]];
|
|
||||||
case ProxyGroupType::Fallback:
|
|
||||||
singlegroup["url"] = x.Url;
|
|
||||||
if (x.Interval > 0)
|
|
||||||
singlegroup["interval"] = x.Interval;
|
|
||||||
if (x.Tolerance > 0)
|
|
||||||
singlegroup["tolerance"] = x.Tolerance;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
continue;
|
|
||||||
switch (x.Type) {
|
|
||||||
case ProxyGroupType::Select:
|
case ProxyGroupType::Select:
|
||||||
case ProxyGroupType::Relay:
|
case ProxyGroupType::Relay:
|
||||||
break;
|
break;
|
||||||
@@ -702,57 +684,59 @@ proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGroupCo
|
|||||||
case ProxyGroupType::Smart:
|
case ProxyGroupType::Smart:
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
case ProxyGroupType::URLTest:
|
case ProxyGroupType::URLTest:
|
||||||
if (!x.Lazy.is_undef())
|
if(!x.Lazy.is_undef())
|
||||||
singlegroup["lazy"] = x.Lazy.get();
|
singlegroup["lazy"] = x.Lazy.get();
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
case ProxyGroupType::Fallback:
|
case ProxyGroupType::Fallback:
|
||||||
singlegroup["url"] = x.Url;
|
singlegroup["url"] = x.Url;
|
||||||
if (x.Interval > 0)
|
if(x.Interval > 0)
|
||||||
singlegroup["interval"] = x.Interval;
|
singlegroup["interval"] = x.Interval;
|
||||||
if (x.Tolerance > 0)
|
if(x.Tolerance > 0)
|
||||||
singlegroup["tolerance"] = x.Tolerance;
|
singlegroup["tolerance"] = x.Tolerance;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!x.DisableUdp.is_undef())
|
if(!x.DisableUdp.is_undef())
|
||||||
singlegroup["disable-udp"] = x.DisableUdp.get();
|
singlegroup["disable-udp"] = x.DisableUdp.get();
|
||||||
|
|
||||||
for (const auto &y: x.Proxies)
|
for(const auto& y : x.Proxies)
|
||||||
groupGenerate(y, nodelist, filtered_nodelist, true, ext);
|
groupGenerate(y, nodelist, filtered_nodelist, true, ext);
|
||||||
|
|
||||||
if (!x.UsingProvider.empty())
|
if(!x.UsingProvider.empty())
|
||||||
singlegroup["use"] = x.UsingProvider;
|
singlegroup["use"] = x.UsingProvider;
|
||||||
else {
|
else
|
||||||
if (filtered_nodelist.empty())
|
{
|
||||||
|
if(filtered_nodelist.empty())
|
||||||
filtered_nodelist.emplace_back("DIRECT");
|
filtered_nodelist.emplace_back("DIRECT");
|
||||||
}
|
}
|
||||||
if (!filtered_nodelist.empty())
|
if(!filtered_nodelist.empty())
|
||||||
singlegroup["proxies"] = filtered_nodelist;
|
singlegroup["proxies"] = filtered_nodelist;
|
||||||
if (group_block)
|
if(group_block)
|
||||||
singlegroup.SetStyle(YAML::EmitterStyle::Block);
|
singlegroup.SetStyle(YAML::EmitterStyle::Block);
|
||||||
else
|
else
|
||||||
singlegroup.SetStyle(YAML::EmitterStyle::Flow);
|
singlegroup.SetStyle(YAML::EmitterStyle::Flow);
|
||||||
|
|
||||||
bool replace_flag = false;
|
bool replace_flag = false;
|
||||||
for (auto &&original_group: original_groups) {
|
for(auto && original_group : original_groups)
|
||||||
if (original_group["name"].as<std::string>() == x.Name) {
|
{
|
||||||
|
if(original_group["name"].as<std::string>() == x.Name)
|
||||||
|
{
|
||||||
original_group.reset(singlegroup);
|
original_group.reset(singlegroup);
|
||||||
replace_flag = true;
|
replace_flag = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!replace_flag)
|
if(!replace_flag)
|
||||||
original_groups.push_back(singlegroup);
|
original_groups.push_back(singlegroup);
|
||||||
}
|
}
|
||||||
if (group_compact)
|
if(group_compact)
|
||||||
original_groups.SetStyle(YAML::EmitterStyle::Flow);
|
original_groups.SetStyle(YAML::EmitterStyle::Flow);
|
||||||
|
|
||||||
if (ext.clash_new_field_name)
|
if(ext.clash_new_field_name)
|
||||||
yamlnode["proxy-groups"] = original_groups;
|
yamlnode["proxy-groups"] = original_groups;
|
||||||
else
|
else
|
||||||
yamlnode["Proxy Group"] = original_groups;
|
yamlnode["Proxy Group"] = original_groups;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user