12 lines
452 B
C#
12 lines
452 B
C#
using System.Text.Json;
|
|
using Manager.YouTube.Models.Innertube;
|
|
|
|
namespace Manager.YouTube.Parsers.Json;
|
|
|
|
public static class JsonParser
|
|
{
|
|
public static List<WebImage> ParseImages(JsonElement.ArrayEnumerator array) =>
|
|
array
|
|
.Select(image => new WebImage { Width = image.GetProperty("width").GetInt32(), Height = image.GetProperty("height").GetInt32(), Url = image.GetProperty("url").GetString() ?? "" })
|
|
.ToList();
|
|
} |