[mythtv-users] Important: Changes to Metadata lookup in March 2021

Roland Ernst rcrernst at gmail.com
Thu Feb 25 21:36:11 UTC 2021


On Thu, Feb 25, 2021 at 9:36 PM John Finlay via mythtv-users <
mythtv-users at mythtv.org> wrote:

> On 2/25/2021 10:45 AM, Hika van den Hoven wrote:
> > Hoi Peter,
> >
> > Thursday, February 25, 2021, 6:19:52 PM, you wrote:
> >
> >> Hi Hika
> >> On 2/25/21 11:19 AM, Hika van den Hoven wrote:
> >>> It was an ambiguous error. The python2 mysql module 'mysql-python' was
> >>> forked and renamed to 'mysqlclient'. So I had no mysql module under
> >>> python3. Took some fiddling under gentoo to keep the old one for
> >>> python 2.7 and the new one for python3 as they excluded each other.
> >>>
> >>> But now both tvmaze.py and tmdb3tv.py work under both python2 with
> >>> partial adapted 0.27 bindings and under python3 with the current
> >>> bindings.
> >>>
> >>> Next step is integration in older mythtv versions that have no
> >>> knowledge of those two new metadata grabbers and there I am a bit out
> >>> of my depth.
> >>> I can only think of renaming either one of the two to ttvdb.py and
> >>> update the inetrefs. But that requires their in- and output behaviour
> >>> to be exactly the same! And my first tests seem to indicate that is
> >>> not the case:-(
> >>>
> >>>
> >>> Tot mails,
> >>>     Hikamailto:hikavdh at gmail.com
> >> Do you have a list of steps needed to get it to work with version 0.27,
> >> for other people that are on older version of MythTV?
> >> Peter
> > Get the latest version of mythtv from github:
> >      Make directory where to place it and go there
> >      run:
> >      git clone https://github.com/MythTV/mythtv.git mythtv
> >
> >      If that does not work, first install git!
> >
> > Next either install the pythonbindings from there into python3:
> >      go inside the downloaded data to:
> >          ...mythtv/mythtv/bindings/python
> >          (substitute ... with the location you downloaded it to)
> >      run:
> >          sudo python3 ./setup.py install
> >      install the following python modules if not jet there:
> >          https://pypi.org/project/mysqlclient/
> >          https://pypi.org/project/requests/
> >          https://pypi.org/project/requests-cache/
> >          https://pypi.org/project/python-dateutil/
> >          https://pypi.org/project/future
> >      by either
> >          downloading the sourcefiles from above links,
> >          unpacking them
> >          and from the main directory within the unpacked files run:
> >          sudo python3 ./setup.py install
> >      or by finding the appropriate modules for your distribution.
> >
> > or update the apropriate bindingfiles in your python2.7 binding directory
> >      on my system:
> >          /usr/lib64/python2.7/site-packages/MythTV
> >      on others possibly:
> >          /usr/local/lib/python2.7/dist-packages/MythTV
> >      or a variation of the above.
> >
> >      Go to that directory
> >      first backup the tmdb3 directory in there by renaming it to
> tmdb3.bak:
> >          mv tmdb3 tmdb3.bak
> >      copy from the above downloaded git files the tmdb3 and tvmaze
> directory into this MythTV directory:
> >          sudo cp -rp ...mythtv/mythtv/bindings/python/tmdb3/tmdb3/ .
> >          sudo cp -rp ...mythtv/mythtv/bindings/python/tvmaze/ .
> >          (substitute ... with the location you downloaded mythtv into)
> >      install the following python modules if not jet there:
> >          https://pypi.org/project/requests/
> >          https://pypi.org/project/requests-cache/
> >          https://pypi.org/project/python-dateutil/
> >          https://pypi.org/project/future
> >      by either
> >          downloading the sourcefiles from above links,
> >          unpacking them
> >          and from the main directory within the unpacked files run:
> >          sudo python2 ./setup.py install
> >      or by finding the appropriate modules for your distribution.
> >
> > Go to the location of the graberfiles in:
> >      /usr/share/mythtv/metadata/Television/
> >          sudo cp -p
> ...mythtv/mythtv/programs/scripts/metadata/Television/tvmaze.py .
> >          sudo cp -p
> ...mythtv/mythtv/programs/scripts/metadata/Television/tmdb3tv.py .
> >          (substitute ... with the location you downloaded mythtv into)
> >      fix the bug at line 504 in tvmaze.py
> >
> >          if not os.path.exists(cachedir):
> > -            os.makedirs(cachepath)
> > +            os.makedirs(cachedir)
> >          if sys.version_info[0] == 2:
> >
> >      if you installed the python3 bindings, ensure the first line of
> both files points to python3:
> >          #!/usr/bin/env python3
> >
> >      if you updated the python2 bindings,ensure the first line of both
> files points to python2:
> >          #!/usr/bin/env python2
> >
> > if you updated the python2 bindings, you also have to update tmdb3.py in
> >      /usr/share/mythtv/metadata/Movie/
> >      go there and run:
> >          sudo cp -p
> ...mythtv/mythtv/programs/scripts/metadata/Movie/tmdb3.py .
> >          (substitute ... with the location you downloaded mythtv into)
> >      I have not tested this tmdb3.py version with python2!
> >
> > Tests:
> > /usr/share/mythtv/metadata/Television/tvmaze.py -t
> > /usr/share/mythtv/metadata/Television/tmdb3tv.py -l en -a US -M Monk
> > /usr/share/mythtv/metadata/Television/tvmaze.py -l en -a US -M Monk
> >
> >
> >
>
>
> On my system with python2.7 I had to hack the lookup.py file line 300 from:
>
>     if query.isnumeric():
>
> to:
>
>     if unicode(query).isnumeric():
>
> because the string in query is not unicode.
>
> John
>
>
I have a fixes/29 system running and can look into this over the weekend.

Roland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20210225/ea82158e/attachment-0001.htm>


More information about the mythtv-users mailing list