emresenyuva / youtube-music-api

Node.js Unoffical Youtube Music API
MIT License
116 stars 47 forks source link

Implement authenticated request + add getUserHistory #23

Open rhld16 opened 2 years ago

rhld16 commented 2 years ago

Here's a early implementation of authenticated requests for YouTube Music. This could eventually lead to this library being able add or remove songs from playlists but for now, the only authenticated method I added, for demonstration, is getUserHistory()

Here's an example of how authenticated requests would go:

const YoutubeMusicApi = require('../index.js')

const api = new YoutubeMusicApi()
api.initalize('INSERT_COOKIE_HERE')
.then(info => {
    api.getUserHistory().then(result => {
           console.log(result)
        })
})
rhld16 commented 2 years ago

@emresenyuva any chance you could check out this PR?

AlexInABox commented 1 year ago

hey you actually forgot to put const crypto = require('crypto') in the index file.