[CHANGE] Implementing video fetching and deciphering
This commit is contained in:
8
Manager.YouTube/Models/Innertube/ColorInfo.cs
Normal file
8
Manager.YouTube/Models/Innertube/ColorInfo.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Manager.YouTube.Models.Innertube;
|
||||
|
||||
public class ColorInfo
|
||||
{
|
||||
public string Primaries { get; set; } = "";
|
||||
public string TransferCharacteristics { get; set; } = "";
|
||||
public string MatrixCoefficients { get; set; } = "";
|
||||
}
|
||||
7
Manager.YouTube/Models/Innertube/Range.cs
Normal file
7
Manager.YouTube/Models/Innertube/Range.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Manager.YouTube.Models.Innertube;
|
||||
|
||||
public class Range
|
||||
{
|
||||
public uint Start { get; set; }
|
||||
public uint End { get; set; }
|
||||
}
|
||||
8
Manager.YouTube/Models/Innertube/StoryBoard.cs
Normal file
8
Manager.YouTube/Models/Innertube/StoryBoard.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Manager.YouTube.Models.Innertube;
|
||||
|
||||
public class StoryBoard
|
||||
{
|
||||
public string Spec { get; set; } = "";
|
||||
public int RecommendedLevel { get; set; }
|
||||
public int HighResolutionRecommendedLevel { get; set; }
|
||||
}
|
||||
10
Manager.YouTube/Models/Innertube/StreamingData.cs
Normal file
10
Manager.YouTube/Models/Innertube/StreamingData.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Manager.YouTube.Models.Innertube;
|
||||
|
||||
public class StreamingData
|
||||
{
|
||||
public DateTime FetchedUtc { get; set; } = DateTime.UtcNow;
|
||||
public int ExpiresInSeconds { get; set; }
|
||||
public string ServerAbrStreamingUrl { get; set; } = "";
|
||||
public List<StreamingFormat> Formats { get; set; } = [];
|
||||
public List<StreamingFormat> AdaptiveFormats { get; set; } = [];
|
||||
}
|
||||
30
Manager.YouTube/Models/Innertube/StreamingFormat.cs
Normal file
30
Manager.YouTube/Models/Innertube/StreamingFormat.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
namespace Manager.YouTube.Models.Innertube;
|
||||
|
||||
public class StreamingFormat
|
||||
{
|
||||
public int Itag { get; set; }
|
||||
public string Url { get; set; } = "";
|
||||
public string MimeType { get; set; } = "";
|
||||
public uint Bitrate { get; set; }
|
||||
public uint? Width { get; set; }
|
||||
public uint? Height { get; set; }
|
||||
public Range? InitRange { get; set; }
|
||||
public Range? IndexRange { get; set; }
|
||||
public long LastModified { get; set; }
|
||||
public long ContentLength { get; set; }
|
||||
public string Quality { get; set; } = "";
|
||||
public string? Xtags { get; set; }
|
||||
public uint Fps { get; set; }
|
||||
public string QualityLabel { get; set; } = "";
|
||||
public string ProjectionType { get; set; } = "";
|
||||
public uint? AverageBitrate { get; set; }
|
||||
public bool? HighReplication { get; set; }
|
||||
public ColorInfo? ColorInfo { get; set; }
|
||||
public string? AudioQuality { get; set; } = "";
|
||||
public long ApproxDurationMs { get; set; }
|
||||
public int? AudioSampleRate { get; set; }
|
||||
public int? AudioChannels { get; set; }
|
||||
public double? LoudnessDb { get; set; }
|
||||
public bool? IsDrc { get; set; }
|
||||
public string QualityOrdinal { get; set; } = "";
|
||||
}
|
||||
9
Manager.YouTube/Models/Parser/YouTubeVideoData.cs
Normal file
9
Manager.YouTube/Models/Parser/YouTubeVideoData.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Nodes;
|
||||
|
||||
namespace Manager.YouTube.Models.Parser;
|
||||
|
||||
public class YouTubeVideoData
|
||||
{
|
||||
public JsonObject? YouTubePlayerData { get; set; }
|
||||
public JsonObject? YouTubeInitialData { get; set; }
|
||||
}
|
||||
12
Manager.YouTube/Models/PlayerConfig.cs
Normal file
12
Manager.YouTube/Models/PlayerConfig.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace Manager.YouTube.Models;
|
||||
|
||||
public class PlayerConfig
|
||||
{
|
||||
public double AudioLoudnessDb { get; set; }
|
||||
public double AudioPerceptualLoudnessDb { get; set; }
|
||||
public bool AudioEnablePerFormatLoudness { get; set; }
|
||||
public uint MaxBitrate { get; set; }
|
||||
public uint MaxReadAheadMediaTimeMs { get; set; }
|
||||
public uint MinReadAheadMediaTimeMs { get; set; }
|
||||
public uint ReadAheadGrowthRateMs { get; set; }
|
||||
}
|
||||
36
Manager.YouTube/Models/YouTubeVideo.cs
Normal file
36
Manager.YouTube/Models/YouTubeVideo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Manager.YouTube.Models.Innertube;
|
||||
|
||||
namespace Manager.YouTube.Models;
|
||||
|
||||
public class YouTubeVideo
|
||||
{
|
||||
public required string VideoId { get; set; }
|
||||
public string Title { get; set; } = "";
|
||||
public string Description { get; set; } = "";
|
||||
public string[] HashTags { get; set; } = [];
|
||||
public long ViewCount { get; set; }
|
||||
public long LikeCount { get; set; }
|
||||
public string ChannelId { get; set; } = "";
|
||||
public string Author { get; set; } = "";
|
||||
public string PlayabilityStatus { get; set; } = "";
|
||||
public long LengthSeconds { get; set; }
|
||||
public bool AllowRating { get; set; }
|
||||
public bool IsCrawlable { get; set; }
|
||||
public bool IsPrivate { get; set; }
|
||||
public bool IsUnpluggedCorpus { get; set; }
|
||||
public bool IsLive { get; set; }
|
||||
public bool IsFamiliySave { get; set; }
|
||||
public string[] AvailableCountries { get; set; } = [];
|
||||
public bool IsUnlisted { get; set; }
|
||||
public bool HasYpcMetadata { get; set; }
|
||||
public DateTime PublishDate { get; set; }
|
||||
public DateTime UploadDate { get; set; }
|
||||
public bool IsShortsEligible { get; set; }
|
||||
public string Category { get; set; } = "";
|
||||
|
||||
public StreamingData StreamingData { get; set; } = new();
|
||||
public List<WebImage> Thumbnails { get; set; } = [];
|
||||
|
||||
public PlayerConfig? PlayerConfig { get; set; }
|
||||
public StoryBoard? StoryBoard { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user