Skip to content

Instantly share code, notes, and snippets.

@fxyw
fxyw / generate_token.py
Last active May 27, 2021 20:02 — forked from ikai/generate_token.py
Very simple Python sample to generate a refresh token for the YouTube API. Note that this will will also create a file called generate_token.py-oauth that contains this information.
#!/usr/bin/python
import httplib2
import os
import sys
from apiclient.discovery import build
from oauth2client.file import Storage
from oauth2client.client import flow_from_clientsecrets
from oauth2client import tools