[CHANGE] Added dev page

This commit is contained in:
max
2025-09-05 16:23:32 +02:00
parent 92e5bb7f1f
commit 55322f8792
6 changed files with 67 additions and 2 deletions

View File

@@ -0,0 +1,14 @@
<MudText>SAPISID Hash generator</MudText>
<MudStack Row Spacing="2">
<MudTextField HelperText="Datasync id" @bind-Value="@DatasyncId"/>
<MudTextField HelperText="Time" Mask="@(new PatternMask("0000000000"))" @bind-Value="@Time"/>
<MudTextField HelperText="SAPISID" @bind-Value="@SecureCookie"/>
<MudTextField HelperText="Origin" @bind-Value="@Origin"/>
</MudStack>
<MudTextField HelperText="Hash" ReadOnly @bind-Value="@OutputHash"/>
<MudStack Row Spacing="2">
<MudButton OnClick="Hash">Generate</MudButton>
<MudButton OnClick="Clear">Clear</MudButton>
</MudStack>

View File

@@ -0,0 +1,30 @@
using Manager.YouTube.Util;
using Microsoft.AspNetCore.Components;
namespace Manager.App.Components.Application.Dev;
public partial class AuthenticationHasher : ComponentBase
{
private const string DefaultOrigin = "https://www.youtube.com";
public string DatasyncId { get; set; } = "";
public string Time { get; set; } = "";
public string SecureCookie { get; set; } = "";
public string Origin { get; set; } = DefaultOrigin;
public string OutputHash { get; set; } = "";
private void Clear()
{
DatasyncId = "";
Time = "";
SecureCookie = "";
Origin = DefaultOrigin;
OutputHash = "";
}
private void Hash()
{
var hashedValue= AuthenticationUtilities.GetSapisidHash(DatasyncId, SecureCookie, Origin, Time);
OutputHash = hashedValue ?? "Hash failed!";
}
}

View File

@@ -4,4 +4,5 @@
<MudNavLink Href="/Channels" Icon="@Icons.Material.Filled.SupervisorAccount" Match="NavLinkMatch.All">Channels</MudNavLink>
<MudNavLink Href="/Library" Icon="@Icons.Material.Filled.LocalLibrary" Match="NavLinkMatch.All">Library</MudNavLink>
<MudNavLink Href="/Playlists" Icon="@Icons.Material.Filled.ViewList" Match="NavLinkMatch.All">Playlists</MudNavLink>
<MudNavLink Href="/Development" Icon="@Icons.Material.Filled.DeveloperMode" Match="NavLinkMatch.All">Development</MudNavLink>
</MudNavMenu>

View File

@@ -0,0 +1,9 @@
@page "/Development"
@using Manager.App.Components.Application.Dev
<title>Development page</title>
<MudTabs Outlined Position="Position.Left" PanelClass="pa-4" ApplyEffectsToContainer Style="height: 100%">
<MudTabPanel Text="Authentication">
<AuthenticationHasher />
</MudTabPanel>
</MudTabs>

View File

@@ -0,0 +1,8 @@
using Microsoft.AspNetCore.Components;
namespace Manager.App.Components.Pages;
public partial class Development : ComponentBase
{
}