From 3be77681c8911a95466707e950b91b777c9d87d1 Mon Sep 17 00:00:00 2001 From: 13xforever Date: Mon, 19 Jan 2026 19:50:24 +0500 Subject: [PATCH] prefer update pkg links with drm_type="mbind" these are supposedly drm-free (well, "PS3 disc bind content" or "Magic Gate Memory Stick bind content" for PSP) --- Clients/PsnClient/POCOs/TitlePatch.cs | 18 +++++++++++++++++- .../ResultFormatters/TitlePatchFormatter.cs | 17 +++++++++++++---- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/Clients/PsnClient/POCOs/TitlePatch.cs b/Clients/PsnClient/POCOs/TitlePatch.cs index e90442e2..fab7a0e9 100644 --- a/Clients/PsnClient/POCOs/TitlePatch.cs +++ b/Clients/PsnClient/POCOs/TitlePatch.cs @@ -36,10 +36,14 @@ public class TitlePatchPackage public string Sha1Sum { get; set; } [XmlAttribute("url")] public string Url { get; set; } + [XmlAttribute("drm_type")] + public string DrmType { get; set; } [XmlAttribute("ps3_system_ver")] public string Ps3SystemVer { get; set; } [XmlElement("paramsfo")] public TitlePatchParamSfo ParamSfo { get; set; } + [XmlElement("url")] + public UrlInfo AltUrl { get; set; } } public class TitlePatchParamSfo @@ -47,5 +51,17 @@ public class TitlePatchParamSfo [XmlElement("TITLE")] public string Title { get; set; } } - + +public class UrlInfo +{ + [XmlAttribute("url")] + public string Url { get; set; } + [XmlAttribute("size")] + public long Size { get; set; } + [XmlAttribute("sha1sum")] + public string Sha1Sum { get; set; } + [XmlAttribute("drm_type")] + public string DrmType { get; set; } +} + #nullable restore \ No newline at end of file diff --git a/CompatBot/Utils/ResultFormatters/TitlePatchFormatter.cs b/CompatBot/Utils/ResultFormatters/TitlePatchFormatter.cs index 0c48eff9..098fae22 100644 --- a/CompatBot/Utils/ResultFormatters/TitlePatchFormatter.cs +++ b/CompatBot/Utils/ResultFormatters/TitlePatchFormatter.cs @@ -24,21 +24,30 @@ internal static class TitlePatchFormatter if (pkgs.Length > 1) content.AppendLine( $""" - ℹ️ Total download size of all {pkgs.Length} packages is {pkgs.Sum(p => p.Size).AsStorageUnit()}. + ℹ️ Total download size of all {pkgs.Length} packages is {pkgs.Sum(p => p.AltUrl?.Size ?? p.Size).AsStorageUnit()}. ⏩ You can use tools such as [rusty-psn](https://github.com/RainbowCookie32/rusty-psn/releases/latest) or [PySN](https://github.com/AphelionWasTaken/PySN/releases/latest) for mass download of all updates. ⚠️ You **must** install listed updates in order, starting with the first one. You **can not** skip intermediate versions. """ ).AppendLine(); foreach (var pkg in pkgs) - content.AppendLine($"""[⏬ Update v`{pkg.Version}` ({pkg.Size.AsStorageUnit()})]({pkg.Url})"""); + { + // prefer drm-free link + content.Append($"[⏬ Update v`{pkg.Version}` ({(pkg.AltUrl?.Size ?? pkg.Size).AsStorageUnit()})]({pkg.AltUrl?.Url ?? pkg.Url})"); + if (pkg.AltUrl is { Url: { Length: >0} altUrl }) + content.Append($" | [with DRM]({pkg.Url})"); + content.AppendLine(); + } } else if (pkgs is [var pkg]) { + var link = $"[⏬ {Path.GetFileName(GetLinkName(pkg.Url))}]({pkg.Url})"; + if (pkg.AltUrl is { Url: { Length: > 0 } altUrl }) + link += $" | [with DRM]({pkg.Url})"; content.AppendLine( $""" - ### {title} update v{pkg.Version} ({pkg.Size.AsStorageUnit()}) - [⏬ {Path.GetFileName(GetLinkName(pkg.Url))}]({pkg.Url}) + ### {title} update v{pkg.Version} ({(pkg.AltUrl?.Size ?? pkg.Size).AsStorageUnit()}) + {link} """ ); }