@@ -82,6 +82,7 @@ public abstract class YouTubeExtractor extends AsyncTask<String, Void, SparseArr
82
82
private static final Pattern patFunction = Pattern .compile ("([{; =])([a-zA-Z$_][a-zA-Z0-9$]{0,2})\\ (" );
83
83
84
84
private static final Pattern patDecryptionJsFile = Pattern .compile ("\\ \\ /s\\ \\ /player\\ \\ /([^\" ]+?)\\ .js" );
85
+ private static final Pattern patDecryptionJsFileWithoutSlash = Pattern .compile ("/s/player/([^\" ]+?).js" );
85
86
private static final Pattern patSignatureDecFunction = Pattern .compile ("(?:\\ b|[^a-zA-Z0-9$])([a-zA-Z0-9$]{2})\\ s*=\\ s*function\\ (\\ s*a\\ s*\\ )\\ s*\\ {\\ s*a\\ s*=\\ s*a\\ .split\\ (\\ s*\" \" \\ s*\\ )" );
86
87
87
88
private static final SparseArray <Format > FORMAT_MAP = new SparseArray <>();
@@ -310,6 +311,8 @@ private SparseArray<YtFile> getStreamUrls() throws IOException, InterruptedExcep
310
311
encSignatures = new SparseArray <>();
311
312
312
313
mat = patDecryptionJsFile .matcher (streamMap );
314
+ if (!mat .find ())
315
+ mat = patDecryptionJsFileWithoutSlash .matcher (streamMap );
313
316
if (mat .find ()) {
314
317
curJsFileName = mat .group (0 ).replace ("\\ /" , "/" );
315
318
if (decipherJsFileName == null || !decipherJsFileName .equals (curJsFileName )) {
@@ -340,6 +343,10 @@ private SparseArray<YtFile> getStreamUrls() throws IOException, InterruptedExcep
340
343
mat2 = patEncSig .matcher (cipher );
341
344
if (mat2 .find ()) {
342
345
sig = URLDecoder .decode (mat2 .group (1 ), "UTF-8" );
346
+ sig = sig .replace ("\u0026 " , "&" );
347
+ String [] test = sig .split ("&" );
348
+ sig = test [0 ];
349
+ Log .d (LOG_TAG , "SIG:" +sig );
343
350
} else {
344
351
continue ;
345
352
}
0 commit comments