Bilibili-Evolved/extras/vld-windows/VideoLinkDownloader.Core/Video.cs
2019-05-30 20:15:19 +08:00

26 lines
635 B
C#

using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace VideoLinkDownloader.Core
{
public class Video
{
public string Title { get; set; }
public long TotalSize { get; set; }
public VideoFragment[] Fragments { get; set; }
public static (bool success, IEnumerable<Video> videos) Parse(string json)
{
try
{
var videos = JsonConvert.DeserializeObject<Video[]>(json);
return (true, videos);
}
catch
{
return (false, null);
}
}
}
}