mirror of
https://github.com/2dust/v2rayN.git
synced 2025-08-23 11:26:54 +00:00
Fixed a bug in parsing subscription result
https://github.com/2dust/v2rayN/issues/7734
This commit is contained in:
parent
186b56aed9
commit
120e8d0686
3 changed files with 17 additions and 8 deletions
|
@ -1412,6 +1412,11 @@ public class ConfigHandler
|
||||||
{
|
{
|
||||||
profileItem = V2rayFmt.ResolveFull(strData, subRemarks);
|
profileItem = V2rayFmt.ResolveFull(strData, subRemarks);
|
||||||
}
|
}
|
||||||
|
//Is Html Page
|
||||||
|
if (profileItem is null && HtmlPageFmt.IsHtmlPage(strData))
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
//Is Clash configuration
|
//Is Clash configuration
|
||||||
if (profileItem is null)
|
if (profileItem is null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -220,14 +220,7 @@ public class BaseFmt
|
||||||
|
|
||||||
protected static bool Contains(string str, params string[] s)
|
protected static bool Contains(string str, params string[] s)
|
||||||
{
|
{
|
||||||
foreach (var item in s)
|
return s.All(item => str.Contains(item, StringComparison.OrdinalIgnoreCase));
|
||||||
{
|
|
||||||
if (str.Contains(item, StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static string WriteAllText(string strData, string ext = "json")
|
protected static string WriteAllText(string strData, string ext = "json")
|
||||||
|
|
11
v2rayN/ServiceLib/Handler/Fmt/HtmlPageFmt.cs
Normal file
11
v2rayN/ServiceLib/Handler/Fmt/HtmlPageFmt.cs
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
using SkiaSharp;
|
||||||
|
|
||||||
|
namespace ServiceLib.Handler.Fmt;
|
||||||
|
|
||||||
|
public class HtmlPageFmt : BaseFmt
|
||||||
|
{
|
||||||
|
public static bool IsHtmlPage(string strData)
|
||||||
|
{
|
||||||
|
return Contains(strData, "<html", "<!doctype html", "<head");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue