From 92fdc0e3af51a6ec7fe110d4062716ff57bd1231 Mon Sep 17 00:00:00 2001 From: naveedhassan913 Date: Wed, 18 Dec 2019 04:29:02 +0500 Subject: [PATCH] Bug Fixed --- .../src/main/java/com/naveed/ytextractor/MainActivity.java | 5 +++-- .../com/naveed/ytextractor/YoutubeStreamExtractor.java | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/YoutubeExtractor/app/src/main/java/com/naveed/ytextractor/MainActivity.java b/YoutubeExtractor/app/src/main/java/com/naveed/ytextractor/MainActivity.java index ff802b3..82b1f0b 100644 --- a/YoutubeExtractor/app/src/main/java/com/naveed/ytextractor/MainActivity.java +++ b/YoutubeExtractor/app/src/main/java/com/naveed/ytextractor/MainActivity.java @@ -112,6 +112,7 @@ public void onClick(View p1) { @Override public void onExtractionDone(List adativeStream, final List muxedStream, YoutubeMeta meta) { + urls_li.clear(); for (YTMedia c:muxedStream) { urls_li.add(c.getUrl()); adapter.notifyDataSetChanged(); @@ -120,8 +121,8 @@ public void onExtractionDone(List adativeStream, final List mu urls_li.add(c.getUrl()); adapter.notifyDataSetChanged(); } - Toast.makeText(getApplicationContext(), meta.getTitle(), Toast.LENGTH_LONG).show(); - Toast.makeText(getApplicationContext(), meta.getAuthor(), Toast.LENGTH_LONG).show(); + //Toast.makeText(getApplicationContext(), meta.getTitle(), Toast.LENGTH_LONG).show(); + Toast.makeText(getApplicationContext(), meta.getAuthor(), Toast.LENGTH_LONG).show(); if (muxedStream.isEmpty()) { LogUtils.log("null ha"); diff --git a/YoutubeExtractor/app/src/main/java/com/naveed/ytextractor/YoutubeStreamExtractor.java b/YoutubeExtractor/app/src/main/java/com/naveed/ytextractor/YoutubeStreamExtractor.java index b549f7a..7c7d140 100644 --- a/YoutubeExtractor/app/src/main/java/com/naveed/ytextractor/YoutubeStreamExtractor.java +++ b/YoutubeExtractor/app/src/main/java/com/naveed/ytextractor/YoutubeStreamExtractor.java @@ -66,9 +66,9 @@ public void Extract(String VideoId) { protected void onPostExecute(Void result) { if (Ex != null) { listener.onExtractionGoesWrong(Ex); - } else + } else { listener.onExtractionDone(adaptiveMedia, muxedMedia, ytmeta); - + } } @Override @@ -149,7 +149,6 @@ private List parseUrls(YTMedia[] rawMedia) { if (url_part.startsWith("s=")) { String decodedSig=CipherManager.dechiperSig(URLDecoder.decode(url_part.replace("s=", "")), response.getAssets().getJs()); String FinalUrl; - if (tempUrl.contains("&lsig=")) { FinalUrl = tempUrl + "&sig=" + decodedSig; } else { @@ -160,6 +159,8 @@ private List parseUrls(YTMedia[] rawMedia) { LogUtils.log(FinalUrl); } } + }else{ + links.add(media); } }