mps-youtube / yewtube

yewtube, forked from mps-youtube , is a Terminal based YouTube player and downloader. No Youtube API key required.
GNU General Public License v3.0
8.07k stars 645 forks source link

Error fetching data #1089

Closed GasparVardanyan closed 1 year ago

GasparVardanyan commented 4 years ago

/search 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.

itsyourOOP commented 4 years ago

same here, this happened even after I'd tried the workaround of setting up my own Youtube Data API

ronaldlangeveld commented 4 years ago

same here. Just installed on MacOS

rkc-rkc commented 4 years ago

Similar issue here. App won't launch and errors with 403 message. On clearing the cache, relaunching and checking the settings, the API Key has the right value (personal key)

eligiobz commented 4 years ago

I know this has been an on-going issue, but no matter how many times I re-set my key (change it for a new one). It open, might play a song or two and then it crashes and my API key becomes invalid.

Hasnen8 commented 4 years ago

Yes I am on Mojave and it is also not working if you have time could you please look into this problem? Thank you

kurokirasama commented 4 years ago

i also have this issue. Could it be because to changes to youtube api?

basilroztor95 commented 4 years ago

I am on Arch Linux and also have this issue. 20200723-111738

Drewshotwell commented 4 years ago

I am having the exact same issue out of the box as @basilroztor95 on Arch as well.

GasparVardanyan commented 4 years ago

I also use Arch Linux ))

algent-al commented 3 years ago

You have to use a different api_key guys. > set api_key YourN3wk3y

tommysolsen commented 3 years ago

My memory on the details is a bit hazy, but years ago, Youtube gave out pretty decently sizeable keys which had orders of magnitude more requests a month than now. That key would be rate limited at the end of the month due to being used.

I havent kept up with the free tier limitations of the Youtube API anymore, but sufficed to say we can't get a new key like that, only a key that gives us something like 1M credits a month vs the old 50M credits a month key.

Supplying your own key will be your best bet.

Elysium1436 commented 3 years ago

I have been getting the same error as basilroztor95, and when I try to change my api_key, this error comes up. This key is new and i've tested older keys, and the some error comes up.

image

vsevolod commented 3 years ago

@Elysium1436 it will work after removing this file ~/.config/mps-youtube/cache_py_3.8.5 (for me)

trames57 commented 3 years ago

If the set api_key does not work or you are getting quota errors, try clearing the cache as suggested by @vsevolod. If that does not work, goto the console.developers.google.com website and shut down the project. Then recreate it and add a new API Key, close mpsyt if it is open, delete the cache file in your home directory, open mpsyt and set api_key to the new key. This is the only thing that worked for me.

Another thing I noticed is that I used /channel to search for a channel rather than channels (no slash). The search caused my daily queries to jump to 10K which exceeds the quota. So be careful on what and how you search.

ekohilas commented 3 years ago

I'm having the same problem. I have a list of 120 songs that I'd like to convert into a playlist using mkp, but it runs into the quota before it can finish. How does searching for 100 songs require 10,000 queries?!

apaaris commented 3 years ago

Hi guys, maybe I'm coming late to the party but I had the exact same issues on Arch. I resolved them setting my own API key and using mplayer as player instead of mpv or ffmpeg.

sudo pacman -Syu mplayer

and then set player mplayer

ZappaBoy commented 3 years ago

@Elysium1436 it will work after removing this file ~/.config/mps-youtube/cache_py_3.8.5 (for me)

Same here, it works after creating new youtube API KEY from Google Cloud Storage, setted using mpsyt set api_key <key> and removed cahce with rm ~/.config/mps-youtube/cache_py_*

onixldlc commented 2 years ago

i think i may have found the culprit on why the removing the cache_py_3.8.5 works, although im not sure if its the problem with mps-youtube or pafy

so basically when you start the mpsyt it will tries to read the cache file and if it founds the cache it will now try to load it. and if you continue through the function you finally met with function call_gdata(), and it uses the default key from pafy/g.py but if it doesn't found the cache file it would just skip the whole load thing which is why removing the cache_py_3.8.5 works

the easiest work around is just to change the api_key on <pythonlib>/python3.8/site-packages/pafy/g.py and change the default api_key to your api_key (and you only need to do it once, ofcourse if you change your api_key you would need to change it again, but beside that you don't need to do anything)

but for actually fixing the code... i feel like im not familiar enough with the code to create any changes but one thing that i see might work is adding api_key as optional value to the call_gdata() and set to g.key_api as the default value \ \ tldr workarround: the default pafy g.py usually are stored here: /usr/local/lib/python3.8/site-packages/pafy/g.py

and change this:

...
    'embed': "https://youtube.com/embed/%s"
}
api_key = "AIzaSyCIM4EzNqi1in22f4Z3Ru3iYvLaY8tc3bo"
user_agent = "pafy " + __version__
...

to this:

...
    'embed': "https://youtube.com/embed/%s"
}
api_key = "<insert your key here>"
user_agent = "pafy " + __version__
...
iamtalhaasghar commented 1 year ago

was fixed here https://github.com/iamtalhaasghar/yewtube/commit/4801c3a5542b7318c493556e98ca5af2af821989

Trubessinum commented 1 year ago

I'm dumbfounded by what just happened. I got an email about some issue on mps-youtube, I haven't used it for a long time, but still decided I'd check it out, just for fun. This is hilarious. The second largest contributor gives the repository to some random guy who "fixes" problems by commenting out a couple of lines. This repository may not be dead, but it is now a living corpse. You guys made my day, thank you from the bottom of my heart! 😄 ❤️

iamtalhaasghar commented 1 year ago

I'm dumbfounded by what just happened. I got an email about some issue on mps-youtube, I haven't used it for a long time, but still decided I'd check it out, just for fun. This is hilarious. The second largest contributor gives the repository to some random guy who "fixes" problems by commenting out a couple of lines. This repository may not be dead, but it is now a living corpse. You guys made my day, thank you from the bottom of my heart! smile heart

mps-youtube is back with a cool new name yewtube and it no more relies on Youtube API.

ids1024 commented 1 year ago

The project hasn't been maintained in years, and Yewtube seems like the most established fork at this point. Perhaps if it has a maintainer more people may want to get involved.

Removing reliance on the gdata v3 API is the right thing to do. Hopefully with replacement where possible, though some things are more important than others.