From e04724ed9d05045a2a339bce27ae7568a868a734 Mon Sep 17 00:00:00 2001 From: Slime-Senpai Date: Sat, 25 Apr 2026 17:08:07 +0200 Subject: [PATCH 1/2] Fix ml_vpc --- ml_vpc/Main.cs | 24 ++++++++++++------------ ml_vpc/ml_vpc.csproj | 4 ++++ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/ml_vpc/Main.cs b/ml_vpc/Main.cs index ba0febc..38ebdd3 100644 --- a/ml_vpc/Main.cs +++ b/ml_vpc/Main.cs @@ -11,7 +11,7 @@ namespace ml_vpc public override void OnInitializeMelon() { - HarmonyInstance.Patch(typeof(YoutubeDl).GetMethod("GetVideoMetaDataAsync", BindingFlags.NonPublic | BindingFlags.Static), + HarmonyInstance.Patch(typeof(YoutubeDl).GetMethod("GetVideoMetaDataAsync", BindingFlags.Public | BindingFlags.Static), new HarmonyLib.HarmonyMethod(typeof(VideoPlayerCookies).GetMethod(nameof(OnGetYoutubeVideoMetaData_Prefix), BindingFlags.NonPublic | BindingFlags.Static)) ); @@ -23,7 +23,7 @@ namespace ml_vpc Settings.Init(); } - static void OnGetYoutubeVideoMetaData_Prefix(ref string parameter) + static void OnGetYoutubeVideoMetaData_Prefix(ref string youtubeUrl, ref string existingParameters) { try { @@ -34,36 +34,36 @@ namespace ml_vpc { case Settings.CookieMode.File: if (File.Exists(ms_cookiesPath)) - parameter += string.Format(" --cookies \"{0}\"", ms_cookiesPath); + existingParameters += string.Format("--cookies \"{0}\"", ms_cookiesPath); else MelonLoader.MelonLogger.Warning("Cookies file not found in: '" + ms_cookiesPath + "'"); break; case Settings.CookieMode.BrowserFirefox: - parameter += " --cookies-from-browser firefox"; + existingParameters += "--cookies-from-browser firefox"; break; case Settings.CookieMode.BrowserBrave: - parameter += " --cookies-from-browser brave"; + existingParameters += "--cookies-from-browser brave"; break; case Settings.CookieMode.BrowserChrome: - parameter += " --cookies-from-browser chrome"; + existingParameters += "--cookies-from-browser chrome"; break; case Settings.CookieMode.BrowserChromium: - parameter += " --cookies-from-browser chromium"; + existingParameters += "--cookies-from-browser chromium"; break; case Settings.CookieMode.BrowserEdge: - parameter += " --cookies-from-browser edge"; + existingParameters += "--cookies-from-browser edge"; break; case Settings.CookieMode.BrowserOpera: - parameter += " --cookies-from-browser opera"; + existingParameters += "--cookies-from-browser opera"; break; case Settings.CookieMode.BrowserSafari: - parameter += " --cookies-from-browser safari"; + existingParameters += "--cookies-from-browser safari"; break; case Settings.CookieMode.BrowserVivaldi: - parameter += " --cookies-from-browser vivaldi"; + existingParameters += "--cookies-from-browser vivaldi"; break; case Settings.CookieMode.BrowserWhale: - parameter += " --cookies-from-browser whale"; + existingParameters += "--cookies-from-browser whale"; break; } } diff --git a/ml_vpc/ml_vpc.csproj b/ml_vpc/ml_vpc.csproj index dad2a90..d723877 100644 --- a/ml_vpc/ml_vpc.csproj +++ b/ml_vpc/ml_vpc.csproj @@ -56,4 +56,8 @@ + + + + From d8bb5881fc1c70ef78be774b981dcb1e479df75c Mon Sep 17 00:00:00 2001 From: Slime-Senpai Date: Sat, 25 Apr 2026 17:21:38 +0200 Subject: [PATCH 2/2] Add ml_vpc readme tutorial for linux --- ml_vpc/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ml_vpc/README.md b/ml_vpc/README.md index 76bba25..ac01628 100644 --- a/ml_vpc/README.md +++ b/ml_vpc/README.md @@ -27,6 +27,19 @@ Available mod's settings in `Settings - General - Video Player Cookies`: * Firefox-based browsers: [cookies.txt](https://addons.mozilla.org/en-US/firefox/addon/cookies-txt) extension * Save result as file named `cookies.txt` in `/UserData` folder +# How to make it work on Linux (Tested on CachyOS / Arch with Firefox) +Because of Linux / Proton, the cookies.txt doesn't seem to work well, instead it's better to use browser mode, the following tutorial explains how to set it up (tested using Firefox) + +* Go to the mod settings and select your browser +* Put a video and wait for it to fail, then look at the logs + * It should tell you an error because it can't find your cookies in a path, for Firefox it looks like `AppData/Local/Packages/Mozilla.Firefox_n80bbvh6b1yt2/LocalCache/Roaming/Mozilla/Firefox/Profiles/` +* Go to AppData in the drive_c of the game, on Arch this is usually located at `/home/[USER]/.local/share/Steam/steamapps/compatdata/661130/pfx/drive_c/users/steamuser/Appdata` +* Create all the folders that it requires until the last one, for Firefox this means the folders `Packages`, `Mozilla.Firefox_n80bbvh6b1yt2`, `LocalCache`, `Roaming`, `Mozilla` and `Firefox` but don't create the last one (`Profiles`) yet unless you don't intend to use your real browser +* Because your cookies could change or expire, instead of giving it the files once, we'll use a symlink to the real firefox on your machine. This is completely up to you and you could just copy the files or get them from somewhere else +* Now you can create a link that points to the folder of your browser on Linux. For Firefox, this is the `Profiles` folder that should point to `/home/[USER]/.mozilla/firefox/` +* If you followed all the steps, the next video you put should successfully get the cookies from your browser + + # Notes * After first use yt-dlp will remove unnecessary cookies from file automatically. * Cookies contain private information and access to your YouTube account, **do not share them to anyone**.