I am writing a script that automatically schedules 5 Youtube Live broadcasts with different pre-set timings every week.
I have managed to schedule one broadcast on the Youtube API Try It Out page, but I am struggling to properly authenticate my Google Account in Pipedream.
I also only know how to write Python, and I am struggling to understand the Node.js boilerplate code available. I’m only interested in writing this code for myself, so I’m open to just hardcoding any secret IDs in (although that does sound quite dangerous).
I don’t know the steps to connect to the Youtube API with OAuth2.0 within Pipedream.
I see that I can use the Youtube Data API on Pipedream. Can this give me an access token that I can use in subsequent steps to create the broadcasts? How do I get the access token and provide it in python?
I’m sorry if this question is basic, I have never worked with APIs before!
Holy smokes! I did it! In case someone is lost like me, you can export your access token in the first step using node.js and returning this.youtube_data_api.$auth.oauth_access_token.
then fetch it in your python script with:
access_token = steps[“get_access_token”]["$return_value"]
then in python when building your api client (remember to import):
creds = Credentials(access_token)
youtube = googleapiclient.discovery.build(api_service_name, api_version, credentials=creds)