B4A Library YouTubeStreamFinder

johnmie

Active Member
Licensed User
Longtime User

Sounds great but how do I get the YTSInfo for a single video?
Would you, by chance, have a working example or a more complete code snippet available?
Thanks and best regards,
john m.
 

sentechnologies

Member
Licensed User
i used the following youtube videoid of this link to extract full streaming url
but the following error is raised
B4X:
errorcode=180&status=fail&reason=HTTP+is+not+supported.
 

drgottjr

Expert
Licensed User
Longtime User
you need https, not http
 

sentechnologies

Member
Licensed User
you need https, not http

i used https link only. and i added the code below

B4X:
sub CLV1_ItemClick(Index as Int, Value as object)
    yt.GetVideoInfo("EHUDBa4wPio")
   ' yt.GetVideoInfo("https://youtube.com/watch?v=EHUDBa4wPio")
end sub

Sub yt_ready(VideoId1 As String,YoutubeVideoInfo1 As YouTubeVideoInfo)
    Dim streams As Map
    Dim ytsi As YouTubeStreamInfo
    Dim su As StringUtils 'Require StringUtils library
    If YoutubeVideoInfo1 = Null Then
        ToastMessageShow("Failed to fetch video...",True)
        Log(yt.GetLastError(VideoId1))
    Else
        streams.Put(YoutubeVideoInfo1.Title,YoutubeVideoInfo1.Streams)
        ytsi = streams.GetValueAt(1)
        Log("Stream Link:" & su.DecodeUrl(ytsi.StreamUrl,"ISO-8859-1"))
        ExoPlay(su.DecodeUrl(ytsi.StreamUrl,"ISO-8859-1"))
    End If
End Sub

error received
B4X:
reason=HTTP+is+not+supported.&errorcode=180&status=fail
 
Last edited:

drgottjr

Expert
Licensed User
Longtime User
it would seem that somewhere in the pipeline someone is using http. (it is also possible - but unlikely - that the reason is bogus.)
do you know exactly what is in YoutubeVideoInfo? could there be a reference to http?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…