fix formatting

This commit is contained in:
gechoto 2024-12-29 13:49:51 +01:00 committed by Stypox
parent 56595bd9d5
commit 68465b27fe
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23

View File

@ -130,7 +130,8 @@ final class YoutubeThrottlingParameterUtils {
"=\\s*function\\s*\\(\\s*([^)]*)\\s*\\)"; "=\\s*function\\s*\\(\\s*([^)]*)\\s*\\)";
private static final String EARLY_RETURN_REGEX = private static final String EARLY_RETURN_REGEX =
";\\s*if\\s*\\(\\s*typeof\\s+" + MULTIPLE_CHARS_REGEX + "+\\s*===?\\s*([\"'])undefined\\1\\s*\\)\\s*return\\s+"; ";\\s*if\\s*\\(\\s*typeof\\s+" + MULTIPLE_CHARS_REGEX
+ "+\\s*===?\\s*([\"'])undefined\\1\\s*\\)\\s*return\\s+";
private YoutubeThrottlingParameterUtils() { private YoutubeThrottlingParameterUtils() {
} }
@ -206,7 +207,7 @@ final class YoutubeThrottlingParameterUtils {
// If the throttling parameter could not be parsed from the URL, it means that there is // If the throttling parameter could not be parsed from the URL, it means that there is
// no throttling parameter // no throttling parameter
// Return null in this case // Return null in this case
return null; return null;
} }
} }
@ -240,7 +241,9 @@ final class YoutubeThrottlingParameterUtils {
@Nonnull @Nonnull
private static String fixupFunction(@Nonnull final String function) private static String fixupFunction(@Nonnull final String function)
throws Parser.RegexException { throws Parser.RegexException {
final String firstArgName = Parser.matchGroup1(FUNCTION_ARGUMENTS_REGEX, function).split(",")[0].trim(); final String firstArgName = Parser
.matchGroup1(FUNCTION_ARGUMENTS_REGEX, function)
.split(",")[0].trim();
final Pattern earlyReturnPattern = Pattern.compile( final Pattern earlyReturnPattern = Pattern.compile(
EARLY_RETURN_REGEX + firstArgName + ";", EARLY_RETURN_REGEX + firstArgName + ";",
Pattern.DOTALL); Pattern.DOTALL);