[CHANGE] Testing js runtime script

This commit is contained in:
max
2025-11-02 00:02:09 +01:00
parent 4c04378080
commit 16343c9a56
2 changed files with 18 additions and 7 deletions

View File

@@ -5,6 +5,7 @@ using System.Text.Json;
using System.Text.Json.Nodes;
using DotBased.Logging;
using DotBased.Monads;
using Manager.YouTube.Interpreter;
using Manager.YouTube.Models;
using Manager.YouTube.Models.Innertube;
using Manager.YouTube.Parsers;
@@ -401,18 +402,28 @@ public sealed class YouTubeClient : IDisposable
_logger.Debug("Skipping decipher, no signatures found to decipher.");
return;
}
var jsEngineResult = await JavaScriptEngineManager.GetPlayerEngine(state.PlayerJsUrl ?? "");
if (!jsEngineResult.IsSuccess)
{
_logger.Warning(jsEngineResult.Error?.Description ?? "Failed to get player script engine.");
return;
}
var engine = jsEngineResult.Value;
engine.InitializePlayer();
var decipherDecoderResult = await CipherManager.GetDecoderAsync(state, this);
/*var decipherDecoderResult = await CipherManager.GetDecoderAsync(state, this);
if (!decipherDecoderResult.IsSuccess)
{
_logger.Warning(decipherDecoderResult.Error?.Description ?? "Failed to get the cipher decoder!");
return;
}
var decoder = decipherDecoderResult.Value;
foreach (var format in formatsWithCipher)
{
format.Url = decoder.Decipher(format.SignatureCipher);
}
}*/
}
}