Merge pull request #925 from Theta-Dev/fix-td-regex
[YouTube] Fix throttling parameter decryption on Android
This commit is contained in:
commit
58b09cf78b
|
@ -137,7 +137,10 @@ public final class YoutubeThrottlingDecrypter {
|
||||||
@Nonnull
|
@Nonnull
|
||||||
private static String parseWithRegex(final String playerJsCode, final String functionName)
|
private static String parseWithRegex(final String playerJsCode, final String functionName)
|
||||||
throws Parser.RegexException {
|
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);
|
Pattern.DOTALL);
|
||||||
return validateFunction("function "
|
return validateFunction("function "
|
||||||
+ functionName
|
+ functionName
|
||||||
|
|
Loading…
Reference in New Issue