B4A Library YouTubeStreamFinder

warwound

Expert
Licensed User
Longtime User

No i can't think of any alternative way to detect whether a video is playable.
If You Tube have made changes to the web service that this library uses then that may be the end of being able to tell if a video is playable - the web service was never an official web service for developers to use, so You Tube have no obligations to maintain it or maintain any of it's functionality .

Martin.
 

itgirl

Active Member
Licensed User
Longtime User
Hello and thanks for this great Lib , but I'm guessing there's a problem with the timestamp of video , it doesnt return the actual timestamp of the video
 

sergiones

Member
Licensed User
Longtime User
Hi guys. I can't believe, I'm working on a robot that extract the links from youtube for a month. Basic4Android rocks, it's unbelievable. This guys has solution for everything. Ok, I want to share about what I learned from my robots. Some videos can be played even without signature. At first, signature was one of my required parameters, but I found that some videos works without a signature.

Please note that my intention is to play 3gp videos only. I'm from Brazil and the 3g connections big s#cks. Believe me, it's a dial up connection. So my intention is to parse and isolate the 3gp from youtube.com response, what I have done sucessfully.

I.M.O, the "sorry, this video cannot be played" is not a missing parameter from the stream request, but the codec used to create the video before the upload. I realized that the videos that shows "sorry, this video cannot be played", cannot be played even on youtube at 144p. They are the same, so sometimes Youtube display the 144p resolution option, but if you click on it nothing happens, the resolution keeps 240 or more. Because Youtube automatically tests the 144p and get empty, it changes to 240p or more. My robots cannot identify if the video is playable or not, so the "sorry, this video cannot be played" is inevitable.

I would say that it's not a missing parameter since I have test thousands of links and there is no co-relation between parameters. Hope this helps some way. If I can help in something just let me know.
 

Attachments

  • Caraca.jpg
    309 KB · Views: 216

warwound

Expert
Licensed User
Longtime User
warwound, why in most of searcher is coming: Failed to find streams for.... ???

To be honest i don't know!
I don't use this library - i created it some time ago for other forum members but have no experience of using it.
Hopefully another member can answer your question.

Martin.
 

itgirl

Active Member
Licensed User
Longtime User
To be honest i don't know!
I don't use this library - i created it some time ago for other forum members but have no experience of using it.
Hopefully another member can answer your question.

Martin.
Well it's a really nice Lib and can be upgraded to get alot more infos like :
publishedAt
description
channelTitle
liveBroadcastContent

i really hope you make an update for this nice Lib or maybe you can give us the Lib code which be much nicer lol
 

sergiones

Member
Licensed User
Longtime User
É Alberto, foi o primeiro nome que me apareceu na cabeça quando percebi o tamanho da minha área de trabalho, hehe. Esse pessoal do Basic4Android é muito bom. Não lembro de ver uma linguagem eficiente (até mesmo pelo tamanho do apk) e estável há décadas.
 

warwound

Expert
Licensed User
Longtime User
i really hope you make an update for this nice Lib or maybe you can give us the Lib code which be much nicer lol

I won't have time to look at updating the library for a week or more - got lots of work to get done!
If you want a copy of the Eclipse library project so you can look at updating it yourself just let me know.

Martin.
 

sergiones

Member
Licensed User
Longtime User
warwound, why in most of searcher is coming: Failed to find streams for.... ???
I don't know this lib, but "Failed to find stream" may be related to the particular resolution that cannot be streamed. What parameters are you sending to this lib?
 

itgirl

Active Member
Licensed User
Longtime User
I won't have time to look at updating the library for a week or more - got lots of work to get done!
If you want a copy of the Eclipse library project so you can look at updating it yourself just let me know.

Martin.

That would be amazing and really helpful , I would love a copy of the Lib source... i really appreciate it and thanks million times
 

sergiones

Member
Licensed User
Longtime User
I won't have time to look at updating the library for a week or more - got lots of work to get done!
If you want a copy of the Eclipse library project so you can look at updating it yourself just let me know.

Martin.

Guys, I think it's not a lib issue. As I said early I did a robot for that and I'm having no response for some streams. I.M.O. the problem is the codec used to build the video file, before the upload. Take this example: Search youtube for

Relaxin' with the Miles Davis Quintet (Full Album)

I can get the HD stream, but cannot the 144p. Aparently the link for 144p exists, but it returns nothing (I mean, a clean http body response). If you send this link to a action_view you will receive the famous "Sorry, this video cannot be played". This lib may check the link before playing and gives you "Failed to find streams for", what is good because you can manage the error by yourself. If I'm wrong, please let me know.
 

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
Warwound,

I don´t know why some times the library can not find the stream.

Inside the library you use this GOOGLE API?

https://gdata.youtube.com/feeds/api/videos?q=android&orderby=published&alt=json&max-results=10

Look this example is not working:
YouTubeStreamFinder1.GetVideoInfo("ng9JuX2YuAk")


I think is the same, like this call: https : // www.youtube.com/watch?v=ng9JuX2YuAk

In the "media$content" you get the URL, like the sample below no?
"url": "rtsp://r1---sn-cg07luek.c.youtube.com/CiILENy73wIaGQliv9r4JpOXkRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp"
 

warwound

Expert
Licensed User
Longtime User
@Alberto Iglesias

No the YouTueStreamFinder connects to an undocumented web service:

B4X:
private static final String YOUTUBE_VIDEO_INFORMATION_URL = "http://www.youtube.com/get_video_info?asv=3&el=detailpage&video_id=";

Try appending a 'video id' to that URL and paste it into a browser - what do you get?

Martin.
 

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
I get this file (attachment) but I see the almost same information, but scrambled

What the advantage in use this undocumented if the documented api I get the streaming url? like this

rtsp://r1---sn-cg07luek.c.youtube.com/CiILENy73wIaGQliv9r4JpOXkRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp

?
 

Attachments

  • get_video_info.zip
    4.1 KB · Views: 213

warwound

Expert
Licensed User
Longtime User
@Alberto Iglesias

When i first created the YouTubeStreamFinder, the official web service only provided URLs to low quality (think of small screen low bitrate .3GP) video.
Re-read post #1 in this thread:
So i'd guess that since that post (June 2012) the official You Tube web service has been updated and now supports high quality video - or does that link in your last post still only get you a low quality video?

Martin.
 

sergiones

Member
Licensed User
Longtime User

Legal Alberto, parabéns pelo sucesso! Eu também tentei algumas outras linguagens como xamarim e sua antiga versão monodevelopment além do próprio java. Mas nada se comparou à facilidade, estabilidade e compactação do basic4android. Obrigado pela força, o que eu puder ajudar também pode contar comigo. Abraço!
 

KZero

Active Member
Licensed User
Longtime User
Just if anyone want to still use this great library

this library working with older android versions and always fail on the newer versions

to make it work with the newer versions you should decode the Stream url


B4X:
Dim su As StringUtils 'Require StringUtils library
VV.LoadVideo("http",su.DecodeUrl(YTSInfo.StreamUrl,"ISO-8859-1"))
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…