Skip to content
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

403 Forbidden Error #10

Open
roman-ku opened this issue Mar 23, 2018 · 2 comments
Open

403 Forbidden Error #10

roman-ku opened this issue Mar 23, 2018 · 2 comments

Comments

@roman-ku
Copy link

I am getting a 403 forbidden error. What am I doing wrong?

Traceback (most recent call last):
  File "C:\Users\johndoe\Desktop\youtube-watch-it-later\get_subs.py", line 184, in <module>
    raise error
  File "C:\Users\johndoe\Desktop\youtube-watch-it-later\get_subs.py", line 180, in <module>
    do_it()
  File "C:\Users\johndoe\Desktop\youtube-watch-it-later\get_subs.py", line 122, in do_it
    playlists = get_playlists(get_channel_for_user(username))
  File "C:\Users\johndoe\Desktop\youtube-watch-it-later\get_subs.py", line 64, in get_playlists
    response = urlopen(url+next_page)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 162, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 471, in open
    response = meth(req, response)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 581, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 509, in error
    return self._call_chain(*args)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 443, in _call_chain
    result = func(*args)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 589, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
PS C:\Users\johndoe\Desktop\youtube-watch-it-later>


@NicoHaase
Copy link

Have you tried running the program once more? For me, this has always worked out, as the error pops up every now and then

@ede1998
Copy link

ede1998 commented Nov 7, 2019

I had the same issue and solved it:
The problem was that the Youtube API was not enabled for my API key/project.
You can do this by going to https://console.developers.google.com/apis/library/youtube.googleapis.com , selecting your project and enabling the API.

Alternatively (that's how I found out about this), you can do your own local request with curl etc.
curl 'https://www.googleapis.com/youtube/v3/channels?part=id&forUsername=<SOMECHANNELNAME>&key=<YOURAPIKEY>'
This should give you more information about the error (I found the link to enable the Youtube API there.)

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

3 participants