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

Peter Bennett pb.mythtv at gmail.com
Sun Apr 18 13:21:38 UTC 2021


On 4/18/21 2:23 AM, Jan Ceuleers wrote:
> 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]mythtv-users mailing list
> mythtv-users at mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
>
>
>    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
> _______________________________________________

This looks like a bug in the recent tmdb3 changes to support TV shows. I 
will take a look at it. Please tell me the misnumbered/misnamed file 
name and directory of the video so that I can reproduce the problem and 
fix it.

Peter



More information about the mythtv-users mailing list