Skip to content

Commit

Permalink
Merge pull request #925 from Theta-Dev/fix-td-regex
Browse files Browse the repository at this point in the history
[YouTube] Fix throttling parameter decryption on Android
  • Loading branch information
AudricV authored Sep 10, 2022
2 parents 6a85836 + 4905f74 commit 58b09cf
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ private static String parseWithParenthesisMatching(final String playerJsCode,
@Nonnull
private static String parseWithRegex(final String playerJsCode, final String functionName)
throws Parser.RegexException {
final Pattern functionPattern = Pattern.compile(functionName + "=function(.*?};)\n",
// Escape the curly end brace to allow compatibility with Android's regex engine
// See https://stackoverflow.com/q/45074813
//noinspection RegExpRedundantEscape
final Pattern functionPattern = Pattern.compile(functionName + "=function(.*?\\};)\n",
Pattern.DOTALL);
return validateFunction("function "
+ functionName
Expand Down

0 comments on commit 58b09cf

Please sign in to comment.