Open FelipeRRM opened 4 years ago
okay
after doing some testing it seems that any youtube url which has adverts returns ytFiles as null
but youtube urls withou adverts work as normal..
for reference :
WITHOUT ADVERTS = https://www.youtube.com/watch?v=XVHReeBQFtA
WITH ADVERTS - https://www.youtube.com/watch?v=2mY7AFTtYwQ
first works fine an second returns null??
simple fix
change this line
private static final Pattern patCipher = Pattern.compile("\"cipher\"\\s*:\\s*\"(.+?)\"");
in YouTubeExtractor.java
to this
private static final Pattern patCipher = Pattern.compile("\"signatureCipher\"\\s*:\\s*\"(.+?)\"");
simple fix change this line
private static final Pattern patCipher = Pattern.compile("\"cipher\"\\s*:\\s*\"(.+?)\"");
in YouTubeExtractor.javato this
private static final Pattern patCipher = Pattern.compile("\"signatureCipher\"\\s*:\\s*\"(.+?)\"");
Tried that fix already but it still won't work any videos which are monetized with ads.
Maybe Another problem !!, can you give some links that don't work.
WITH ADVERTS - https://www.youtube.com/watch?v=2mY7AFTtYwQ
This link works.
Thanks for you guys help. But I try, still failed :( . For examples:
https://www.youtube.com/watch?v=AgFeZr5ptV8 https://www.youtube.com/watch?v=kxloC1MKTpg https://www.youtube.com/watch?v=LzCPcJHx5y8
WITH ADVERTS - https://www.youtube.com/watch?v=2mY7AFTtYwQ
This link works.
i am still having the same issue with the above link even after doing the cipher regex change...
for me it seems to be every url with adverts in the video that dont work... all other links without adverts work just fine for me?? wonder what it could be??
check this apk advancedDownloader-debug.zip
check this apk advancedDownloader-debug.zip
installed it but there is no app icon and cant open it from app settings am i doing something wrong?
EDIT: i went to youtube and shred vido to app and it seems to work okay.. i will test a few links that were not working for me
seems to work fine?? but wont work in my java code??
this is how i am using extractor:
new YouTubeExtractor(getContext()) {
@Override
public void onExtractionComplete(SparseArray<YtFile> ytFiles, VideoMeta vMeta) {
if (ytFiles != null) {
int itag = 22;
String downloadUrl = ytFiles.get(itag).getUrl();
timertask(downloadUrl, title);
} else {
Log.d("YT FILES WAS NULL ", "NULL");
}
}
}.extract("https://www.youtube.com/watch?v=2mY7AFTtYwQ", true, true);
and the timertask(downloadUrl, title); just passes the url and title to my player.
The problem in your code, I will check later.
being doing some exploring and i have opened 2 youtube url's one that works for me and one that dont work and i have found that the one that doesnt work the html sorce does not contain the cipher regex at all example::
WORKING - view-source:https://www.youtube.com/watch?v=SD4Z8dlZPd8 this contains the signatureCipher and i also noted that in the source there is "useCipher":true
NOT WORKING - view-source:https://www.youtube.com/watch?v=pPw_izFr5PA this does not contain signatureCipher or cipher and i also noted that in the source there is "useCipher":false
hope that helps?
@Inside4ndroid Do you still have a problem?
@Inside4ndroid Do you still have a problem?
It works. But sometimes it extracts the url like "https:\/\/r8---sn-ipoxu-un5l.googlevideo.com\/vide ... ..." with redundant "\" on every "/", sometimes good like "https://r5---sn-ipoxu-un5e.googlevideo.com/videoplay ... ...".
So, I need to replace all \/ to / by myself after extractor. Not sure whether anybody see the same issue.
@Inside4ndroid Do you still have a problem?
all seems to be okay and working well now pal...
although most urls return // as \/\/ so manually have to do a replace on returned urls which is not a aproblem really...
thanks for all your help :)
Hi all. When a try take link from new YouTubeExtractor(this) { @Override protected void onExtractionComplete(SparseArray<YtFile> ytFiles, VideoMeta videoMeta) { if (ytFiles != null) { int itag = 22; String newDownloadUrl = ytFiles.get(itag).getUrl(); System.out.println(newDownloadUrl); /*downloadFile.downloadImage(newDownloadUrl);*/ } else { System.out.println(ytFiles); } } }.extract("https://www.youtube.com/watch?v=2mY7AFTtYwQ",true,true);
i have a error : A/libc: Fatal signal 4 (SIGILL), code 2, fault addr 0xf6ee0477 in tid 12229 (AsyncTask #1). Can some help me?
Hi all. When a try take link from
new YouTubeExtractor(this) { @Override protected void onExtractionComplete(SparseArray<YtFile> ytFiles, VideoMeta videoMeta) { if (ytFiles != null) { int itag = 22; String newDownloadUrl = ytFiles.get(itag).getUrl(); System.out.println(newDownloadUrl); /*downloadFile.downloadImage(newDownloadUrl);*/ } else { System.out.println(ytFiles); } } }.extract("https://www.youtube.com/watch?v=2mY7AFTtYwQ",true,true);
i have a error : A/libc: Fatal signal 4 (SIGILL), code 2, fault addr 0xf6ee0477 in tid 12229 (AsyncTask #1). Can some help me?
i get the same as above it looks like youtube have changed something so the extractor returns this fatal error... we will have to wait for a fix ...
So far working with me, could you provide some links!
So far working with me, could you provide some links!
I tried 11 links, 8 can be extracted. There are 3 no. Can you help, the link is: https://www.youtube.com/watch?v=2n6YaiWrsPI https://www.youtube.com/watch?v=7ynrOq3vBq4 https://www.youtube.com/watch?v=-KqxoCdbzrc10
Getting same issue for some videos (null ytfiles)
I still have the same problem ,xibr can you help me
What a problem?10.02.2021, 08:52, "xingyanna" notifications@github.com: I still have the same problem ,xibr can you help me
—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.
Try this int tag = 18;
instead of
int tag = 22;
Most of the videos work, but some do not. This one for example: https://www.youtube.com/watch?v=6gkdOX-c7iI as ytFiles comes as null. I have enabled logging and tried extracting it and this is what I got on the logs: