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
8k stars 643 forks source link

During handling of the above exception, another exception occurred: #1166

Closed RushilShandilya closed 1 year ago

RushilShandilya commented 3 years ago

Issue / Suggestion

Opened my terminal and typed mpsyt A message occurred saying this

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/pafy/util.py", line 34, in call_gdata
    data = g.opener.open(url).read().decode('utf-8')
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/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 "/usr/bin/mpsyt", line 11, in <module>
    load_entry_point('mps-youtube==0.2.7.1', 'console_scripts', 'mpsyt')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 490, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2854, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2445, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2451, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3/dist-packages/mps_youtube/__init__.py", line 8, in <module>
    init.init()
  File "/usr/lib/python3/dist-packages/mps_youtube/init.py", line 58, in init
    cache.load()
  File "/usr/lib/python3/dist-packages/mps_youtube/cache.py", line 34, in load
    pafy.load_cache(cached['pafy'])
  File "/usr/local/lib/python3.8/dist-packages/pafy/pafy.py", line 184, in load_cache
    set_categories(newcache.get('categories', {}))
  File "/usr/local/lib/python3.8/dist-packages/pafy/pafy.py", line 171, in set_categories
    catinfo = call_gdata('videoCategories', query)
  File "/usr/local/lib/python3.8/dist-packages/pafy/util.py", line 42, in call_gdata
    raise GdataError(errmsg)
pafy.util.GdataError: Youtube Error 403: The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.

Your Environment

Environment -- Ubuntu 20.0.4

mpsyt version : 0.2.7.1 notes : released 6 July 2016 pafy version : 0.5.5 (youtube-dl backend) youtube-dl version : 2021.06.06 Python version : 3.8.5 (default, May 27 2021, 13:30:53) [GCC 9.3.0] Processor : x86_64 Machine type : x86_64 Architecture : 64bit, ELF Platform : Linux-5.8.0-55-generic-x86_64-with-glibc2.29 sys.stdout.enc : utf-8 default enc : utf-8 Config dir : /home/rushil/.config/mps-youtube env:TERM : xterm-256color env:SHELL : /bin/bash env:LANG : en_IN env:LANGUAGE : en_IN:en

mlliarm commented 2 years ago

I'm having the same issue after rebooting my machine:

Error:

(mps-yt) $ mpsyt
Traceback (most recent call last):
  File "/home/milia/.venvs/mps-yt/lib/python3.9/site-packages/pafy/util.py", line 34, in call_gdata
    data = g.opener.open(url).read().decode('utf-8')
  File "/usr/local/lib/python3.9/urllib/request.py", line 523, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.9/urllib/request.py", line 632, in http_response
    response = self.parent.error(
  File "/usr/local/lib/python3.9/urllib/request.py", line 561, in error
    return self._call_chain(*args)
  File "/usr/local/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.9/urllib/request.py", line 641, 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 "/home/milia/.venvs/mps-yt/bin/mpsyt", line 5, in <module>
    from mps_youtube import main
  File "/home/milia/.venvs/mps-yt/lib/python3.9/site-packages/mps_youtube/__init__.py", line 8, in <module>
    init.init()
  File "/home/milia/.venvs/mps-yt/lib/python3.9/site-packages/mps_youtube/init.py", line 58, in init
    cache.load()
  File "/home/milia/.venvs/mps-yt/lib/python3.9/site-packages/mps_youtube/cache.py", line 34, in load
    pafy.load_cache(cached['pafy'])
  File "/home/milia/.venvs/mps-yt/lib/python3.9/site-packages/pafy/pafy.py", line 184, in load_cache
    set_categories(newcache.get('categories', {}))
  File "/home/milia/.venvs/mps-yt/lib/python3.9/site-packages/pafy/pafy.py", line 171, in set_categories
    catinfo = call_gdata('videoCategories', query)
  File "/home/milia/.venvs/mps-yt/lib/python3.9/site-packages/pafy/util.py", line 42, in call_gdata
    raise GdataError(errmsg)
pafy.util.GdataError: Youtube Error 403: The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.

Python version: Python 3.9.0

Machine:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.6 LTS
Release:    18.04
Codename:   bionic

Python packages:

$ pip list
Package           Version
----------------- ----------
asttokens         2.0.5
backcall          0.2.0
decorator         5.1.1
emoji             1.6.3
executing         0.8.3
ipython           8.1.0
jedi              0.18.1
matplotlib-inline 0.1.3
mpris-server      0.4.2
mps-youtube       0.2.8
pafy              0.5.5
parso             0.8.3
pexpect           4.8.0
pickleshare       0.7.5
pip               22.0.3
pkg_resources     0.0.0
prompt-toolkit    3.0.28
ptyprocess        0.7.0
pure-eval         0.2.2
pycairo           1.20.1
pydbus            0.6.0
Pygments          2.11.2
PyGObject         3.42.0
setuptools        60.9.3
six               1.16.0
stack-data        0.2.0
traitlets         5.1.1
typing_extensions 4.1.1
Unidecode         1.3.3
wcwidth           0.2.5
wheel             0.37.1
youtube-dl        2021.12.17

Any hints?

mlliarm commented 2 years ago

Also, no quotas have been exceeded in GCP: yt-quota3

yt-quota2

yt-quota1

mlliarm commented 2 years ago

Hey @RushilShandilya ,

In the fork of mps-youtube called yewtube this issue has been fixed.

See #1191.

Cheers.