From e8c2b77e41832fc26758babed8ab148d89150be9 Mon Sep 17 00:00:00 2001
From: Walkyst <41806921+Walkyst@users.noreply.github.com>
Date: Thu, 18 Aug 2022 18:28:03 +0300
Subject: [PATCH] Update n function regex

---
 .../source/youtube/YoutubeSignatureCipherManager.java       | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/main/src/main/java/com/sedmelluq/discord/lavaplayer/source/youtube/YoutubeSignatureCipherManager.java b/main/src/main/java/com/sedmelluq/discord/lavaplayer/source/youtube/YoutubeSignatureCipherManager.java
index 9666bfa56..7b9b7c97d 100644
--- a/main/src/main/java/com/sedmelluq/discord/lavaplayer/source/youtube/YoutubeSignatureCipherManager.java
+++ b/main/src/main/java/com/sedmelluq/discord/lavaplayer/source/youtube/YoutubeSignatureCipherManager.java
@@ -73,9 +73,9 @@ public class YoutubeSignatureCipherManager implements YoutubeSignatureResolver {
   private static final Pattern timestampPattern = Pattern.compile("(signatureTimestamp|sts)[\\:](\\d+)");
   private static final Pattern nFunctionPattern = Pattern.compile(
       "function\\(\\s*(\\w+)\\s*\\)\\s*\\{var" +
-          "\\s*(\\w+)=\\1\\.split\\(\"\"\\),\\s*(\\w+)=\\[.{0,5000}\\];\\s*\\3\\[\\d+\\].{0,5000}" +
-          "try\\{.{0,1000}\\}catch\\(\\s*(\\w+)\\s*\\)\\s*\\" +
-          "{\\s*return\"enhanced_except_.{0,100}\"\\s*\\+\\s*\\1\\s*}\\s*return\\s*\\2\\.join\\(\"\"\\)\\};", Pattern.DOTALL
+          "\\s*(\\w+)=\\1\\.split\\(\"\"\\),\\s*(\\w+)=(\\[.*?\\]);\\s*\\3\\[\\d+\\]" +
+          "(.*?try)(\\{.*?\\})catch\\(\\s*(\\w+)\\s*\\)\\s*\\" +
+          "{\\s*return\"enhanced_except_([A-z0-9-]+)\"\\s*\\+\\s*\\1\\s*}\\s*return\\s*\\2\\.join\\(\"\"\\)\\};", Pattern.DOTALL
   );
 
   private static final Pattern signatureExtraction = Pattern.compile("/s/([^/]+)/");