Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on start project i have error: chat id invalid #5

Open
DifficultPhil opened this issue Mar 22, 2020 · 5 comments
Open

on start project i have error: chat id invalid #5

DifficultPhil opened this issue Mar 22, 2020 · 5 comments

Comments

@DifficultPhil
Copy link

image
help me please

@yuta0801
Copy link
Owner

the master branch was a working version that had not yet been released to npm
but It was a bit confusing, I moved it to develop branch, so try the following example in the master now

const YouTube = require('youtube-live-chat');

const yt = new YouTube('CHANNEL_ID_IS_HERE', 'APIKEY_IS_HERE');

yt.on('ready', () => {
  console.log('ready!')
  yt.listen(1000)
})

yt.on('message', data => {
  console.log(data.snippet.displayMessage)
})

yt.on('error', error => {
  console.error(error)
})

@DifficultPhil
Copy link
Author

DifficultPhil commented Mar 25, 2020

i clone file index.js,
i changed file server.js

const YouTube = require('./index.js')
//const YouTube = require('youtube-live-chat');

const yt = new YouTube('blabla', 'blabla');

yt.on('ready', () => {
    console.log('ready!')
    yt.listen(1000)
})

yt.on('message', data => {
    console.log(data.snippet.displayMessage)
})

yt.on('error', error => {
    console.error(error)
})

i have error

>node server.js
Can not find live.

but channel active and chat active
you can help me? :)

@DifficultPhil
Copy link
Author

i test develop version and test random yt channel and have this mesage

node server.js
No live stream found for channel UCgd9xnJbT5ZaKe8TzVKcG9Q
No live chat found
--- stopped listening ---
--- restartted listening ---
--- stopped listening ---

but channel is online, and have a chat

@yuta0801
Copy link
Owner

Hmm... I couldn't get the live stream for the channel even if I tried it with API Explorer
But maybe this is a channel dependent issue as I can get it on other channels (e.g. UCgd9xnJbT5ZaKe8TzVKcG9Q) without any problem..

@DifficultPhil
Copy link
Author

Apparently, you need to use some other methods, since this is not working...
If I find a solution, I will let you know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants