B4A Library [Class B4X ] YouTube V3

Hi all.
This is new version 2.00
Now is possibile NextPage and PreviousPage.
For any movie you have all details as:
Etag, Title, Description, PublisheAt, Urlpicture, categoryId, channelTitle, Definition, dimension, PrivacyStatus, dislikeCount, likeCount, viewCount, CommentCount, Duration
Note Duration return example: PT15M33S this is 15 minutes and 33 seconds.
And more.... this version is very fast look movie in youtube.


YouTubeList
Author:
Devil-App
Version: 2.05

YouTubeList
Author: Devil-App
Version: 2

  • Methods:
    • IsInitialized As Boolean

    • Tests whether the object has been initialized.
      [*]detailsvideo (id As String, Module As Object, EventName As String) As String


      Example
      yt.DeatilsVideo( id, Me, "details_page")

      id = Id Video YouTube type: "7lCDEYXw3mM"


      [*]initialize (key As String, Log as Boolean) As String

      [*]readingchannel (maxresult As Int, channelId As String, order As String, videoDuration As String, Module As Object, EventName As String) As String
      maxresult = 0 to 50
      channelId = example --> "UCe5xLaib7HmDPbBp132t_9A"
      order = date - rating - relevance - title - videoCount - viewCount ( if "" default value is relevance )
      videoDuration = any - long( > 20 min.) - medium ( 4 min. to 20 min. ) - short ( if "" default value is any )


      [*]readingchannelpage (nextpage As String, prevpage As String, maxresult As Int, channelId As String, order As String, videoDuration As String, Module As Object, EventName As String) As String


      Example
      For Next Page:
      yt.ReadingChannelPage(nextpage, "", maxresult, channelId, order, videoDuration, Me, "scroll_page")
      or
      For Previous Page
      yt.ReadingChannelPage("", prevpage, maxresult, channelId, order, videoDuration, Me, "scroll_page")

      maxresult = 0 to 50
      channelId = example --> "UCe5xLaib7HmDPbBp132t_9A"
      order = date - rating - relevance - title - videoCount - viewCount ( if "" default value is relevance )
      videoDuration = any - long( > 20 min.) - medium ( 4 min. to 20 min. ) - short ( if "" default value is any )


      [*]readingplaylist (maxresult As Int, playlistId As String, Module As Object, EventName As String) As String

      maxresult = 0 to 50
      playlistId = example --> "PL63F0C78739B09958"


      [*]readingplaylistpage (nextpage As String, prevpage As String, maxresult As Int, playlistId As String, Module As Object, EventName As String) As String


      Example
      For Next Page:
      yt.ReadingPlayListPage(nextpage, "", maxresult, playlistId, Me, "scroll_page")
      or
      For Previous Page
      yt.ReadingPlayListPage("", prevpage, maxresult, playlistId, Me, "scroll_page")

      maxresult = 0 to 50
      playlistId = example --> "PL63F0C78739B09958"


      [*]searchchannel (maxresult As Int, search As String, regionCode As String, videoDuration As String, Module As Object, EventName As String) As String

      maxresult = 0 to 50
      search = "Ricky Martin"
      regioncode = "IT" - "US" etc.
      videoDuration = any - long( > 20 min.) - medium ( 4 min. to 20 min. ) - short ( if "" default value is any )


      [*]searchchannelpage (nextpage As String, prevpage As String, maxresult As Int, search As String, regionCode As String, videoDuration As String, Module As Object, EventName As String) As String


      Example
      For Next Page:
      yt.SearchChannelPage(nextpage, "", maxresult, search, regionCode, videoDuration, Me, "scroll_page")
      or
      For Previous Page
      yt.SearchChannelPage("", prevpage, maxresult, search, regionCode, videoDuration, Me, "scroll_page")

      maxresult = 0 to 50
      search = "Ricky Martin"
      regioncode = "" is all or "IT" - "US" etc.
      videoDuration = any - long( > 20 min.) - medium ( 4 min. to 20 min. ) - short ( if "" default value is any )


      [*]searchplaylist (maxresult As Int, search As String, order As String, regionCode As String, videoDuration As String, Module As Object, EventName As String) As String

      maxresult = 0 to 50
      search = "Ricky Martin"
      order = date - rating - relevance - title - videoCount - viewCount ( if "" default value is revelance )
      regioncode = "IT" - "US" etc.
      videoDuration = any - long( > 20 min.) - medium ( 4 min. to 20 min. ) - short ( if "" default value is any )


      [*]searchplaylistpage (nextpage As String, prevpage As String, maxresult As Int, search As String, order As String, regionCode As String, videoDuration As String, Module As Object, EventName As String) As String


      Example
      For Next Page:
      yt.SearchPlayListPage(nextpage, "", maxresult, search, order, regionCode, videoDuration, Me, "scroll_page")
      or
      For Previous Page
      yt.SearchPlayListPage("", prevpage, maxresult, search, order, regionCode, videoDuration, Me, "scroll_page")

      maxresult = 0 to 50
      search = "Ricky Martin"
      order = date - rating - relevance - title - videoCount - viewCount ( if "" default value is revelance )
      regioncode = "IT" - "US" etc.
      videoDuration = any - long( > 20 min.) - medium ( 4 min. to 20 min. ) - short ( if "" default value is any )


      [*]searchvideo (maxresult As Int, search As String, order As String, regionCode As String, videoDuration As String, Module As Object, EventName As String) As String

      maxresult = 0 to 50
      search = "Ricky Martin"
      order = date - rating - relevance - title - videoCount - viewCount ( if "" default value is revelance )
      regioncode = "IT" - "US" etc. ( if "" default value is all world )
      videoDuration = any - long( > 20 min.) - medium ( 4 min. to 20 min. ) - short ( if "" default value is any )


      [*]searchvideopage (nextpage As String, prevpage As String, maxresult As Int, search As String, order As String, regionCode As String, videoDuration As String, Module As Object, EventName As String) As String


      Example
      For Next Page:
      yt.SearchVideoPage(nextpage, "", maxresult, search, order, "", "", Me, "scroll_page")
      or
      For Previous Page
      yt.SearchVideoPage("", prevpage, maxresult, search, order, "", "", Me, "scroll_page")

      nextpage = SVideo.nextpage(i)
      prevpage = SVideo.prevpage(i)
      maxresult = 0 to 50
      search = "Ricky Martin"
      order = date - rating - relevance - title - videoCount - viewCount ( if "" default value is revelance )
      regioncode = "IT" - "US" etc. ( if "" default value is all world )
      videoDuration = any - long( > 20 min.) - medium ( 4 min. to 20 min. ) - short ( if "" default value is any )




