Library meant to improve working with youtube api in Go
go get -u github.com/Aracki/gotube/...
Document which explains how does OAuth 2.0 works for Mobile & Desktop Apps to access Google APIs: https://developers.google.com/youtube/v3/guides/auth/installed-apps
Steps for enabling Youtube API service:
- You need a Google Account to access the Google Developers Console, request an API key, and register your application.
- Create new project on https://console.developers.google.com
- Go to Credentials -> Create credentials -> OAuth client ID
- Select Web Application
- Authorized redirect URIs: http://localhost. (it is the endpoint to which the OAuth 2.0 server can send responses)
- Download
secret.json
file and save it to/etc/youtube/client_secret.json
. - Make sure YouTube Data API v3 is enabled.
- Start Go app.
- Stdout will print link. Open it up in your browser and select proper Youtube account
- It redirects you to the http://localhost/?state=state-token&code=_[code]_
- Paste the code from the URL to the shell.
- It will save credential file to:
~/.credentials/youtube-go-quickstart.json
. - Gotube initialized!