[mythtv-users] Runaway CPU when looking up nonexistent episode's metadata

Jan Ceuleers jan.ceuleers at gmail.com
Sun Apr 18 06:23:22 UTC 2021


Hello,

I've been importing new (old) media into mythvideo and I had misnumbered
some of the episodes. This led me to notice that when tmdb3.py tries to
look up metadata in respect of episodes that don't exist in
themoviedb.org it spins consuming 100% of a CPU core.

That's when the grabber is run from mythfrontend, but I can't reproduce
that same behaviour when running the grabber from the command line.
Instead I get this:

mythtv at dracor:~$ /usr/share/mythtv/metadata/Television/tmdb3tv.py -l en
-a GB -D 873 11 1
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/MythTV/tmdb3/request.py", line
117, in open
    return _py23urlopen(self)
  File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 532, in open
    response = meth(req, response)
  File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.6/urllib/request.py", line 570, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 650, in
http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/MythTV/tmdb3/request.py", line
133, in readJSON
    data = json.load(self.open())
  File "/usr/lib/python3/dist-packages/MythTV/tmdb3/request.py", line
119, in open
    raise TMDBHTTPError(e)
MythTV.tmdb3.tmdb_exceptions.TMDBHTTPError: HTTP Error 404: Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/mythtv/metadata/Television/tmdb3tv.py", line 159, in
<module>
    sys.exit(main("television",'tmdb3tv.py'))
  File "/usr/share/mythtv/metadata/Television/tmdb3tv.py", line 136, in main
    xml = buildEpisode(args[0:3], opts)
  File "/usr/lib/python3/dist-packages/MythTV/tmdb3/lookup.py", line
323, in buildEpisode
    episode = season.episodes[episode_number]
  File "/usr/lib/python3/dist-packages/MythTV/tmdb3/util.py", line 162,
in __get__
    self.poller.__get__(inst, owner)()
  File "/usr/lib/python3/dist-packages/MythTV/tmdb3/util.py", line 79,
in __call__
    if not self.apply(req.readJSON(), False):
  File "/usr/lib/python3/dist-packages/MythTV/tmdb3/cache.py", line 117,
in __call__
    data = self.func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/MythTV/tmdb3/request.py", line
152, in readJSON
    handle_status(data, url)
  File "/usr/lib/python3/dist-packages/MythTV/tmdb3/request.py", line
194, in handle_status
    raise status
MythTV.tmdb3.tmdb_exceptions.TMDBRequestInvalid: The resource you
requested could not be found.

Easily avoided by numbering the episodes the same way as themoviedb.org
has done (which in this case is different from the imdb.org numbering,
in case you're interested), but still worth fixing?

Thanks, Jan


More information about the mythtv-users mailing list