aleqsunder / discord-streams-announcer-bot

Allows you to announce the start of the stream on various streaming platforms in your channel: youtube, trovo, twitch, kick, vkplay, caffeine, goodgame, openrec, nuum
13 stars 4 forks source link

Error Fixed for kick.com #11

Closed FRANkiller13 closed 5 months ago

aleqsunder commented 5 months ago

Thanks so much for your contribution! Sorry for long reply

The fetch option for some reason both on my work machine (with/without vpn etc) and on a remote server (Germany/Norway) gives a cloudflare error (identity verification), which I was just trying to get around with puppeteer. It worked (old puppeteer realization) correctly for a while, until it started giving validation problems again on some machines (idk why lol)

The problem with announcing a stream on kick.com is that they don't have an open API, but now, while I'm once again checking for an open API from kick and writing this post, I happened to find this implementation on puppeteer! See: https://github.com/BankkRoll/kick.com-api

Example of work:

import {KickApiWrapper} from 'kick.com-api'

async function main() {
  const kickApi = new KickApiWrapper({
    puppeteer: {
      args: ['--no-sandbox']
    }
  })

  try {
    const {livestream: {is_live: live = false} = {}} = await kickApi.fetchChannelData('uhmaayyze')
    console.log(live)
  } catch (error) {
    console.error(error)
  }
}

main()

For error "Missing libgbm.so.1" - sudo apt-get install libgbm-dev

And result:

image

So I now want to rewrite my implementation via puppeteer and use its wrapper for the kick api (simply because it works seamlessly on any of my systems without problems). Once again, thank you very much for the above problem!

aleqsunder commented 5 months ago

I've rewritten it, the changes are here: https://github.com/aleqsunder/discord-streams-announcer-bot/pull/12