34 lines
986 B
C#
34 lines
986 B
C#
|
using CsharpHttpHelper;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace VideoFission
|
|||
|
{
|
|||
|
public static class Tools
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 返回一个随机解析完成的短链接
|
|||
|
/// </summary>
|
|||
|
/// <param name="url">要解析的链接</param>
|
|||
|
/// <returns></returns>
|
|||
|
public static string FindAnalysisUrlFulfill(string url)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
if (string.IsNullOrWhiteSpace(Class1.Config.AnalysisLink)) return string.Empty;
|
|||
|
var rows = Class1.Config.AnalysisLink.Split(new string[] { @"
|
|||
|
" }, StringSplitOptions.RemoveEmptyEntries);
|
|||
|
if (rows != null && rows.Length != 0)
|
|||
|
return Api.Framework.ApiClient.ShortURL(rows[new Random().Next(0, rows.Length)] + url).Result;
|
|||
|
}
|
|||
|
catch
|
|||
|
{ }
|
|||
|
return string.Empty;
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
}
|