B4X:
Sub Activity_Create(FirstTime As Boolean)

    yt.Initialize(key)

    'For details Id Video
    'You have as Return:
    'Etag, Title, Description, PublisheAt, Urlpicture, categoryId, channelTitle, Definition, dimension,
    'PrivacyStatus, dislikeCount, likeCount, viewCount, CommentCount, Duration
    'Note Duration return example: PT15M33S this is 15 minutes and 33 seconds.
    'yt.DetailsVideo(id, Me,  "details_page")


    'yt.SearchVideo(maxresult, search, order, "", "", Me, "search_video")
    'yt.SearchVideoPage(nextpage, prevpage, maxresult, search, order, "", "", Me, "scroll_search_video")

    'yt.ReadingChannel(maxresult, channelId, order, "", Me, "reading_channel")
    'yt.ReadingChannelPage(nextpage, prevpage, maxresult, channelId, order, "", Me, "scroll_reading_channel")

    'yt.ReadingPlayList( maxresult, playlist, Me, "reading_playlist")
    yt.ReadingPlayListPage(nextpage, prevpage,maxresult, playlist, Me, "scroll_reading_playlist")

    'yt.SearchChannel( maxresult, search, "", "", Me, "search_channel")
    'yt.SearchChannelPage(nextpage, prevpage, maxresult, search, "", "", Me, "scroll_search_channel")

    'yt.SearchPlayList(maxresult, search, "", "", "", Me, "search_playlist")
    'yt.SearchPlayListPage(nextpage, prevpage, maxresult, search, "", "", "", Me, "scroll_search_playlist")






End Sub

Sub details_page(DVideo As DetailsVideo)

       LogColor("Title: " & DVideo.title(0), Colors.Blue)
        Log("Description: " & DVideo.description(0) )
        Log("Pubblished At: " &  DVideo.publishedAt(0) )
        Log("Url Pictures: " &  DVideo.urlpicture(0) )
        Log("Etag: " &  DVideo.Etag(0) )
        Log("CategoryId: " &  DVideo.CategoryId(0) )
        Log("ChannelTitle: " &  DVideo.channelTitle(0) )
        Log("Definition: " &  DVideo.Definition(0) )
        Log("Dimension: " &  DVideo.Dimension(0) )
        Log("PrivacyStatus: " &  DVideo.PrivacyStatus(0) )
        Log("disLikeCount: " &  DVideo.DislikeCount(0) )
        Log("LikeCount: " &  DVideo.LikeCount(0) )
        Log("ViewCount: " &  DVideo.ViewCount(0) )
        Log("CommentCount: " &  DVideo.CommentCount(0) )
        Log("Duration: " &  DVideo.Duration(0) )


End Sub

Sub search_video(SVideo As SearchVideo)



    LogColor("Total Results: " & SVideo.totalResults, Colors.Red)

    Dim p1 As Int
    For p1 = 0 To SVideo.TotalChannel - 1
        LogColor("Title: " & SVideo.title(p1), Colors.Blue)
        Log("Description: " & SVideo.description(p1) )
        Log("Pubblished At: " &  SVideo.publishedAt(p1) )
        Log("Url Pictures: " &  SVideo.urlpicture(p1) )
        Log("ID Video: " & SVideo.idVideo(p1) )
        Log("Next Page: " & SVideo.nextpage(p1))
        Log("Prev Page: " & SVideo.prevpage(p1))
    Next



End Sub

Sub reading_channel(RChannel As ReadChannel)

    LogColor("Total Results: " & RChannel.totalResults, Colors.Red)

    Dim p1 As Int
    For p1 = 0 To RChannel.TotalChannel - 1
        LogColor("Title: " & RChannel.title(p1), Colors.Blue)
        Log("Description: " & RChannel.description(p1) )
        Log("Pubblished At: " &  RChannel.publishedAt(p1) )
        Log("Url Pictures: " &  RChannel.urlpicture(p1) )
        Log("ID Channel: " &  RChannel.idChannel(p1) )
        Log("Play List ID: " & RChannel.playlistid(p1) )
    Next

End Sub




Sub reading_playlist(RPList As ReadingPlayList)

    LogColor("Total Results: " & RPList.totalResults, Colors.Red)

    Dim p1 As Int
    For p1 = 0 To RPList.TotalChannel - 1
        LogColor("Title: " & RPList.title(p1), Colors.Blue)
        Log("Description: " & RPList.description(p1) )
        Log("Pubblished At: " &  RPList.publishedAt(p1) )
        Log("Url Pictures: " &  RPList.urlpicture(p1) )
        Log("ID Video: " & RPList.idVideo(p1) )
    Next

End Sub

Sub search_channel(SChannel As SearchChannel)

    LogColor("Total Results: " & SChannel.totalResults, Colors.Red)

    Dim p1 As Int
    For p1 = 0 To SChannel.TotalChannel - 1
        LogColor("Title: " & SChannel.title(p1), Colors.Blue)
        Log("Channel Title: " & SChannel.ChannelTitle(p1))
        Log("Description: " & SChannel.description(p1) )
        Log("Pubblished At: " &  SChannel.publishedAt(p1) )
        Log("Url Pictures: " &  SChannel.urlpicture(p1) )
        Log("ID Channel: " &  SChannel.ChannelId(p1) )
    Next

End Sub



