|
|
@ -368,9 +368,16 @@ namespace DownKyi.Core.BiliApi.BiliUtils
|
|
|
|
/// <returns></returns>
|
|
|
|
/// <returns></returns>
|
|
|
|
public static bool IsUserUrl(string input)
|
|
|
|
public static bool IsUserUrl(string input)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
string baseUrl = $"{SpaceUrl}/";
|
|
|
|
if (!IsUrl(input)) { return false; }
|
|
|
|
string id = GetId(input, baseUrl);
|
|
|
|
|
|
|
|
return Number.IsInt(id);
|
|
|
|
if (input.Contains("space.bilibili.com"))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -390,9 +397,17 @@ namespace DownKyi.Core.BiliApi.BiliUtils
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (IsUserUrl(input))
|
|
|
|
else if (IsUserUrl(input))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
string baseUrl = $"{SpaceUrl}/";
|
|
|
|
string url = EnableHttps(input);
|
|
|
|
string id = GetId(input, baseUrl);
|
|
|
|
url = DeleteUrlParam(url);
|
|
|
|
return Number.GetInt(id);
|
|
|
|
var match = Regex.Match(url, @"\d+");
|
|
|
|
|
|
|
|
if (match.Success)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return long.Parse(match.Value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|