mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-05 03:19:23 +00:00
Fix for recent build
This commit is contained in:
parent
1f0a179d5f
commit
6b63879cee
26 changed files with 101 additions and 23 deletions
26
ml_vpc/Main.cs
Normal file
26
ml_vpc/Main.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using ABI_RC.VideoPlayer;
|
||||
using System.Reflection;
|
||||
using System.IO;
|
||||
|
||||
namespace ml_vpc
|
||||
{
|
||||
public class VideoPlayerCookies : MelonLoader.MelonMod
|
||||
{
|
||||
static string ms_cookiesPath;
|
||||
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
HarmonyInstance.Patch(typeof(YoutubeDl).GetMethod("GetVideoMetaDataAsync", BindingFlags.NonPublic | BindingFlags.Static),
|
||||
new HarmonyLib.HarmonyMethod(typeof(VideoPlayerCookies).GetMethod(nameof(OnGetYoutubeVideoMetaData_Prefix), BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
|
||||
ms_cookiesPath = Path.Combine(MelonLoader.Utils.MelonEnvironment.UserDataDirectory, "cookies.txt");
|
||||
}
|
||||
|
||||
static void OnGetYoutubeVideoMetaData_Prefix(ref string parameter)
|
||||
{
|
||||
if(File.Exists(ms_cookiesPath))
|
||||
parameter += string.Format(" --cookies \"{0}\"", ms_cookiesPath);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue