anlutro / botologist

Plugin-driven Python3 IRC
MIT License
5 stars 5 forks source link

Youtube streams #19

Open x89 opened 9 years ago

x89 commented 9 years ago

Streams don't appear if they're on Youtube.

anlutro commented 9 years ago

Find me a JSON API and I'll implement it

Alternatively, pull request or GTFO

x89 commented 9 years ago

https://developers.google.com/youtube/v3/live/docs/

pls

anlutro commented 9 years ago

This shit is literally impossible.

Need to implement a Google OAuth2 client: https://developers.google.com/youtube/v3/live/guides/auth/installed-apps - I assume the https://www.googleapis.com/auth/youtube.readonly scope is what we need.

You actually cannot finish the authentication process without visiting an URL in the browser. Not sure if I should do this manually before starting the bot or make it part of the bot code.

Could provide a redirect_uri using a plugin HTTP handler to read the initial token.

After the authentication process has finished, store the response in storage/google.json as you need the access_token to authorize future requests, and the refresh_token to generate a new access token when the current one expires.