Sub search_playlist(SPList As SearchPlayList)

    LogColor("Total Results: " & SPList.totalResults, Colors.Red)

    Dim p1 As Int
    For p1 = 0 To SPList.TotalChannel - 1
        LogColor("Title: " & SPList.title(p1), Colors.Blue)
        Log("Channel Title: " & SPList.ChannelTitle(p1))
        Log("Description: " & SPList.description(p1) )
        Log("Pubblished At: " &  SPList.publishedAt(p1) )
        Log("Url Pictures: " &  SPList.urlpicture(p1) )
        Log("ID PlayList: " &  SPList.PlayListId(p1) )
    Next

End Sub



'**********Scroll

Sub scroll_search_video(Svideo As SearchVideo)

        LogColor("Total Results: " & Svideo.totalResults, Colors.Red)

    Dim p1 As Int
    For p1 = 0 To Svideo.TotalChannel - 1
        LogColor("Title: " & Svideo.title(p1), Colors.Blue)
        Log("Description: " & Svideo.description(p1) )
        Log("Pubblished At: " &  Svideo.publishedAt(p1) )
        Log("Url Pictures: " &  Svideo.urlpicture(p1) )
        Log("ID Video: " & Svideo.idVideo(p1) )
        Log("Next Page: " & Svideo.nextpage(p1))
        Log("Prev Page: " & Svideo.prevpage(p1))
        If p1 = 0 Then
            nextpage = Svideo.nextpage(p1)
            prevpage = Svideo.prevpage(p1)
        End If
    Next

 

End Sub


Sub scroll_reading_channel(RChannel As ReadChannel)

    LogColor("Total Results: " & RChannel.totalResults, Colors.Red)


    Dim p1 As Int
    For p1 = 0 To RChannel.TotalChannel - 1
        LogColor("Title: " & RChannel.title(p1), Colors.Blue)
        Log("Description: " & RChannel.description(p1) )
        Log("Pubblished At: " &  RChannel.publishedAt(p1) )
        Log("Url Pictures: " &  RChannel.urlpicture(p1) )
        Log("ID Channel: " &  RChannel.idChannel(p1) )
        Log("Play List ID: " & RChannel.playlistid(p1) )
        If p1 = 0 Then
            nextpage = RChannel.nextpage(p1)
            prevpage = RChannel.prevpage(p1)
        End If
    Next

End Sub

Sub scroll_reading_playlist(RPList As ReadingPlayList)

    LogColor("Total Results: " & RPList.totalResults, Colors.Red)

    Dim p1 As Int
    For p1 = 0 To RPList.TotalChannel - 1
        LogColor("Title: " & RPList.title(p1), Colors.Blue)
        Log("Description: " & RPList.description(p1) )
        Log("Pubblished At: " &  RPList.publishedAt(p1) )
        Log("Url Pictures: " &  RPList.urlpicture(p1) )
        Log("ID Video: " & RPList.idVideo(p1) )
        If p1 = 0 Then
            nextpage = RPList.nextpage(p1)
            prevpage = RPList.prevpage(p1)
        End If
    Next

End Sub

Sub scroll_search_channel(SChannel As SearchChannel)

    LogColor("Total Results: " & SChannel.totalResults, Colors.Red)

    Dim p1 As Int
    For p1 = 0 To SChannel.TotalChannel - 1
        LogColor("Title: " & SChannel.title(p1), Colors.Blue)
        Log("Channel Title: " & SChannel.ChannelTitle(p1))
        Log("Description: " & SChannel.description(p1) )
        Log("Pubblished At: " &  SChannel.publishedAt(p1) )
        Log("Url Pictures: " &  SChannel.urlpicture(p1) )
        Log("ID Channel: " &  SChannel.ChannelId(p1) )
        If p1 = 0 Then
            nextpage = SChannel.nextpage(p1)
            prevpage = SChannel.prevpage(p1)
        End If
    Next

End Sub

