Skip to content

Google API issues. #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ghost opened this issue Jan 29, 2016 · 1 comment
Open

Google API issues. #152

ghost opened this issue Jan 29, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 29, 2016

When using a browser/website API key, I get error 403 forbidden.

When using a server API key, I get error 403 forbidden.

Unhandled exception in thread started by <function run at 0x6f8699a9baa0>
Traceback (most recent call last):
  File "core/main.py", line 78, in run
    out = func(input.inp, **kw)
  File "plugins/youtube.py", line 76, in youtube
    j = http.get_json(search_api_url, **params)
  File "plugins/util/http.py", line 42, in get_json
    return json.loads(get(*args, **kwargs))
  File "plugins/util/http.py", line 30, in get
    return open(*args, **kwargs).read()
  File "plugins/util/http.py", line 84, in open
    return opener.open(request)
  File "/usr/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden

How exactly do you set up the google plugin?
I'm getting my api keys from here:
https://console.developers.google.com/apis/credentials

Thanks :)

@andyeff
Copy link
Contributor

andyeff commented Feb 8, 2016

Hi there,
@injuntony I made a randomised config that you could use for reference: https://gist.github.com/andyeff/05553ec8795067794e09

Single API keys are a straight forward "name": "key" mapping, whereas something like twitter which needs a few different things, has a nested set inside.

@doublebirdstrike The google plugin should have a @hook.api_key('google') line in it (or two, maybe) - that means it will read whatever key is in the config file named by "google" (check my example above).
Once you have the key in the config file, the plugin should be able to read it OK without any other changes.

Hopefully this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant