Python script that will oauth google and start live stream in youtube
- Got to google cloud and enable
YouTube Data API v3
- Click manage and generate Oauth Client ID credential, download and save the
credentials.json
in root directory - Make sure you register your app in the Oauth consent screen
- Run
pip install -r requirements.txt
- Add HSL stream url in
video_url
variable - Execute
python oauth_stream_youtube.py
Call this url endpoint from Frotend to intitize Oauth request
https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=YOUR_GOOGLE_CLIENT_ID&redirect_uri=YOUR_BACKEND_REDIRECT_API&scope=YOUR_REQUIRED_PERMISSIONS&state=YOUR_STATE_CHARACTERS&access_type=offline
Create backend redirect_endpoint and execure this code to exchange code to accomplish other tasks