Skip to content

API Forbidden 403 Error #13

Description

@guptaronav

picklePicker--------------------------------------------------------------------
HTTPError Traceback (most recent call last)
in
772 welcome()
773 elif state == 1:
--> 774 enter_a_word()
775 elif state == 2:
776 play()

in enter_a_word()
289 #Return if Single Player
290 if active_sp == True:
--> 291 initialize_game()
292 state = 2
293 return

in initialize_game()
426 invalidTries = []
427 wordToGuess=().lower()
--> 428 wordDefinition = lookup_dictionary(wordToGuess)[0]
429
430 for i in range(0,len(wordToGuess),1):

in lookup_dictionary(word)
605 audiofileURL=getAudioURL()
606 print(audiofileURL)
--> 607 downloadMP3FromURL(audiofileURL)
608 short_def = response.json()[0]['shortdef']
609 print("short_def:",short_def)

in downloadMP3FromURL(url)
620 # Download an mp3 file
621 print("downloading mp3 file....")
--> 622 urllib.request.urlretrieve(url, filename)
623
624 def pronounce():

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py in urlretrieve(url, filename, reporthook, data)
245 url_type, path = splittype(url)
246
--> 247 with contextlib.closing(urlopen(url, data)) as fp:
248 headers = fp.info()
249

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
220 else:
221 opener = _opener
--> 222 return opener.open(url, data, timeout)
223
224 def install_opener(opener):

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py in open(self, fullurl, data, timeout)
529 for processor in self.process_response.get(protocol, []):
530 meth = getattr(processor, meth_name)
--> 531 response = meth(req, response)
532
533 return response

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py in http_response(self, request, response)
639 if not (200 <= code < 300):
640 response = self.parent.error(
--> 641 'http', request, response, code, msg, hdrs)
642
643 return response

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py in error(self, proto, *args)
567 if http_err:
568 args = (dict, 'default', 'http_error_default') + orig_args
--> 569 return self._call_chain(*args)
570
571 # XXX probably also want an abstract factory that knows when it makes

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)
501 for handler in handlers:
502 func = getattr(handler, meth_name)
--> 503 result = func(*args)
504 if result is not None:
505 return result

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
647 class HTTPDefaultErrorHandler(BaseHandler):
648 def http_error_default(self, req, fp, code, msg, hdrs):
--> 649 raise HTTPError(req.full_url, code, msg, hdrs, fp)
650
651 class HTTPRedirectHandler(BaseHandler):

HTTPError: HTTP Error 403: Forbidden
1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions