Skip to content

Commit 69951bf

Browse files
Update YouTubeExtractor.java
1 parent 0f578a3 commit 69951bf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

youtubeExtractor/src/main/java/at/huber/youtubeExtractor/YouTubeExtractor.java

+7
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public abstract class YouTubeExtractor extends AsyncTask<String, Void, SparseArr
8282
private static final Pattern patFunction = Pattern.compile("([{; =])([a-zA-Z$_][a-zA-Z0-9$]{0,2})\\(");
8383

8484
private static final Pattern patDecryptionJsFile = Pattern.compile("\\\\/s\\\\/player\\\\/([^\"]+?)\\.js");
85+
private static final Pattern patDecryptionJsFileWithoutSlash = Pattern.compile("/s/player/([^\"]+?).js");
8586
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*\\)");
8687

8788
private static final SparseArray<Format> FORMAT_MAP = new SparseArray<>();
@@ -310,6 +311,8 @@ private SparseArray<YtFile> getStreamUrls() throws IOException, InterruptedExcep
310311
encSignatures = new SparseArray<>();
311312

312313
mat = patDecryptionJsFile.matcher(streamMap);
314+
if(!mat.find())
315+
mat = patDecryptionJsFileWithoutSlash.matcher(streamMap);
313316
if (mat.find()) {
314317
curJsFileName = mat.group(0).replace("\\/", "/");
315318
if (decipherJsFileName == null || !decipherJsFileName.equals(curJsFileName)) {
@@ -340,6 +343,10 @@ private SparseArray<YtFile> getStreamUrls() throws IOException, InterruptedExcep
340343
mat2 = patEncSig.matcher(cipher);
341344
if (mat2.find()) {
342345
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);
343350
} else {
344351
continue;
345352
}

0 commit comments

Comments
 (0)