Sub scroll_search_playlist(SPList As SearchPlayList)

    LogColor("Total Results: " & SPList.totalResults, Colors.Red)

    Dim p1 As Int
    For p1 = 0 To SPList.TotalChannel - 1
        LogColor("Title: " & SPList.title(p1), Colors.Blue)
        Log("Channel Title: " & SPList.ChannelTitle(p1))
        Log("Description: " & SPList.description(p1) )
        Log("Pubblished At: " &  SPList.publishedAt(p1) )
        Log("Url Pictures: " &  SPList.urlpicture(p1) )
        Log("ID PlayList: " &  SPList.PlayListId(p1) )
        If p1 = 0 Then
            nextpage = SPList.nextpage(p1)
            prevpage = SPList.prevpage(p1)
        End If
    Next

End Sub

'Next Page
Sub Activity_Click

    Log("*********************")
    'yt.SearchVideoPage(nextpage, "", maxresult, search, order, "", "", Me, "scroll_search_video")
    'yt.ReadingChannelPage(nextpage, "", maxresult, channelId, order, "", Me, "scroll_reading_channel")
    'yt.ReadingPlayListPage(nextpage, "",maxresult, playlist, Me, "scroll_reading_playlist")
    'yt.SearchChannelPage(nextpage, "", maxresult, search, "", "", Me, "scroll_search_channel")
    yt.SearchPlayListPage(nextpage, "", maxresult, search, "", "", "", Me, "scroll_search_playlist")


End Sub

'Previous Page
Sub Activity_LongClick
    Log("*********************")
    'yt.SearchVideoPage("", prevpage, maxresult, search, order, "", "", Me,  "scroll_search_video")
    'yt.ReadingChannelPage("", prevpage, maxresult, channelId, order, "", Me, "scroll_reading_channel")
    'yt.ReadingPlayListPage("", prevpage,maxresult, playlist, Me, "scroll_reading_playlist")
    'yt.SearchChannelPage("", prevpage, maxresult, search, "", "", Me, "scroll_search_channel")
    yt.SearchPlayListPage("", prevpage, maxresult, search, "", "", "", Me, "scroll_search_playlist")

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

This example that you can download ( Apk ) utilize also ULV By Informatix and Universal Image Loader By Don Mandred



IF YOU TRY APK --> CLICK HERE
IN ATTACHMENT CLASS COMPATIBLE FOR B4X ( B4A, B4i )


 

Attachments

  • youtube.bas
    33.6 KB · Views: 475
Last edited:

rafaelbr20

Member
Licensed User
Longtime User
Hi Marco. Could you send me last Version ? I´m using 2.03 and i am having problems ! Thanks
 

rafaelbr20

Member
Licensed User
Longtime User
Hi Rafael, this is last.
What is the problem ?

The last version is Version: 2.05 right ?

The problem I'm having, is that the library is taking almost 50 seconds to display the result. Is there any way I can display a message that it is loading ?
 

DonManfred

Expert
Licensed User
Longtime User

MarcoRome

Expert
Licensed User
Longtime User
The last version is Version: 2.05 right ?

The problem I'm having, is that the library is taking almost 50 seconds to display the result. Is there any way I can display a message that it is loading ?

Strain...if you see movie i dont see this problem. Do you tried with another channel ? And how many movies at a time you request ... it's clear that if you enter 1000 ... it will take more time. Set up upload for 50
 

Duque

Active Member
Licensed User
Longtime User
- Will this library show the real Youtube video URL (i.e. a very long string)?
- The APK in thread #1 is no longer available.


I would also like to know...

Will this library show the real Youtube video URL
in this way I could reproduce with exoplayer...
 

AnandGupta

Expert
Licensed User
Longtime User
Hi MarcoRome,

You have marked two message #2 aand #3 as reserved. What you intend to add in them ? since you already reached version 3.
I hope a couple of example projects, will do great, for beginners.

Regards,

Anand
 

MarcoRome

Expert
Licensed User
Longtime User
Hi MarcoRome,

You have marked two message #2 aand #3 as reserved. What you intend to add in them ? since you already reached version 3.
I hope a couple of example projects, will do great, for beginners.

Regards,

Anand
For now nothing
 

Edgardo PuntoCom

Member
Licensed User
Longtime User
Is the library different to .bas file shared in the first post?

Will I get something better than the .bas file if I give a donation?
 
Top