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 648 forks source link

Youtube Error 403: Access Not Configured #1062

Closed ErogeMaster225 closed 4 years ago

ErogeMaster225 commented 4 years ago

so i just installed mps-youtube last week and everything worked just fine until today when i try to start with the "mpsyt" command i get this error message

  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\site-packages\pafy\util.py", line 34, in call_gdata
    data = g.opener.open(url).read().decode('utf-8')
  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\urllib\request.py", line 531, in open
    response = meth(req, response)
  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\urllib\request.py", line 640, in http_response
    response = self.parent.error(
  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\urllib\request.py", line 569, in error
    return self._call_chain(*args)
  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\urllib\request.py", line 502, in _call_chain
    result = func(*args)
  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\urllib\request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\SakuraFrost225.OPREKIN-PC\AppData\Local\Programs\Python\Python38\Scripts\mpsyt.exe\__main__.py", line 4, in <module>
  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\site-packages\mps_youtube\__init__.py", line 8, in <module>
    init.init()
  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\site-packages\mps_youtube\init.py", line 58, in init
    cache.load()
  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\site-packages\mps_youtube\cache.py", line 34, in load
    pafy.load_cache(cached['pafy'])
  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\site-packages\pafy\pafy.py", line 184, in load_cache
    set_categories(newcache.get('categories', {}))
  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\site-packages\pafy\pafy.py", line 171, in set_categories
    catinfo = call_gdata('videoCategories', query)
  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\site-packages\pafy\util.py", line 42, in call_gdata
    raise GdataError(errmsg)
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.

here is my mpsyt --version

   notes           : released 17 February 2018
pafy version       : 0.5.5 (youtube-dl backend)
youtube-dl version : 2020.02.16
Python version     : 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)]
Processor          : Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
Machine type       : AMD64
Architecture       : 64bit, WindowsPE
Platform           : Windows-7-6.1.7601-SP1
sys.stdout.enc     : utf-8
default enc        : utf-8
Config dir         : C:\Users\SakuraFrost225.OPREKIN-PC\AppData\Roaming\mps-youtube
pirate486743186 commented 4 years ago

youtube changed something, and deactivated the default API key.

you can set your own API key like this: https://github.com/mps-youtube/mps-youtube/wiki/Troubleshooting#youtube-error-403-the-request-cannot-be-completed-because-you-have-exceeded-your-quota

tommysolsen commented 4 years ago

The key exceeding the quota is fairly common at this point, is this still the case or is the key permanently disabled now?

ErogeMaster225 commented 4 years ago

Since i can't start mpsyt the set api_key command doesn't seem to work. When i try to change the api key in the config.py file in python's site-packages folder i got the same 403 error, then i try to change the key in the config folder which is appdata/roaming on Windows i get this error

  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\SakuraFrost225.OPREKIN-PC\AppData\Local\Programs\Python\Python38\Scripts\mpsyt.exe\__main__.py", line 4, in <module>
  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\site-packages\mps_youtube\__init__.py", line 8, in <module>
    init.init()
  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\site-packages\mps_youtube\init.py", line 55, in init
    config.load()
  File "c:\users\sakurafrost225.oprekin-pc\appdata\local\programs\python\python38\lib\site-packages\mps_youtube\config.py", line 362, in load
    saved_config = pickle.load(cf)
_pickle.UnpicklingError: pickle data was truncated
ErogeMaster225 commented 4 years ago

So turn out this program use the api store in pafy's config not mpsyt this is kinda weird. Anyway, thanks everyone for helping me

pirate486743186 commented 4 years ago

the link i gave you, was explaining how to fix the problem by deleting the cache.... -_-

it seams that the default key is inactive for now...

tommysolsen commented 4 years ago

We need to replace it and drop a new version of the software sooner rather than later. Though the owner of the repos are not active very often.

Also if pafy ends up storing the api key, making the set api_key not work as expected, we should probably solve that issue as well