Skip to content

Commit

Permalink
[YouTube] Fix throttling parameter decryption on Android
Browse files Browse the repository at this point in the history
Escape the curly brace in the regular expression used to parse the throttling
parameter decryption function to allow its compatibility on Android.
  • Loading branch information
Theta-Dev authored and AudricV committed Sep 10, 2022
1 parent 6a85836 commit 4905f74
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 4905f74

Please sign in to comment.