Google App Engine Python - YouTube API v3 - Insufficient Permission -
i duplicated tasks api this video, unable translate format using youtube api.
here .py file:
import httplib2 import os import sys import jinja2 import webapp2 import logging import pprint oauth2client import tools oauth2client.client import flow_from_clientsecrets oauth2client.client import oauth2webserverflow oauth2client.client import accesstokenrefresherror oauth2client.tools import argparser, run_flow oauth2client.appengine import oauth2decorator apiclient.discovery import build google.appengine.ext.webapp import util google.appengine.ext.webapp import template decorator = oauth2decorator( client_id = '*my client id*', client_secret = '*my client secret*', scope='https://www.googleapis.com/auth/youtube') service = build("youtube", "v3") class mainhandler(webapp2.requesthandler): @decorator.oauth_required def (self): self.response.headers['content-type'] = 'text/plain' channels_list = service.channels().list( mine=true, part="id" ).execute(http = decorator.http()) self.response.out.write (pprint.pformat(channels_list)) app = webapp2.wsgiapplication ( [ ('/', mainhandler), (decorator.callback_path, decorator.callback_handler()), ], debug=true)
here traceback:
traceback (most recent call last): file "c:\program files (x86)\google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1535, in __call__ rv = self.handle_exception(request, response, e) file "c:\program files (x86)\google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1529, in __call__ rv = self.router.dispatch(request, response) file "c:\program files (x86)\google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1278, in default_dispatcher return route.handler_adapter(request, response) file "c:\program files (x86)\google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1102, in __call__ return handler.dispatch() file "c:\program files (x86)\google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 572, in dispatch return self.handle_exception(e, self.app.debug) file "c:\program files (x86)\google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 570, in dispatch return method(*args, **kwargs) file "c:\users\...\testapp\oauth2client\appengine.py", line 733, in check_oauth resp = method(request_handler, *args, **kwargs) file "c:\users\...\testapp\testapp.py", line 35, in ).execute(http = decorator.http()) file "c:\users\...\testapp\oauth2client\util.py", line 129, in positional_wrapper return wrapped(*args, **kwargs) file "c:\users\...\testapp\apiclient\http.py", line 723, in execute raise httperror(resp, content, uri=self.uri) httperror: <httperror 403 when requesting https://www.googleapis.com/youtube/v3/channels?part=id&mine=true&alt=json returned "insufficient permission"> info 2015-06-13 12:27:54,515 module.py:788] default: "get / http/1.1" 500 2278
i have checked , double-checked have both youtube data api , youtube analytics api enabled client id. have disabled them , re-enabled check, still getting error.
i new gae , methods, maybe not understanding error in traceback.
one note getting "importerror: no module named..." apiclient, httplib2, oauth2client, , uritemplate, moved folders directly app file (and didn't error again). not sure if moving directly folder causing errors.
well hope didn't waste anyone's time, if else has issue, found this question, , although didn't have memcache issue, revoked permission app user account using, refreshed app , gave permission again , seems working.
i guess google-side issue. spent time read question.
Comments
Post a Comment