Skip to content

Commit

Permalink
Log on more bad n resolving conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
devoxin committed Dec 10, 2024
1 parent 8d4bd86 commit 1163a57
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,19 @@ public URI resolveFormatUrl(@NotNull HttpInterface httpInterface, @NotNull Strin
if (!DataFormatTools.isNullOrEmpty(nParameter)) {
try {
String transformed = cipher.transform(nParameter, scriptEngine);
String logMessage = null;

if (transformed == null) {
logMessage = "Transformed n parameter is null, n function possibly faulty";
} else if (nParameter.equals(transformed)) {
logMessage = "Transformed n parameter is the same as input, n function possibly short-circuited";
} else if (transformed.contains("enhanced_except_") || transformed.endsWith("_w8_" + nParameter)) {
logMessage = "N function did not complete due to exception";
}

if (nParameter.equals(transformed)) {
log.warn("Transformed n parameter is the same as input, n function possibly short-circuited (in: {}, out: {}, player script: {}, source version: {})",
nParameter, transformed, playerScript, YoutubeSource.VERSION);
if (logMessage != null) {
log.warn("{} (in: {}, out: {}, player script: {}, source version: {})",
logMessage, nParameter, transformed, playerScript, YoutubeSource.VERSION);
}

uri.setParameter("n", transformed);
Expand Down

0 comments on commit 1163a57

Please sign in to comment.