I'd like to set up my code to run daily but the only roadblock is OAuth. I have to login to my Google account each time I run my code to obtain the authorization code to access my Youtube data. I'm trying to find a way to either store the authorization code automatically without me needing to follow the url and manually copy it, or to create some sort of credentials that I can store in my script to use anytime authorization is needed.
youtubeAnalytics = get_service()
result = execute_api_request(
youtubeAnalytics.reports().query,
ids='channel==MINE',
startDate=format_week,
endDate=format_today,
metrics='estimatedMinutesWatched,views,likes,subscribersGained',
dimensions='video',
sort='-views',
maxResults=20
)
This line is what prompts the url I need to access for the authorization code.
I was unable to find documentation to support the idea that storing credentials may be possible without the ues of OAuth 2.0.