[YouTube] Fix throttling parameter decryption on Android
Escape the curly brace in the regular expression used to parse the throttling parameter decryption function to allow its compatibility on Android.
This commit is contained in:
parent
6a858368c8
commit
4905f74700
|
@ -137,7 +137,10 @@ public final class YoutubeThrottlingDecrypter {
|
|||
@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
|
||||
|
|
Loading…
Reference in New Issue