Fix subscription conversion

This commit is contained in:
2dust
2022-10-09 20:30:17 +08:00
parent 3e437c0ed2
commit e4403c4fd8
3 changed files with 5 additions and 1 deletions

View File

@@ -23,6 +23,9 @@
@"http://127.0.0.1:25500/sub?target=clash&url={0}", @"http://127.0.0.1:25500/sub?target=clash&url={0}",
"" ""
}; };
public static readonly List<string> SubConvertConfig = new List<string> {
@"https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online.ini"
};
/// <summary> /// <summary>

View File

@@ -59,7 +59,7 @@ namespace clashN.Handler
var config = LazyConfig.Instance.GetConfig(); var config = LazyConfig.Instance.GetConfig();
var txtFile = File.ReadAllText(addressFileName); var txtFile = File.ReadAllText(addressFileName);
txtFile = txtFile.Replace("!<str>", "").Replace("MATCH,,", "MATCH,"); txtFile = txtFile.Replace("!<str>", "");
var fileContent = Utils.FromYaml<Dictionary<string, object>>(txtFile); var fileContent = Utils.FromYaml<Dictionary<string, object>>(txtFile);
if (fileContent == null) if (fileContent == null)

View File

@@ -207,6 +207,7 @@ namespace clashN.Handler
config.constItem.subConvertUrl = Global.SubConvertUrls[0]; config.constItem.subConvertUrl = Global.SubConvertUrls[0];
} }
url = String.Format(config.constItem.subConvertUrl, Utils.UrlEncode(url)); url = String.Format(config.constItem.subConvertUrl, Utils.UrlEncode(url));
url += String.Format("&config={0}", Global.SubConvertConfig[0]);
} }
var downloadHandle = new DownloadHandle(); var downloadHandle = new DownloadHandle();
downloadHandle.Error += (sender2, args) => downloadHandle.Error += (sender2, args) =>