[CHANGE] Reworked parsers/converters. Decipher operation from script do not work!

This commit is contained in:
max
2025-10-24 00:23:09 +02:00
parent de28591d24
commit a84195aefa
18 changed files with 285 additions and 77 deletions

View File

@@ -1,8 +1,13 @@
using System.Text.Json.Serialization;
namespace Manager.YouTube.Models.Innertube;
public class ColorInfo
{
[JsonPropertyName("primaries")]
public string Primaries { get; set; } = "";
[JsonPropertyName("transferCharacteristics")]
public string TransferCharacteristics { get; set; } = "";
[JsonPropertyName("matrixCoefficients")]
public string MatrixCoefficients { get; set; } = "";
}

View File

@@ -1,7 +1,11 @@
using System.Text.Json.Serialization;
namespace Manager.YouTube.Models.Innertube;
public class Range
{
[JsonPropertyName("start")]
public uint Start { get; set; }
[JsonPropertyName("end")]
public uint End { get; set; }
}

View File

@@ -1,10 +1,16 @@
using System.Text.Json.Serialization;
namespace Manager.YouTube.Models.Innertube;
public class StreamingData
{
public DateTime FetchedUtc { get; set; } = DateTime.UtcNow;
[JsonPropertyName("expiresInSeconds")]
public int ExpiresInSeconds { get; set; }
[JsonPropertyName("serverAbrStreamingUrl")]
public string ServerAbrStreamingUrl { get; set; } = "";
[JsonPropertyName("formats")]
public List<StreamingFormat> Formats { get; set; } = [];
[JsonPropertyName("adaptiveFormats")]
public List<StreamingFormat> AdaptiveFormats { get; set; } = [];
}

View File

@@ -1,31 +1,59 @@
using System.Text.Json.Serialization;
namespace Manager.YouTube.Models.Innertube;
public class StreamingFormat
{
[JsonPropertyName("itag")]
public int Itag { get; set; }
[JsonPropertyName("url")]
public string? Url { get; set; }
[JsonPropertyName("mimeType")]
public string MimeType { get; set; } = "";
[JsonPropertyName("bitrate")]
public uint Bitrate { get; set; }
[JsonPropertyName("width")]
public uint? Width { get; set; }
[JsonPropertyName("height")]
public uint? Height { get; set; }
[JsonPropertyName("initRange")]
public Range? InitRange { get; set; }
[JsonPropertyName("indexRange")]
public Range? IndexRange { get; set; }
[JsonPropertyName("lastModified")]
public long LastModified { get; set; }
[JsonPropertyName("contentLength")]
public long ContentLength { get; set; }
[JsonPropertyName("quality")]
public string Quality { get; set; } = "";
[JsonPropertyName("xtags")]
public string? Xtags { get; set; }
[JsonPropertyName("fps")]
public uint Fps { get; set; }
[JsonPropertyName("qualityLabel")]
public string QualityLabel { get; set; } = "";
[JsonPropertyName("projectionType")]
public string ProjectionType { get; set; } = "";
[JsonPropertyName("averagebitrate")]
public uint? AverageBitrate { get; set; }
[JsonPropertyName("highReplication")]
public bool? HighReplication { get; set; }
[JsonPropertyName("colorInfo")]
public ColorInfo? ColorInfo { get; set; }
[JsonPropertyName("audioQuality")]
public string? AudioQuality { get; set; } = "";
[JsonPropertyName("approxDurationMs")]
public long ApproxDurationMs { get; set; }
[JsonPropertyName("audioSampleRate")]
public int? AudioSampleRate { get; set; }
[JsonPropertyName("audioChannels")]
public int? AudioChannels { get; set; }
[JsonPropertyName("loudnessDb")]
public double? LoudnessDb { get; set; }
[JsonPropertyName("isDrc")]
public bool? IsDrc { get; set; }
[JsonPropertyName("signatureCipher")]
public string? SignatureCipher { get; set; }
[JsonPropertyName("qualityOrdinal")]
public string QualityOrdinal { get; set; } = "";
}

View File

@@ -1,8 +1,13 @@
using System.Text.Json.Serialization;
namespace Manager.YouTube.Models.Innertube;
public class WebImage
{
[JsonPropertyName("width")]
public int Width { get; set; }
[JsonPropertyName("height")]
public int Height { get; set; }
[JsonPropertyName("url")]
public string Url { get; set; } = "";
}