Skip to content

Instantly share code, notes, and snippets.

@ikai
ikai / generate_token.py
Created July 1, 2013 22:12
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.tools import run