Closed pirate486743186 closed 1 year ago
Confirming this too, I just did a fresh install and am running into the same issue.
Also adding that after setting my own API V3 key, it still gives me an access not configured error as well.
Same, it seems like it could be related to caching, as after removing ~/.config/mps-youtube/cache_py*
, it works for some time (haven't yet found what causes the issue to resurface).
Edit for clearer explanation of steps: when trying to start mpsyt, I get error 403. Then I remove the cache file, open mpsyt, and set api_key
to my own API key. This works for some time, but later for some reason, it gives me the error again. So, I remove the cache file, and open mpsyt. At this point, api_key
is set correctly, but I still get the error until I remove the cache file.
Same, it seems like it could be related to caching, as after removing
~/.config/mps-youtube/cache_py*
, it works for some time (haven't yet found what causes the issue to resurface).Edit for clearer explanation of steps: when trying to start mpsyt, I get error 403. Then I remove the cache file, open mpsyt, and set
api_key
to my own API key. This works for some time, but later for some reason, it gives me the error again. So, I remove the cache file, and open mpsyt. At this point,api_key
is set correctly, but I still get the error until I remove the cache file.
Can confirm that the following steps solve the issue for me.
Same issue, deleting cache_py folder leads to same error after running mpsyt
This bug is related to pafy issue: https://github.com/mps-youtube/pafy/issues/255
Hello,
Same thing here,
I've deleted the cache_py but still has the fetching error below:
Error fetching data. Possible network issue. 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.
mpsyt --version mpsyt version : 0.2.8 notes : released 17 February 2018 pafy version : 0.5.4 (youtube-dl backend) youtube-dl version : 2020.02.16 Python version : 3.7.3 (default, Dec 20 2019, 18:57:59) [GCC 8.3.0] Processor : Machine type : x86_64 Architecture : 64bit, ELF Platform : Linux-4.19.0-8-amd64-x86_64-with-debian-10.3 sys.stdout.enc : UTF-8 default enc : utf-8 Config dir : /home/asterix/.config/mps-youtube env:TERM : xterm env:SHELL : /bin/bash env:LANG : en_US.UTF-8 env:LANGUAGE : en_US:en
Regards
Actually this doesn't look like pafy related bug. It's rather some change on the google side. You can make it work by creating your own app and generate new API key, see: https://github.com/mps-youtube/pafy/issues/255#issuecomment-590625421. What's important is to make sure that the new API is used and not the hardcoded "AIzaSyCIM4EzNqi1in22f4Z3Ru3iYvLaY8tc3bo" key (see https://github.com/mps-youtube/mps-youtube/issues/1061)
Can a new hardcoded key be generated for pafy? Its not possible to make your own key without a google account.
I am on a Mac running macOS 10.15 and I solved this issue by doing the following:
This solved the issue for me
@nishanmudalige, can confirm, this worked for me too. I think the key is to make a new project with a new api key because it wasn't until I did that that it actually worked. I only needed to edit mps_youtube/config.py
and build/lib/mps_youtube/config.py
to make it work. I tried to change it with set api_key
at first but it wouldn't let me for some reason.
Hello,
It's working after some steps
Here are the steps I took:
That should work
Hope it helps Best regards
After reading all the above I managed to solve it with steps similar to what @whitemind and @nishanthkarthik suggested but I had to start with a fresh ~/.config/mps-youtube directory because modifying the binary config
file for the new api_key did not prove to work for me. The steps I followed were:
1) Create a new google api project. I called it mps-youtube but you can call it whatever. Enable Youtube v3 API and get the API Key.
2) Change the default key from python version directory's /dist-packages/pafy/g.py
and /dist-packages/mps_youtube/config.py
3) Remove __pycache__/
directory content from both above mentioned pafy/
and mps_youtube/
module dirs.
4) Remove ~/.config/mps-youtube
directory (you may want to backup your histories and configurations but at least for configurations I suggest you copy/reinput them manually one by one)
The REAL solution here, would be, for the person that controls the default key, to reactivate it....
kof kof @hrnr @kraetzin @ids1024 @ritiek @vn-ki
That changing the api key is actually bugged, is a different problem.
That API key is about 5 years old and was added in https://github.com/mps-youtube/mps-youtube/commit/032cca94bc6fc30f9a1130e3112fcb4ad2782d42 by @ids1024. I don't expect @ids1024 to still remember the account information from which the key was created, after such a long time. I also don't expect it would be as easy to simply reactivate the key as API keys don't usually expire. I believe this error is probably a side effect of something else YouTube did lately.
We could also generate a new YouTube Data API key but it would easily be hitting rate limits as API keys that were generated in those old times could be used for 50 million units/day, but now has been dropped to only 1 million units/day.
FWIW a similar project https://github.com/trizen/youtube-viewer recently also had their API disabled & urged all users to go create their own API key for the same reasons @ritiek suggests. IE: 'new YouTube Data API key would easily be hitting rate limits ' sadly it appears that project is now doomed because of this. the developer recently posted this https://github.com/trizen/youtube-viewer/issues/308 however in recent days he has stuck a fork in it https://github.com/trizen/youtube-viewer/issues/308#issuecomment-591063498 maybe mpsyt too could use a similar API as straw-viewer, I really hope we can find a way forward for mpsyt
Related to using our own API key -- is there any way to set the key from the environment, instead of setting it directly in the json file? I like to keep my configuration on github under version control, and I'd rather not push API keys to github.
Hi
Yes you can,
mpsyt set api_key your_key
Regards
rm ~/.config/mps-youtube/cache_py*
mpsyt set api_key YOUR_KEY_HERE
Yes, but this writes the key into the JSON config file, AFAIK. My question is, is it possible to have the API key set to eg. the environment variable $YT_API_KEY, and have mpsyt read this variable?
Is there any way for those with no google/youtube account to use mps-yt now?
On Thu, Feb 27, 2020 at 01:58:09AM -0800, electronblue wrote:
Is there any way for those with no google/youtube account to use mps-yt now?
Yes, please! Can the project maintainers talk to Google about that? People can watch youtube via their web-interface without any registration (and tracking), so why should I register my own API key for mps-youtube?
-- Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:fercerpav@gmail.com
So I looked at an alternative player to handle livestreams (as I could not get those working even prior to this API issue, haha), and came across an application using an OSS tool called invidous [ Website, Github ] (license is stated as AGPLv3); seems they have their own access API setup as well, so may be worth looking into, but also seems like a lot of retooling to point at a different site than YT proper....
I don't think average users are going to be able to do create a new API key.
Can you guys please do it inside mps-youtube/pafy
module instead ?
Just as a workaround for those starting to re-encounter this 403 error with their own API keys (which I started to have when I came across this open issue), some people have pointed out that the Google API can do a poor job of propogating changes to fix issues stack overflow post, so I went and fully deleted my api project, set up a new one from scratch, and created new API credentials. Once done, MPSYT was functional again with the new key.
With own API, if I disconnect the network or delete the cache that is said in other posts, it goes well but works like 1 day
Ok... I did all modifications and exchanged the API key for a new key. bout now....the player software does not seem to play musics.....it crashes.... I can search and get a list, but not play anything. Any guesses ?
Did you do set player
? Do you have that player installed? Is mpsyt, pafy, and youtube-dl up to date? Did you remove the cache?
everything up-to-date, using mpv as player, yes removed the cache
On Mon, Mar 2, 2020 at 2:47 PM Alex Balgavy notifications@github.com wrote:
Did you do set player? Do you have that player installed? Is mpsyt, pafy, and youtube-dl up to date? Did you remove the cache?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mps-youtube/mps-youtube/issues/1063?email_source=notifications&email_token=ADYHP6DU2WBR5I5C2RB7VZTRFPWJZA5CNFSM4KZZRC7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENQIH7Q#issuecomment-593527806, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADYHP6FOKLMODIEVKVQUT7DRFPWJZANCNFSM4KZZRC7A .
You could try running with --debug --logging
and see if that gives you any info.
the players crashes but I can still download and encode the audio some files do play audio....others crash. Don't know why
@TalhaAkber Thanks for the solution, it works like a charm.
The only problem I faced when tried to set my own API key is that mpsyt
was throwing an error about invalid key or exceeded quota until I created an OAuth client ID.
I am not sure we can quite call it "solution" when each user needs creating his individual Google API key:
On March 3, 2020 1:03:04 AM GMT+01:00, Alex Zinchenko notifications@github.com wrote:
@TalhaAkber Thanks for the solution, it works like a charm. The only problem I faced when tried to set my own API key is that
mpsyt
was throwing an error about invalid key or exceeded quota until I created an OAuth client ID.-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/mps-youtube/mps-youtube/issues/1063#issuecomment-593691715
Even with my own API, I have to delete ~/.config/mps-youtube/cache_py_3.6.9 every day, or it gives 403 error when starting. pafy.util.GdataError: Youtube Error 403: Access Not Configured. YouTube Data API has not been used in project 422897895433 before or it is disabled.
After all updates and alterations to config and cache. I still get the following results...some songs play, most do not. Seems like something on the google side but I am not sure.
Most strangely.....downloading the non-playable files DOES work. On second thought, it must be a problem still on the mps-youtube side.
@sokolgeo Surely, it's more like a "hack" than a solution, but at this time it's still better that nothing (i.e. browser version of youtube).
Saying goes that there is nothing more persistent than 'temporary fixes'. I'd rather stick to browser version of YouTube running via Tor browser until solution is found free from worsening Google tracking on my mpsyt usage, but its personal choice, I agree.
On March 5, 2020 1:11:12 AM GMT+01:00, Alex Zinchenko notifications@github.com wrote:
@sokolgeo Surely, it's more like a "hack" than a solution, but at this time it's still better that nothing (i.e. browser version of youtube).
-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/mps-youtube/mps-youtube/issues/1063#issuecomment-594955043
@sokolgeo you also can use invidious :)
I am not sure we can quite call it "solution" when each user needs creating his individual Google API key: 1. Its relatively high effort for non-technically minded 2. It decreases your privacy level. With one API key Google was tracking multitude of IP addresses all using the same key, but with each user creating his own key - Google will track you even better due to your key being unique ID. Before I could put mpsyt beyond Tor proxy and call it a day. Now individual API key would probably mean more work to reach the same level of privacy as before (creating fake google account just to create the individual API key which is not linked to my personality known by google). That is probably doable, still step in worse direction IMHO. … On March 3, 2020 1:03:04 AM GMT+01:00, Alex Zinchenko @.***> wrote: @TalhaAkber Thanks for the solution, it works like a charm. The only problem I faced when tried to set my own API key is that
mpsyt
was throwing an error about invalid key or exceeded quota until I created an OAuth client ID. -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: #1063 (comment)
@sokolgeo I agree with you 100%, and that is exactly what I am doing right now, using fake gmail account with tor proxy. Its getting really hard for non-technically minded people to maintain their privacy and anonymity. But I guess most of the users of mps-youtube are technical because normal people might use tor browser and will not use terminal based app to browse youtube.
Even with my own API, I have to delete ~/.config/mps-youtube/cache_py_3.6.9 every day, or it gives 403 error when starting. pafy.util.GdataError: Youtube Error 403: Access Not Configured. YouTube Data API has not been used in project 422897895433 before or it is disabled.
@Jeronimo17 yeah its a real pain, deleting this stupid cache on daily basis. That's why I added an extra command on my i3 config to remove the cache every time it starts.
@TalhaAkber Also can be done with crontab task.
Even with my own API, I have to delete ~/.config/mps-youtube/cache_py_3.6.9 every day, or it gives 403 error when starting. pafy.util.GdataError: Youtube Error 403: Access Not Configured. YouTube Data API has not been used in project 422897895433 before or it is disabled.
Happens the same issue still. I also need to remove cache.py files daily.
A workaround to removing the cache files is truncating them and then make them readonly. So the polluting API key cannot be written to the cache. I'm no Python dev so I cannot say how big the speed up by using the cache is but I did not feel a difference. For a Linux system, this should work:
echo -n '' > ~/.config/mps-youtube/cache_py_*
chmod 444 ~/.config/mps-youtube/cache_py_*
The downside is mpsyt complaining about the cachefile not being writeable and you cannot close the program with q
anymore. Sending an Ctrl-D however still closes it without writing the cache file.
I'm going to use this as an excuse to point to NewPipe again -- their crawler doesn't go through YouTube's API so while they have to write everything themselves, they don't have the problems with quotas or things expiring. With that being in Java, it's obviously not just a drop-in replacement, but if things get to the point of rewriting the entire program, they could definitely be a source of inspiration and general guidance. Personally, I'm more likely to write my own desktop wrapper for that backend than I am to give Google direct access to my view data with an API key.
Please add the ability to use Invidious (and use Invidious logins), it should solve the API issue as well. I am getting the issue on a fresh install of mps-youtube on Arch from base repos
@ag-eitilt
I'm going to use this as an excuse to point to NewPipe again -- their crawler doesn't go through YouTube's API so while they have to write everything themselves, they don't have the problems with quotas or things expiring. With that being in Java, it's obviously not just a drop-in replacement, but if things get to the point of rewriting the entire program, they could definitely be a source of inspiration and general guidance. Personally, I'm more likely to write my own desktop wrapper for that backend than I am to give Google direct access to my view data with an API key.
Unfortunatly, there is no NewPipe for Linux yet : https://github.com/TeamNewPipe/NewPipe/issues/1051
Removing the mpsyt
cache directory didn't worked for me.
But deleting the youtube-dl
cache works fine, I do it with:
youtube-dl --rm-cache-dir
I'm using mpsyt
on Ubuntu 18.04
@atropo I tried your approach but it was not successful. Are you sure you get the same error message / stack trace as the others in this issue?
It seams that google has disabled the default api key.