Open AIIX opened 4 years ago
I'm also seeing this error with Tizonia (https://github.com/tizonia/tizonia-openmax-il)
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.
having the same issue. tried changing api key but still no luck :(
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.
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.
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 ?
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 ?
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 ?
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.
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.
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.
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.
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.
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.
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 !
How practical would be for pafy can to use Invidious API instead https://github.com/omarroth/invidious/wiki/API?
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.
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.
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.