Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 1.09 KB

File metadata and controls

21 lines (16 loc) · 1.09 KB

oauth-youtube-live-stream-python

Python script that will oauth google and start live stream in youtube

Get Google Oauth credential

  1. Got to google cloud and enable YouTube Data API v3
  2. Click manage and generate Oauth Client ID credential, download and save the credentials.json in root directory
  3. Make sure you register your app in the Oauth consent screen

How to execute?

  • Run pip install -r requirements.txt
  • Add HSL stream url in video_url variable
  • Execute python oauth_stream_youtube.py

Or, Integrate as Frontend/Backend

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

License

License: MIT