mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-02 17:52:19 +00:00
fix singbox parser bug.(#4)
This commit is contained in:
1 parent
7bd6670448
commit
897dc5ed43
1 file changed
+15
-8
@@ -2709,15 +2709,22 @@ void explodeSub(std::string sub, std::vector<Proxy> &nodes) {
|
||||
throw;
|
||||
}
|
||||
try {
|
||||
std::string pattern = "\"?(inbounds)\"?:";
|
||||
if (!processed &&
|
||||
regFind(sub, "^(?=.*(\"?(inbounds)\"?:))(?=.*(\"?(outbounds)\"?:))(?=.*(\"?(route)\"?:)).*")) {
|
||||
rapidjson::Document document;
|
||||
document.Parse(sub.c_str());
|
||||
if (!document.HasParseError() || document.IsObject()) {
|
||||
rapidjson::Value &value = document["outbounds"];
|
||||
if (value.IsArray() && !value.Empty()) {
|
||||
explodeSingbox(value, nodes);
|
||||
processed = true;
|
||||
regFind(sub, pattern)) {
|
||||
pattern = "\"?(outbounds)\"?:";
|
||||
if (regFind(sub, pattern)) {
|
||||
pattern = "\"?(route)\"?:";
|
||||
if (regFind(sub, pattern)) {
|
||||
rapidjson::Document document;
|
||||
document.Parse(sub.c_str());
|
||||
if (!document.HasParseError() || document.IsObject()) {
|
||||
rapidjson::Value &value = document["outbounds"];
|
||||
if (value.IsArray() && !value.Empty()) {
|
||||
explodeSingbox(value, nodes);
|
||||
processed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user