valerebron / usetube

search & get datas from youtube no google account needed
GNU General Public License v3.0
48 stars 18 forks source link

getPlaylistVideos #21

Closed Culla95 closed 1 year ago

Culla95 commented 2 years ago

How is it getPlaylistVideos used? I mean, I am using it this way:

const usetube = require('usetube')
async function youtube_tracks_from_playlist(url, isretry=false) {
    const data = await usetube.getPlaylistVideos(url);
    console.log("url: " + url)                                                           //       THESE LOGS ARE 
    console.log("data: " + data)                                                     //           ARE JUST TO
    console.log("data Inspect: " + util.inspect(data) )                    //   CHECK IF IT IS WORKING FINE
    console.log("data stringify: " + JSON.stringify(data))
    return data
}

But i get this in the logs, so the getPlaylistVideos is returning nothing:

url: https://youtube.com/playlist?list=PLoXvI0xCls_7WZpfvBNqlnZTMylyTvdo6
data: undefined
data Inspect: undefined
data stringify: undefined
valerebron commented 2 years ago

Hi Culla95,

yes indeed it should not work :) Check the Readme.md, getPlaylistVideos take only playlist_id in argument. In order to accept url, usetube need few more lines of code. If you're a dev, you're welcome to send a PR ... if you are not maybe I'll take some time to improve it.

Cheers !