[CHANGE] Rework && adding channel fetching

This commit is contained in:
max
2025-09-06 20:40:46 +02:00
parent d0eca248bb
commit c528ad9bb3
10 changed files with 145 additions and 100 deletions

View File

@@ -1,10 +0,0 @@
namespace Manager.YouTube.Models;
public class AccountMenuInfo
{
public string? AccountId { get; set; }
public string? AccountHandle { get; set; }
public string? ImageUrl { get; set; }
public int ImageWidth { get; set; }
public int ImageHeight { get; set; }
}

View File

@@ -0,0 +1,35 @@
using Manager.YouTube.Models.Innertube;
namespace Manager.YouTube.Models;
public class ClientExternalData
{
public ClientState? State { get; set; }
public ClientInformation Information { get; set; } = new();
public List<string> DatasyncIds { get; set; } = [];
public string GetDatasyncId()
{
if (!string.IsNullOrWhiteSpace(State?.WebPlayerContextConfig?.WebPlayerContext?.DatasyncId))
{
return State.WebPlayerContextConfig.WebPlayerContext.DatasyncId;
}
var tempDatasyncId = "";
foreach (var datasyncId in DatasyncIds)
{
var split = datasyncId.Split("||", StringSplitOptions.RemoveEmptyEntries);
switch (split.Length)
{
case 0:
case 2 when tempDatasyncId.Equals(split[1]):
continue;
case 2:
tempDatasyncId = split[1];
break;
}
}
return tempDatasyncId;
}
}

View File

@@ -0,0 +1,8 @@
namespace Manager.YouTube.Models;
public class ClientInformation
{
public string? AccountName { get; set; }
public string? AccountHandle { get; set; }
public string? Description { get; set; }
}

View File

@@ -0,0 +1,10 @@
namespace Manager.YouTube.Models.Innertube;
public class ChannelFetch
{
public bool NoIndex { get; set; }
public bool Unlisted { get; set; }
public bool FamilyFriendly { get; set; }
public List<string> AvailableCountries { get; set; } = [];
}