verdana/scripts/tidal-get-tokens.js
2026-04-09 04:40:25 -04:00

26 lines
559 B
JavaScript

import Tidal from './../build/streamers/tidal/main.js'
const client = new Tidal({
tvToken: 'fX2JxdmntZWK0ixT',
tvSecret: '1Nn9AfDAjxrgJFJbKNWLeAyKGVGmINuXPPLHVXAvxAg='
})
const init = await client.initiateTokens()
console.log('Please open', init.url)
async function checkLoop() {
try {
const tokens = await client.checkTokens(init.deviceCode)
console.log(tokens)
process.exit()
} catch (err) {
console.log('Error checking tokens', err)
setTimeout(function () {
checkLoop()
}, 10000)
}
}
setTimeout(function () {
checkLoop()
}, 10000)