Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sim0n00ps/OF-DL
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: OFDLV1.7.83
Choose a base ref
...
head repository: sim0n00ps/OF-DL
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: OFDLV1.8.0
Choose a head ref
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on Jan 30, 2025

  1. Fix CDRM

    sim0n00ps committed Jan 30, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    b4d7d94 View commit details
  2. Update publish-release.yml

    sim0n00ps authored Jan 30, 2025
    Copy the full SHA
    74c5e7a View commit details
Showing with 29 additions and 15 deletions.
  1. +2 −2 .github/workflows/publish-release.yml
  2. +8 −3 OF DL/Entities/CDRMProjectRequest.cs
  3. +19 −10 OF DL/Helpers/APIHelper.cs
4 changes: 2 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -11,10 +11,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup dotnet 7.x
- name: Setup dotnet 8.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x
dotnet-version: 8.x

- name: Display dotnet version
run: dotnet --version
11 changes: 8 additions & 3 deletions OF DL/Entities/CDRMProjectRequest.cs
Original file line number Diff line number Diff line change
@@ -9,14 +9,19 @@ namespace OF_DL.Entities
{
public class CDRMProjectRequest
{
[JsonProperty("pssh")]
public string PSSH { get; set; } = "";

[JsonProperty("License URL")]
[JsonProperty("licurl")]
public string LicenseURL { get; set; } = "";

[JsonProperty("headers")]
public string Headers { get; set; } = "";
public string JSON { get; set; } = "";

[JsonProperty("cookies")]
public string Cookies { get; set; } = "";

[JsonProperty("data")]
public string Data { get; set; } = "";
public string Proxy { get; set; } = "";
}
}
29 changes: 19 additions & 10 deletions OF DL/Helpers/APIHelper.cs
Original file line number Diff line number Diff line change
@@ -2586,10 +2586,8 @@ public async Task<string> GetDecryptionKey(Dictionary<string, string> drmHeaders
PSSH = pssh,
LicenseURL = licenceURL,
Headers = JsonConvert.SerializeObject(drmHeaders),
JSON = "",
Cookies = "",
Data = "",
Proxy = ""
Data = ""
};

string json = JsonConvert.SerializeObject(cdrmProjectRequest);
@@ -2600,7 +2598,7 @@ public async Task<string> GetDecryptionKey(Dictionary<string, string> drmHeaders
{
attempt++;

HttpRequestMessage request = new(HttpMethod.Post, "https://cdrm-project.com/")
HttpRequestMessage request = new(HttpMethod.Post, "https://cdrm-project.com/api/decrypt")
{
Content = new StringContent(json, Encoding.UTF8, "application/json")
};
@@ -2611,19 +2609,30 @@ public async Task<string> GetDecryptionKey(Dictionary<string, string> drmHeaders

response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
var doc = JsonDocument.Parse(body);

if (!body.Contains("error", StringComparison.OrdinalIgnoreCase))
if (doc.RootElement.TryGetProperty("status", out JsonElement status))
{
var doc = JsonDocument.Parse(body);
dcValue = doc.RootElement.GetProperty("Message").GetString().Trim();
return dcValue;
if (status.ToString().Trim().Equals("success", StringComparison.OrdinalIgnoreCase))
{
dcValue = doc.RootElement.GetProperty("message").GetString().Trim();
return dcValue;
}
else
{
Log.Debug($"CDRM response status not successful. Retrying... Attempt {attempt} of {maxAttempts}");
if (attempt < maxAttempts)
{
await Task.Delay(delayBetweenAttempts);
}
}
}
else
{
Log.Debug($"Response contains 'error'. Retrying... Attempt {attempt} of {maxAttempts}");
Log.Debug($"Status not in CDRM response. Retrying... Attempt {attempt} of {maxAttempts}");
if (attempt < maxAttempts)
{
await Task.Delay(delayBetweenAttempts);
await Task.Delay(delayBetweenAttempts);
}
}
}