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

Youtube error 403: Access Not Configured. YouTube Data API #255

Open
AIIX opened this issue Feb 21, 2020 · 18 comments
Open

Youtube error 403: Access Not Configured. YouTube Data API #255

AIIX opened this issue Feb 21, 2020 · 18 comments

Comments

@AIIX
Copy link

AIIX commented Feb 21, 2020

Using Latest PyPi Version.
Error:
pafy.util.GdataError: Youtube Error 403: Access Not Configured. YouTube Data API has not been used in product 422897895433 before or it is disabled.

@tizonia
Copy link

tizonia commented Feb 21, 2020

I'm also seeing this error with Tizonia (https://github.com/tizonia/tizonia-openmax-il)

@nigh8w0lf
Copy link

getting this error when I try to launch mpsyt from terminal.
pafy.util.GdataError: Youtube Error 403: Access Not Configured. YouTube Data API has not been used in project 422897895433 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=422897895433 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.

@samidten
Copy link

having the same issue. tried changing api key but still no luck :(

@mateuszr
Copy link

According to this answer: https://stackoverflow.com/questions/40355794/access-not-configured-youtube-data-api-has-not-been-used-in-project-60894180825 if you haven't been using your API key for some time it might not work. Go and create a new application, create new API, Make sure that you add OAuth (even if you don't plan to use it) and later add Youtube API v3 to your app.

For me also the old API stopped working and the new one is now ok.

@tizonia
Copy link

tizonia commented Feb 25, 2020

Thanks for the responses.

I can confirm that creating a new application + new API worked for me. For some reason, a new API key created on the old application would not work.

@AIIX
Copy link
Author

AIIX commented Feb 25, 2020

Is this going to be fixed in pafy pypi package or is it working only with manual intervention by registering own application and generating new api key and modifying pafy locally ?

@sebma
Copy link

sebma commented Feb 25, 2020

I agree with AIIX, I don't think average users are going to be able to do that.
Can you guys do it inside pafy instead ?

@galgot
Copy link

galgot commented Feb 28, 2020

Can confirm its difficult (impossible) for average user to fix that.
I've tried creating an new API. Tried adding the new API key to config.py, not working.
Tried to go through having an authorized domain for having the OAuth ID, as I suppose this is what is required now. But still don't have it :
When I fill all in "OAuth consent screen" , the "Submit for Verification" button stays greyed out.
Any ideas ?

@AyoungDukie
Copy link

AyoungDukie commented Feb 28, 2020

I actually was having the same problems @galgot; after some additional looking, found out that OAuth may not be necessary, and was able to fix my access without it.

That said, for reference, to add OAuth, what I realized was not only did I need a verified domain, but also had to provide a link to a privacy policy page. I do not have such a policy, so I felt stuck.

I came across the following SO post and their notes about issues persisting through regenerating keys led me to try making an entirely new project, enabling the YouTube Data API, and creating new credentials, and restricting them to the YouTube Data API (and after everything was working, I deleted the old project, just for housekeeping purposes). Knock on wood, these new api credentials have now worked for me, so maybe give that a try.

@galgot
Copy link

galgot commented Feb 28, 2020

Yaw ! Worked thanks.
Deleted all APIs. Created a new one with a new key.
Used that one in config.py.
First , it didn't work.
Then removing mpsyt caches with rm ~/.config/mps-youtube/cache_py*
and it worked.

@ghost
Copy link

ghost commented Feb 29, 2020

For those without a google account, I found a suitable alternative to mpsyt:
https://github.com/trizen/straw-viewer
The original project, youtube-viewer, seems to suffer from the same issue mpsyt does, but the straw-viewer fork apparently uses invidio.us, a reduced youtube version. Works fine with me so far.

@nowell-morris
Copy link

nowell-morris commented Mar 23, 2020

for me it was an old key. I had generated by key about 9 months ago but hadn't used it for a while. So, I generated a replacement. I am using it in mpsyt, so I opened it up, ran command: set ap_key < my newest key >
It worked right after that! I did not need to reset .config directory or contents. I let mpsyt handle that on its own.

@brunakov
Copy link

I have hardcoded my new API key to util.call_gdata() , but is there a better way on how to register my pafy app to youtube applications ?
p.s I am using pafy only for the data API not for downloading etc.

@hillt03
Copy link

hillt03 commented May 22, 2020

I have hardcoded my new API key to util.call_gdata() , but is there a better way on how to register my pafy app to youtube applications ?
p.s I am using pafy only for the data API not for downloading etc.

Pafy exposes the pafy.set_api_key(key) method, unfortunately I'm still receiving this error after creating and setting my own YouTube Data API key on Windows 10 via this method.

@brunakov
Copy link

I have hardcoded my new API key to util.call_gdata() , but is there a better way on how to register my pafy app to youtube applications ?
p.s I am using pafy only for the data API not for downloading etc.

Pafy exposes the pafy.set_api_key(key) method, unfortunately I'm still receiving this error after creating and setting my own YouTube Data API key on Windows 10 via this method.

This worked for me ! Thank you very much !

@ashwinvis
Copy link

How practical would be for pafy can to use Invidious API instead https://github.com/omarroth/invidious/wiki/API?

@conceptrat
Copy link

Yaw ! Worked thanks.
Deleted all APIs. Created a new one with a new key.
Used that one in config.py.
First , it didn't work.
Then removing mpsyt caches with rm ~/.config/mps-youtube/cache_py*
and it worked.

Just for reference. You don't need to modify mps-youtube config.py just pass the API key to mps-youtube directly like so...

mpsyt set api_key YOUR_API_KEY

mps-youtube then checks if i can make a zero quota request for language support and if that works then it should've saved the APIkey and you're good to go. Quit mps-youtube and go back in and type "set" and check that it saved your API key. If you get an error saying "Invalid key or quota exceeded..." then either the API key has become invalid or you have actually exceeded your quota. Not likely for individuals unless your making lots calls searching, downloading, etc.

@conceptrat
Copy link

for me it was an old key. I had generated by key about 9 months ago but hadn't used it for a while. So, I generated a replacement. I am using it in mpsyt, so I opened it up, ran command: set ap_key < my newest key >
It worked right after that! I did not need to reset .config directory or contents. I let mpsyt handle that on its own.

Important part is to create a new Project and not just new Credentials.

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