diff --git a/youtubeExtractor/src/main/java/at/huber/youtubeExtractor/YouTubeUriExtractor.java b/youtubeExtractor/src/main/java/at/huber/youtubeExtractor/YouTubeUriExtractor.java index 7e926c0..b80fa29 100644 --- a/youtubeExtractor/src/main/java/at/huber/youtubeExtractor/YouTubeUriExtractor.java +++ b/youtubeExtractor/src/main/java/at/huber/youtubeExtractor/YouTubeUriExtractor.java @@ -382,12 +382,12 @@ private boolean decipherSignature(final SparseArray encSignatures) throw String line; while ((line = reader.readLine()) != null) { sb.append(line); + sb.append(" "); } javascriptFile = sb.toString(); } finally { - if (reader != null) { + if (reader != null) reader.close(); - } urlConnection.disconnect(); } @@ -399,7 +399,7 @@ private boolean decipherSignature(final SparseArray encSignatures) throw if (LOGGING) Log.d(LOG_TAG, "Decipher Functname: " + decipherFunctionName); - Pattern patMainVariable = Pattern.compile("(var |)" + decipherFunctionName.replace("$", "\\$") + + Pattern patMainVariable = Pattern.compile("(var |\\s|,|;)" + decipherFunctionName.replace("$", "\\$") + "(=function\\((.{1,3})\\)\\{)"); String mainDecipherFunct; @@ -469,6 +469,7 @@ else if (javascriptFile.charAt(i) == '}') braces--; } } + if (LOGGING) Log.d(LOG_TAG, "Decipher Function: " + decipherFunctions); decipherViaWebView(encSignatures);