Closed orbea closed 4 years ago
A possible fix could be to implement an option of using personal Youtube API keys?
A possible fix could be to implement an option of using personal Youtube API keys?
There already is.
set api_key <key>
A possible fix could be to implement an option of using personal Youtube API keys?
I am not reporting that I am running into the quota, but that mps-youtube is crashing when it reaches the limit. This used to fail gracefully, I would guess something in youtube or youtube-dl changed.
Hi,
Yes, there is an option to set the api_key, and for example I set it earlier.
However it seems when mpsyt is started the default key is used, which results in the crash with this error message (please notice the project ID at the end):
Youtube Error 403: Daily Limit Exceeded. The quota will be reset at midnight Pacific Time (PT). You may monitor your quota usage and adjust limits in the API Console: https://console.developers.google.com/apis/api/youtube.googleapis.com/quotas?project=422897895433
While in the .config/mps-youtube/config
file I see my own api_key.
I am not sure what happened, but I am no longer getting a crash and have not changed anything regarding youtube-dl or mps-youtube.
Error fetching data. Possible network issue.
Youtube Error 403: The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.
I can confirm this is occurring even with a custom API key set.
The offending code is here:
https://github.com/mps-youtube/pafy/blob/develop/pafy/util.py#L30
It's reading from g and is not something you can override:
https://github.com/mps-youtube/pafy/blob/develop/pafy/g.py#L24
If you need a quick fix until this is patched, you can just edit the line in util.py to be
qs['key'] = "yourapikey"
I update it on: /home/{your user}/.local/lib/python3.7/site-packages/pafy/g.py on line "api_key = ", adding my api key and now is working.
Deleting ~/.config/mps-youtube/cache_py_3.6.8
allowed me to start up the program and work around the crash. Then I could go in and use set api_key XXXXX
to install the key I got following the instructions in https://github.com/mps-youtube/mps-youtube/issues/551#issuecomment-513455722. Then after restarting mpsyt, my new key was used and the program started working again.
So something is wrong in the handling of that cache file, I suppose.
In my case, my own api key was created 3 years ago. With that key, mps always show exceeding quota message, but no api usage recorded on api console.
After recreating both project and api key on the console, everything works fine.
I just fixed this using @adamnovak guide above. Just list ~/.config/mps-youtube/
and remove whatever cache_py_*
file there.
I guess when I started mpsyt the first time, I didn't use my own API key, so the default one is cached and used when the app is bootstrapped.
I was getting the same error when running any command except mpsyt --help
. Even mpsyt set
was failing.
As @adamnovak and @trongthanh have suggested, I ran the following command:
rm -v ~/.config/mps-youtube/cache_py_*
Now I can run mpsyt and set my own api key.
I just ran into this but using set
allowed me to use my own API key (after generating one). I'm not too sure why the project is bootstraped with a generic key that isn't generated by the user. I'd rather have that step be part of the installation process than random 403 when the quota is reached.
MPS didn't crash but it did error out with a warning.
mpsyt is essentially dead now so w/e...
is there an alternative?_?
For me, I deleted ~/.config/mps-youtube
the cache.py file. It tarted working fine
mps-youtube will crash when the quota has been exceeded which sometimes happens.
Issue / Suggestion
Your Environment
I am running
Slackware64-current
.