SOLVED: TV metadata lookup not working

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
Medieval Cow
Newcomer
Posts: 11
Joined: Mon Apr 22, 2019 7:28 am
United States of America

SOLVED: TV metadata lookup not working

Post by Medieval Cow »

Hi all, the TV metadata lookup on my system used to work but stopped successfully returning results a while ago (Movie metadata lookups still work fine). I finally took some time to dig into it a little today, and I can't figure out what's going wrong. Here's the log output I see when I look up a TV episode:

Code: Select all

2020-09-26 01:24:10.086402 E [404/775] CoreContext xmlparsebase.cpp:350 (ParseChildren) - XMLParseBase: Parent is NULL
2020-09-26 01:24:27.727527 E [404/775] CoreContext xmlparsebase.cpp:350 (ParseChildren) - XMLParseBase: Parent is NULL
2020-09-26 01:24:32.544710 I [404/101271] MetadataDownload metadatagrabber.cpp:453 (RunGrabber) - Running Grabber: /opt/local/share/mythtv/metadata/Television/ttvdb.py -l en -a US -D 72336 6 13
2020-09-26 01:24:33.056925 I [404/101271] MetadataDownload metadatagrabber.cpp:453 (RunGrabber) - Running Grabber: /opt/local/share/mythtv/metadata/Television/ttvdb.py -l en -a US -C 72336
2020-09-26 01:24:33.731585 I [404/101271] MetadataDownload metadatagrabber.cpp:453 (RunGrabber) - Running Grabber: /opt/local/share/mythtv/metadata/Movie/tmdb3.py -l en -a US -D 72336
2020-09-26 01:24:34.300168 I [404/101271] MetadataDownload metadatacommon.cpp:1202 (ParseMetadataItem) - Result Found, Season 6 Episode 13
2020-09-26 01:24:34.300562 I [404/101271] MetadataDownload metadatadownload.cpp:176 (run) - Returning Metadata Results: Reno 911! 6 13
This is for an episode of Reno 911. I added in the 72336 TV ID manually. Without it, I get a hit for the movie Reno 911: Miami. With the ID code entered, I get "Decoding Nazi Secrets", which is what that ID returns on the TMDB site. So it seems to fail to get a hit as a TV show and return whatever it finds for a movie lookup.

Running the "/opt/local/share/mythtv/metadata/Television/ttvdb.py -l en -a US -D 72336 6 13" command directly in Terminal gives me this output:

Code: Select all

Traceback (most recent call last):
  File "/opt/local/share/mythtv/metadata/Television/ttvdb.py", line 2578, in <module>
    sys.exit(main())
  File "/opt/local/share/mythtv/metadata/Television/ttvdb.py", line 2278, in main
    userkey=tvdb_account.account_identifier)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MythTV/ttvdb/tvdb_api.py", line 693, in __init__
    self.session.remove_expired_responses()
  File "/Users/[username]/Library/Python/2.7/lib/python/site-packages/requests_cache/core.py", line 177, in remove_expired_responses
    self.cache.remove_old_entries(datetime.utcnow() - self._cache_expire_after)
  File "/Users/[username]/Library/Python/2.7/lib/python/site-packages/requests_cache/backends/base.py", line 110, in remove_old_entries
    response, created_at = self.responses[key]
  File "/Users/[username]/Library/Python/2.7/lib/python/site-packages/requests_cache/backends/storage/dbdict.py", line 169, in __getitem__
    return pickle.loads(bytes(super(DbPickleDict, self).__getitem__(key)))
ImportError: No module named ordered_dict
So it looks like the ttvdb.py script is choking on something when it runs, so it moves on to the tmbd script and returns movie data instead. I can't figure out why that's started happening though. Anyone have any ideas?
Last edited by Medieval Cow on Sun Sep 27, 2020 8:36 pm, edited 1 time in total.
User avatar
paulh
Developer
Posts: 913
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: TV metadata lookup not working

Post by paulh »

I'd say the pertinent error is the 'ImportError: No module named ordered_dict'.

What version of MythTV are you using?
User avatar
dnalorernst
Developer
Posts: 106
Joined: Mon Feb 17, 2020 8:03 pm
Austria

Re: TV metadata lookup not working

Post by dnalorernst »

You need to downgrade pythons urllib3 package.
See viewtopic.php?f=36&t=3274
for details.
Medieval Cow
Newcomer
Posts: 11
Joined: Mon Apr 22, 2019 7:28 am
United States of America

Re: TV metadata lookup not working

Post by Medieval Cow »

I'm running MythTV 0.28.2-Fixes-20180201_6 on Mac OS X 10.12.6.

I installed via MacPorts, so I was able to use that to roll back to an older version of py27-urllib3 (specifically version 1.22_0, which was an older version I was running on this machine) but I'm still hitting the same error. So it seems like there's something else going on giving the same error as that thread, unfortunately.
User avatar
dnalorernst
Developer
Posts: 106
Joined: Mon Feb 17, 2020 8:03 pm
Austria

Re: TV metadata lookup not working

Post by dnalorernst »

Python allows tow ways to install packages:
- Install locally on user session
- Install a package globally for all users

The local install for a dedicated user takes precedence to the global install.
In your case, the urllib3 package seems to be installed locally. See the file paths in the log.

Please try in a terminal the following with the user running mythfrontend:

Code: Select all

python2
>>> import urllib3
>>> urllib3.__version__
>>> urllib3.__file__
This gives you the version and file path to the urllib3 package python is using.

To change the locally installed package for urllib3, please try

Code: Select all

pip install --user urllib3==1.23
and run the above checks for version and file location again.
Medieval Cow
Newcomer
Posts: 11
Joined: Mon Apr 22, 2019 7:28 am
United States of America

Re: TV metadata lookup not working

Post by Medieval Cow »

Hey, that worked! Ya'll are amazing, thanks so much!

Ugh, this system is great when it works, but I have some regrets about how I set it up, and at this point it feels like everything is held together with bubblegum and duct tape. One of these days I'm gonna decide I want to ruin my weekend and go ahead and backup my database so I can move everything over to a fresh Linux install.
Post Reply