Comments (18)
I can't reproduce it. Can you enable the Logging flag at: https://github.com/HaarigerHarald/android-youtubeExtractor/blob/master/youtubeExtractor/src/main/java/at/huber/youtubeExtractor/YouTubeUriExtractor.java#L35 and post the logs.
from android-youtubeextractor.
To change that I have to use the source code? Can I directly from your repository?
from android-youtubeextractor.
I assume you are using android studio with gradle. Just copy the youtubeExtractor directory from the repo sources into your project root directory and replace the original dependency with:
compile project(':youtubeExtractor')
After that you can change the logging flag.
from android-youtubeextractor.
add directory from the repo sources into "MyProject\app\src"
add line in settings.gradle include ':youtubeExtractor'
add line in build.gradle (module: app) compile project(":youtubeExtractor")
Error:Configuration with name 'default' not found.
from android-youtubeextractor.
I think it should be in the "MyProject" root directory. I think the error means that it can't find the build.gradle file of the library.
Alternatively you can clone the repo, enable the logging flag and run the tests. If there is something wrong, one of them should fail.
from android-youtubeextractor.
Ok add directory. I don't log visible download lnk
generate_lnk = (Button)view.findViewById(R.id.generate_yt);
generate_lnk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//String youtubeLnk = lnk_yt.getText().toString();
//String youtubeLnk = "https://www.youtube.com/watch?v=qy54tU4KTs0";
String youtubeLnk = "https://www.youtube.com/watch?v=yRCznT1dEk8";
Log.d("TTTAG", "ASDDD + " + youtubeLnk);
YouTubeUriExtractor ytEx = new YouTubeUriExtractor(null) {
@Override
public void onUrisAvailable(String videoId, String videoTitle, SparseArray<YtFile> ytFiles) {
if (ytFiles != null) {
int itag = 22;
String downloadUrl = ytFiles.get(itag).getUrl();
Log.d("YTasdasd", "down_yt = " + downloadUrl);
}
}
};
ytEx.execute(youtubeLnk);
}
});
Android Monitor :
09-19 22:33:31.582 24147-24147/com.example.manie.myapplication D/TTTAG: ASDDD + https://www.youtube.com/watch?v=yRCznT1dEk8
09-19 22:33:31.601 24147-25163/com.example.manie.myapplication W/System: ClassLoader referenced unknown path: /system/framework/tcmclient.jar
09-19 22:33:33.312 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:137
09-19 22:33:33.315 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:248
09-19 22:33:33.316 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:136
09-19 22:33:33.317 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:247
09-19 22:33:33.318 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:135
09-19 22:33:33.319 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:244
09-19 22:33:33.321 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:134
09-19 22:33:33.323 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:243
09-19 22:33:33.325 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:133
09-19 22:33:33.327 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:242
09-19 22:33:33.328 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:160
09-19 22:33:33.329 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:278
09-19 22:33:33.330 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:140
09-19 22:33:33.331 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:171
09-19 22:33:33.339 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:249
09-19 22:33:33.354 24147-24156/com.example.manie.myapplication W/art: Suspending all threads took: 6.592ms
09-19 22:33:33.357 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:250
09-19 22:33:33.363 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:251
09-19 22:33:33.369 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:22
09-19 22:33:33.370 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:43
09-19 22:33:33.372 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:18
09-19 22:33:33.374 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:36
09-19 22:33:33.376 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:17
09-19 22:33:33.377 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Decipher signatures
09-19 22:33:34.184 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Decipher FunctURL: https://s.ytimg.com/yts/jsbin/player-pl_PL-vfljfBMmG/base.js
09-19 22:33:34.187 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Decipher Functname: Ey
09-19 22:33:34.200 24147-25163/com.example.manie.myapplication D/YouTubeUriExtractor: Decipher Function: var Ey=function(a){a=a.split("");Dy.ej(a,26);Dy.Sa(a,3);Dy.ej(a,16);Dy.zF(a,20);Dy.Sa(a,3);Dy.ej(a,46);Dy.Sa(a,2);Dy.ej(a,45);return a.join("")};var Dy={Sa:function(a,b){a.splice(0,b)}, ej:function(a){a.reverse()}, zF:function(a,b){var c=a[0];a[0]=a[b%a.length];a[b]=c}};
from android-youtubeextractor.
Interessting, this seems to be a problem with the javascript library or the webview on your device, since everything up to that point works fine. Did you run it on your phone/tablet or within the emulator?
And are there any other logs regarding the webview visible?
from android-youtubeextractor.
I run on phone (Sony Xperia Z3 Android 6). Other logs don't view webview
Youtube lnk = "https://www.youtube.com/watch?v=qy54tU4KTs0"
Log : ```
09-20 15:01:18.088 19077-19077/com.example.manie.myapplication W/System: ClassLoader referenced unknown path: /data/app/com.example.manie.myapplication-2/lib/arm
09-20 15:01:18.268 19077-19131/com.example.manie.myapplication D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
09-20 15:01:18.326 19077-19131/com.example.manie.myapplication I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: EGL 1.4 QUALCOMM build: Nondeterministic_AU_msm8974_LA.BF.1.1.3_RB1__release_AU (I741a3d36ca)
OpenGL ES Shader Compiler Version: E031.29.00.00
Build Date: 04/04/16 Mon
Local Branch: mybranch19053788
Remote Branch: quic/LA.BF.1.1.3_rb1.12
Local Patches: NONE
Reconstruct Branch: NOTHING
09-20 15:01:18.330 19077-19131/com.example.manie.myapplication I/OpenGLRenderer: Initialized EGL, version 1.4
09-20 15:01:18.555 19077-19077/com.example.manie.myapplication I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@74c5b08 time:32805772
09-20 15:01:22.745 19077-19077/com.example.manie.myapplication W/PathParser: Points are too far apart 4.000000596046461
09-20 15:01:23.672 19077-19077/com.example.manie.myapplication W/PathParser: Points are too far apart 4.000000596046461
09-20 15:01:24.593 19077-19077/com.example.manie.myapplication D/TTTAG: ASDDD + https://www.youtube.com/watch?v=qy54tU4KTs0
09-20 15:01:24.608 19077-19846/com.example.manie.myapplication W/System: ClassLoader referenced unknown path: /system/framework/tcmclient.jar
09-20 15:01:25.345 19077-19846/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:22
09-20 15:01:25.347 19077-19846/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:43
09-20 15:01:25.349 19077-19846/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:18
09-20 15:01:25.351 19077-19846/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:36
09-20 15:01:25.352 19077-19846/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:17
09-20 15:01:25.355 19077-19846/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:136
09-20 15:01:25.357 19077-19846/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:135
09-20 15:01:25.360 19077-19846/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:134
09-20 15:01:25.362 19077-19846/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:133
09-20 15:01:25.364 19077-19846/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:160
09-20 15:01:25.366 19077-19846/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:140
09-20 15:01:25.368 19077-19077/com.example.manie.myapplication D/YTasdasd: down_yt = https://r2---sn-5uh5o-f5fs.googlevideo.com/videoplayback?itag=22&id=o-AEG7JTMmUhThB4FcZP7Uyh2p8e7siLf-dMubWBzHuakX&mt=1474375691&initcwndbps=1147500&ip=188.146.46.145&key=yt6&pl=15&lmt=1471967456178280&source=youtube&signature=197B731D57419A042564B1876E327EA949D12B5F.3E554BDCC56ABB6045239EB6E3DC2E559D57198C&dur=233.151&mv=m&ratebypass=yes&mm=31&ms=au&expire=1474398086&mime=video%2Fmp4&requiressl=yes&upn=2HIW2HfYpQk&mn=sn-5uh5o-f5fs&sparams=dur%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&ipbits=0
Youtube lnk = "https://www.youtube.com/watch?v=pbOw-Hs6LSM"
Log : ```
09-20 15:11:28.686 29664-29664/com.example.manie.myapplication D/TTTAG: ASDDD + https://www.youtube.com/watch?v=pbOw-Hs6LSM
09-20 15:11:28.705 29664-3499/com.example.manie.myapplication W/System: ClassLoader referenced unknown path: /system/framework/tcmclient.jar
09-20 15:11:30.707 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:22
09-20 15:11:30.708 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:43
09-20 15:11:30.710 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:18
09-20 15:11:30.711 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:36
09-20 15:11:30.712 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:17
09-20 15:11:30.714 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:137
09-20 15:11:30.715 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:248
09-20 15:11:30.717 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:136
09-20 15:11:30.718 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:247
09-20 15:11:30.720 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:135
09-20 15:11:30.721 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:244
09-20 15:11:30.722 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:134
09-20 15:11:30.723 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:243
09-20 15:11:30.724 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:133
09-20 15:11:30.726 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:242
09-20 15:11:30.727 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:160
09-20 15:11:30.728 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:278
09-20 15:11:30.729 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:140
09-20 15:11:30.730 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:171
09-20 15:11:30.731 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:249
09-20 15:11:30.732 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:250
09-20 15:11:30.734 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Itag found:251
09-20 15:11:30.735 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Decipher signatures
09-20 15:11:32.142 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Decipher FunctURL: https://s.ytimg.com/yts/jsbin/player-pl_PL-vfljfBMmG/base.js
09-20 15:11:32.151 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Decipher Functname: Ey
09-20 15:11:32.178 29664-3499/com.example.manie.myapplication D/YouTubeUriExtractor: Decipher Function: var Ey=function(a){a=a.split("");Dy.ej(a,26);Dy.Sa(a,3);Dy.ej(a,16);Dy.zF(a,20);Dy.Sa(a,3);Dy.ej(a,46);Dy.Sa(a,2);Dy.ej(a,45);return a.join("")};var Dy={Sa:function(a,b){a.splice(0,b)}, ej:function(a){a.reverse()}, zF:function(a,b){var c=a[0];a[0]=a[b%a.length];a[b]=c}};
from android-youtubeextractor.
I've added to your code showing download url :
`
if (curJsFileName != null) {
mat = patEncSig.matcher(stream);
if (mat.find()) {
encSignatures.append(itag, mat.group(1));
}
}
mat = patUrl.matcher(encStream);
String url = null;
if (mat.find()) {
url = mat.group(1);
if (url != null) {
Meta meta = META_MAP.get(itag);
String finalUrl = URLDecoder.decode(url, "UTF-8");
Log.d("Itag url : ", finalUrl);
YtFile newVideo = new YtFile(meta, finalUrl);
ytFiles.put(itag, newVideo);
}`
Log url lnk is not signatures example https://www.youtube.com/watch?v=pbOw-Hs6LSM
http://wklej.org/id/2857357/
Other video is ok example https://www.youtube.com/watch?v=qy54tU4KTs0
http://wklej.org/id/2857356/
from android-youtubeextractor.
I found the cause of this error. When at get_video_info the parameter use_cipher_signature = true you don't download the video.
jeckman/YouTube-Downloader#9
ytdl-org/youtube-dl#897
http://api.gitnol.com/
http://ytapi.gitnol.com/
http://api.w3hills.com/ytcipher
from android-youtubeextractor.
Signature enciphered videos basically contain a signature that has to be "scrambled up" to produce a working link. The scramble up functions are defined in the player JavaScript file. So to produce a working link we need to run this javascript code. The logs suggest that the JavaScript library which uses the webview fails to run correctly. I suspect there is something wrong with the webview of your device. Can you try running it within an emulator, if that works we would at least know that it's device specific.
from android-youtubeextractor.
All my devices problems is the same.
But when I installed the application "advancedDownloader" on your phone, it all works properly.
from android-youtubeextractor.
Are you using proguard?
from android-youtubeextractor.
@HaarigerHarald
No, but I also tried to use the file "proguard.cfg" in your application AdvacedDownlaoder and still the same.
from android-youtubeextractor.
I just tested the youtube link you have given.And it's working just fine .This is the download link https://r1---sn-h557snlz.googlevideo.com/videoplayback?ms=au&gcr=in&ip=117.247.187.194&mt=1474523950&mv=m&source=youtube&initcwndbps=157500&id=o-AAROYF009wSaaqiuGoZpftl06yH44lms1VkydFDNgFek&mm=31&mn=sn-h557snlz&nh=IgpwcjAyLm1hYTAzKg03Mi4xNC4yMTEuMTEz&expire=1474546026&sparams=dur%2Cei%2Cgcr%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cnh%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&mime=video%2Fmp4&key=yt6&dur=204.149&lmt=1474108027869603&ratebypass=yes&itag=22&requiressl=yes&upn=VkH7U0ozDM0&ipbits=0&ei=CnXjV8PPMsf8oAPqmoiICA&pl=24&signature=7FD5DE99A25A43D2A7C78CCED6EEE247660D35BA.7EA2F83E502406512934DB1408669ABFDA4C9BCD .
Just add this line.it requires an additional parsing.
ytEx.setParseDashManifest(true);
from android-youtubeextractor.
@sunilsunny565
Don't help. You can send me your working on a project where you checked?
@sunilsunny565 Your download url can not open.
from android-youtubeextractor.
I'm sorry for the trouble. Already it works was enough to pass Activity class YouTubeUrlExtractor
replace
YouTubeUriExtractor ytEx = new YouTubeUriExtractor(null)
on
YouTubeUriExtractor ytEx = new YouTubeUriExtractor(activity)
I saw a step-by-step how to operate your library and noticed that checks every pass and how it will be null activity don't run js-evaluator.
from android-youtubeextractor.
When i am trying to download it is not working please help me
from android-youtubeextractor.
Related Issues (20)
- When passing link from edittext it will not working but direct it works why
- Giving nullpointerexepection when giving correct video url
- ytFiles returns null
- Issue resolved
- Too slow downloading...
- Something changed, extractor has failed! HOT 1
- youtube extractor choose Auto quality
- Extracted video stop automatically after every few seconds HOT 4
- No value for streamingData HOT 1
- Are it's working? HOT 10
- 360 videos not supported?
- YouTube JSR HOT 1
- Failed to resolve: com.github.HaarigerHarald:android-youtubeExtractor:master-SNAPSHOT HOT 4
- old user agent. How can i fix it ???? HOT 1
- Unknown host www.youtube.com HOT 1
- Move to new Youtube-Extractor library HOT 20
- ytFiles Are Always Returning as null. What am I doing wrong? HOT 27
- version is too old HOT 1
- Could not find com.github.HaarigerHarald:android-youtubeExtractor:master-SNAPSHOT.
- ytFiles is null in youtubeExtractor "onExtractionComplete"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-youtubeextractor.