Mailing List Archive

ttvdb
I'm having trouble with ttvdb.py. This is the message I'm getting:

The modules tvdb_api.py (v2.0 or greater).
They should have been installed along with the MythTV python bindings.
Error:(module 'requests_cache' has no attribute 'core')

I build from source and run on Gentoo.

I'm on python 3.9. Here's my list of installed packages:

Package Version
------------------ -----------
acme 1.18.0
appdirs 1.4.4
attrs 21.2.0
cattrs 1.8.0
certbot 1.18.0
certbot-apache 1.18.0
certifi 10001
cffi 1.14.6
chardet 4.0.0
charset-normalizer 2.0.4
ConfigArgParse 1.5.2
configobj 5.0.6
cryptography 3.4.7
Cython 0.29.23
deprecation 2.1.0
distro 1.6.0
docutils 0.17.1
eyeD3 0.9.6
filetype 1.0.7
future 0.18.2
futures 3.1.1
gdbus_codegen 2.68.3
gemato 16.2
gentoolkit 0.5.1.post1
idna 3.2
itsdangerous 2.0.1
Jinja2 3.0.1
josepy 1.8.0
layman 2.4.3
lxml 4.6.3
Mako 1.1.4
MarkupSafe 2.0.1
meson 0.58.2
mysqlclient 1.4.6
MythTV 31.0.-1
packaging 21.0
parsedatetime 2.6
pip 21.2.4
ply 3.11
portage 3.0.20
pycparser 2.20
Pygments 2.9.0
pyOpenSSL 20.0.1
pyparsing 2.4.7
pyproject2setuppy 20
pyRFC3339 1.1
PySocks 1.7.1
python-augeas 1.1.0
pytz 2021.1
requests 2.26.0
requests-cache 0.8.1
requests-toolbelt 0.9.1
SCons 4.1.0
setuptools 57.4.0
setuptools-scm 6.0.1
simplejson 3.17.3
six 1.16.0
ssl-fetch 0.4
toml 0.10.2
tomli 1.0.4
tvdb-api 3.0.2
url-normalize 1.4.3
urllib3 1.26.6
zope.component 4.4.1
zope.event 4.5.0
zope.interface 5.4.0
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: ttvdb [ In reply to ]
Until this issue is fixed in requests_cache_compatability.py
<https://github.com/MythTV/mythtv/blob/fixes/31/mythtv/bindings/python/MythTV/ttvdb/requests_cache_compatability.py#L49>
,
you need to downgrade to requests-cache < 0.8.0 , which was released: Sep
7, 2021.
Note: requests-cache 0.8.1 was released yesterday.

Before downgrading, please report back if this change helps in above linked
file:
Change
requests_cache.core.CachedSession.remove_expired_responses =
remove_expired_responses
to
requests_cache.CachedSession.remove_expired_responses =
remove_expired_responses
and report back.





On Thu, Sep 16, 2021 at 7:14 PM mythtv <mythtv@mdabbs.org> wrote:

> I'm having trouble with ttvdb.py. This is the message I'm getting:
>
> The modules tvdb_api.py (v2.0 or greater).
> They should have been installed along with the MythTV python bindings.
> Error:(module 'requests_cache' has no attribute 'core')
>
> I build from source and run on Gentoo.
>
> I'm on python 3.9. Here's my list of installed packages:
>
> Package Version
> ------------------ -----------
> acme 1.18.0
> appdirs 1.4.4
> attrs 21.2.0
> cattrs 1.8.0
> certbot 1.18.0
> certbot-apache 1.18.0
> certifi 10001
> cffi 1.14.6
> chardet 4.0.0
> charset-normalizer 2.0.4
> ConfigArgParse 1.5.2
> configobj 5.0.6
> cryptography 3.4.7
> Cython 0.29.23
> deprecation 2.1.0
> distro 1.6.0
> docutils 0.17.1
> eyeD3 0.9.6
> filetype 1.0.7
> future 0.18.2
> futures 3.1.1
> gdbus_codegen 2.68.3
> gemato 16.2
> gentoolkit 0.5.1.post1
> idna 3.2
> itsdangerous 2.0.1
> Jinja2 3.0.1
> josepy 1.8.0
> layman 2.4.3
> lxml 4.6.3
> Mako 1.1.4
> MarkupSafe 2.0.1
> meson 0.58.2
> mysqlclient 1.4.6
> MythTV 31.0.-1
> packaging 21.0
> parsedatetime 2.6
> pip 21.2.4
> ply 3.11
> portage 3.0.20
> pycparser 2.20
> Pygments 2.9.0
> pyOpenSSL 20.0.1
> pyparsing 2.4.7
> pyproject2setuppy 20
> pyRFC3339 1.1
> PySocks 1.7.1
> python-augeas 1.1.0
> pytz 2021.1
> requests 2.26.0
> requests-cache 0.8.1
> requests-toolbelt 0.9.1
> SCons 4.1.0
> setuptools 57.4.0
> setuptools-scm 6.0.1
> simplejson 3.17.3
> six 1.16.0
> ssl-fetch 0.4
> toml 0.10.2
> tomli 1.0.4
> tvdb-api 3.0.2
> url-normalize 1.4.3
> urllib3 1.26.6
> zope.component 4.4.1
> zope.event 4.5.0
> zope.interface 5.4.0
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
>
Re: ttvdb [ In reply to ]
On 9/16/21 1:02 PM, Roland Ernst wrote:
> Until this issue is fixed in requests_cache_compatability.py
> <https://github.com/MythTV/mythtv/blob/fixes/31/mythtv/bindings/python/MythTV/ttvdb/requests_cache_compatability.py#L49>
> ,
> you need to downgrade to requests-cache <  0.8.0 , which was released:
> Sep 7, 2021.
> Note: requests-cache  0.8.1 was released yesterday.
>
> Before downgrading, please report back if this change helps in above
> linked file:
> Change
> requests_cache.core.CachedSession.remove_expired_responses =
> remove_expired_responses
> to
> requests_cache.CachedSession.remove_expired_responses =
> remove_expired_responses
> and report back.
>
>
>

Just making that change...

Traceback (most recent call last):
File "/usr/local/share/mythtv/metadata/Television/ttvdb.py", line
2717, in <module>
sys.exit(main())
File "/usr/local/share/mythtv/metadata/Television/ttvdb.py", line
2383, in main
t = Tvdb(banners=False,
File "/usr/lib/python3.9/site-packages/MythTV/ttvdb/tvdb_api.py",
line 701, in __init__
self.session.remove_expired_responses()
File
"/usr/lib/python3.9/site-packages/MythTV/ttvdb/requests_cache_compatability.py",
line 38, in remove_expired_responses
if not self._cache_expire_after:
AttributeError: 'CachedSession' object has no attribute
'_cache_expire_after'
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: ttvdb [ In reply to ]
On 9/16/21 2:11 PM, mythtv wrote:
> On 9/16/21 1:02 PM, Roland Ernst wrote:
>> Until this issue is fixed in requests_cache_compatability.py
>> <https://github.com/MythTV/mythtv/blob/fixes/31/mythtv/bindings/python/MythTV/ttvdb/requests_cache_compatability.py#L49>
>> ,
>> you need to downgrade to requests-cache <  0.8.0 , which was released:
>> Sep 7, 2021.
>> Note: requests-cache  0.8.1 was released yesterday.
>>
>> Before downgrading, please report back if this change helps in above
>> linked file:
>> Change
>> requests_cache.core.CachedSession.remove_expired_responses =
>> remove_expired_responses
>> to
>> requests_cache.CachedSession.remove_expired_responses =
>> remove_expired_responses
>> and report back.
>>
>>
>>
>
> Just making that change...
>
> Traceback (most recent call last):
>   File "/usr/local/share/mythtv/metadata/Television/ttvdb.py", line
> 2717, in <module>
>     sys.exit(main())
>   File "/usr/local/share/mythtv/metadata/Television/ttvdb.py", line
> 2383, in main
>     t = Tvdb(banners=False,
>   File "/usr/lib/python3.9/site-packages/MythTV/ttvdb/tvdb_api.py",
> line 701, in __init__
>     self.session.remove_expired_responses()
>   File
> "/usr/lib/python3.9/site-packages/MythTV/ttvdb/requests_cache_compatability.py",
> line 38, in remove_expired_responses
>     if not self._cache_expire_after:
> AttributeError: 'CachedSession' object has no attribute
> '_cache_expire_after'
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org

I downgraded requests_cache to 0.7.5 and now I'm getting this:

/usr/local/share/mythtv/metadata/Television/ttvdb.py:1952:
DeprecationWarning: The SafeConfigParser class has been renamed to
ConfigParser in Python 3.2. This alias will be removed in future
versions. Use ConfigParser directly instead.
cfg = ConfigParser.SafeConfigParser()
Traceback (most recent call last):
File "/usr/local/share/mythtv/metadata/Television/ttvdb.py", line
2717, in <module>
sys.exit(main())
File "/usr/local/share/mythtv/metadata/Television/ttvdb.py", line
2519, in main
seriesfound=searchseries(t, opts, series_season_ep)
File "/usr/local/share/mythtv/metadata/Television/ttvdb.py", line
1533, in searchseries
series_data = search_for_series(t, series_name, opts.language)
File "/usr/local/share/mythtv/metadata/Television/ttvdb.py", line
1515, in search_for_series
return tvdb[sid_or_name]
File "/usr/lib/python3.9/site-packages/MythTV/ttvdb/tvdb_api.py",
line 1185, in __getitem__
sid = self._nameToSid(key)
File "/usr/lib/python3.9/site-packages/MythTV/ttvdb/tvdb_api.py",
line 1164, in _nameToSid
selected_series = self._getSeries(name)
File "/usr/lib/python3.9/site-packages/MythTV/ttvdb/tvdb_api.py",
line 933, in _getSeries
allSeries = self.search(series)
File "/usr/lib/python3.9/site-packages/MythTV/ttvdb/tvdb_api.py",
line 913, in search
seriesEt = self._getetsrc(self.config['url_getSeries'] % (series))
File "/usr/lib/python3.9/site-packages/MythTV/ttvdb/tvdb_api.py",
line 870, in _getetsrc
src = self._loadUrl(url, language=language)
File "/usr/lib/python3.9/site-packages/MythTV/ttvdb/tvdb_api.py",
line 817, in _loadUrl
self.authorize()
File "/usr/lib/python3.9/site-packages/MythTV/ttvdb/tvdb_api.py",
line 857, in authorize
r = self.session.post('https://api.thetvdb.com/login',
json=self.config['auth_payload'], headers=self.headers)
File "/usr/lib/python3.9/site-packages/requests/sessions.py", line
590, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File
"/home/mythtv/.local/lib/python3.9/site-packages/requests_cache/session.py",
line 101, in request
return super().request(
File "/usr/lib/python3.9/site-packages/requests/sessions.py", line
542, in request
resp = self.send(prep, **send_kwargs)
File
"/home/mythtv/.local/lib/python3.9/site-packages/requests_cache/session.py",
line 113, in send
cache_key = self.cache.create_key(request, **kwargs)
TypeError: create_key() got an unexpected keyword argument 'timeout'
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: ttvdb [ In reply to ]
On Fri, Sep 17, 2021 at 5:07 PM mythtv <mythtv@mdabbs.org> wrote:

> On 9/16/21 2:11 PM, mythtv wrote:
> > On 9/16/21 1:02 PM, Roland Ernst wrote:
> >> Until this issue is fixed in requests_cache_compatability.py
> >> <
> https://github.com/MythTV/mythtv/blob/fixes/31/mythtv/bindings/python/MythTV/ttvdb/requests_cache_compatability.py#L49>
>
> >> ,
> >> you need to downgrade to requests-cache < 0.8.0 , which was released:
> >> Sep 7, 2021.
> >> Note: requests-cache 0.8.1 was released yesterday.
> >>
> >> Before downgrading, please report back if this change helps in above
> >> linked file:
> >> Change
> >> requests_cache.core.CachedSession.remove_expired_responses =
> >> remove_expired_responses
> >> to
> >> requests_cache.CachedSession.remove_expired_responses =
> >> remove_expired_responses
> >> and report back.
> >>
> >>
> >>
> >
> > Just making that change...
> >
> > Traceback (most recent call last):
> > File "/usr/local/share/mythtv/metadata/Television/ttvdb.py", line
> > 2717, in <module>
> > sys.exit(main())
> > File "/usr/local/share/mythtv/metadata/Television/ttvdb.py", line
> > 2383, in main
> > t = Tvdb(banners=False,
> > File "/usr/lib/python3.9/site-packages/MythTV/ttvdb/tvdb_api.py",
> > line 701, in __init__
> > self.session.remove_expired_responses()
> > File
> >
> "/usr/lib/python3.9/site-packages/MythTV/ttvdb/requests_cache_compatability.py",
>
> > line 38, in remove_expired_responses
> > if not self._cache_expire_after:
> > AttributeError: 'CachedSession' object has no attribute
> > '_cache_expire_after'
> > _______________________________________________
> > mythtv-users mailing list
> > mythtv-users@mythtv.org
> > http://lists.mythtv.org/mailman/listinfo/mythtv-users
> > http://wiki.mythtv.org/Mailing_List_etiquette
> > MythTV Forums: https://forum.mythtv.org
>
> I downgraded requests_cache to 0.7.5 and now I'm getting this:
>
> /usr/local/share/mythtv/metadata/Television/ttvdb.py:1952:
> DeprecationWarning: The SafeConfigParser class has been renamed to
> ConfigParser in Python 3.2. This alias will be removed in future
> versions. Use ConfigParser directly instead.
> cfg = ConfigParser.SafeConfigParser()
> Traceback (most recent call last):
> File "/usr/local/share/mythtv/metadata/Television/ttvdb.py", line
> 2717, in <module>
> sys.exit(main())
> File "/usr/local/share/mythtv/metadata/Television/ttvdb.py", line
> 2519, in main
> seriesfound=searchseries(t, opts, series_season_ep)
> File "/usr/local/share/mythtv/metadata/Television/ttvdb.py", line
> 1533, in searchseries
> series_data = search_for_series(t, series_name, opts.language)
> File "/usr/local/share/mythtv/metadata/Television/ttvdb.py", line
> 1515, in search_for_series
> return tvdb[sid_or_name]
> File "/usr/lib/python3.9/site-packages/MythTV/ttvdb/tvdb_api.py",
> line 1185, in __getitem__
> sid = self._nameToSid(key)
> File "/usr/lib/python3.9/site-packages/MythTV/ttvdb/tvdb_api.py",
> line 1164, in _nameToSid
> selected_series = self._getSeries(name)
> File "/usr/lib/python3.9/site-packages/MythTV/ttvdb/tvdb_api.py",
> line 933, in _getSeries
> allSeries = self.search(series)
> File "/usr/lib/python3.9/site-packages/MythTV/ttvdb/tvdb_api.py",
> line 913, in search
> seriesEt = self._getetsrc(self.config['url_getSeries'] % (series))
> File "/usr/lib/python3.9/site-packages/MythTV/ttvdb/tvdb_api.py",
> line 870, in _getetsrc
> src = self._loadUrl(url, language=language)
> File "/usr/lib/python3.9/site-packages/MythTV/ttvdb/tvdb_api.py",
> line 817, in _loadUrl
> self.authorize()
> File "/usr/lib/python3.9/site-packages/MythTV/ttvdb/tvdb_api.py",
> line 857, in authorize
> r = self.session.post('https://api.thetvdb.com/login',
> json=self.config['auth_payload'], headers=self.headers)
> File "/usr/lib/python3.9/site-packages/requests/sessions.py", line
> 590, in post
> return self.request('POST', url, data=data, json=json, **kwargs)
> File
> "/home/mythtv/.local/lib/python3.9/site-packages/requests_cache/session.py",
>
> line 101, in request
> return super().request(
> File "/usr/lib/python3.9/site-packages/requests/sessions.py", line
> 542, in request
> resp = self.send(prep, **send_kwargs)
> File
> "/home/mythtv/.local/lib/python3.9/site-packages/requests_cache/session.py",
>
> line 113, in send
> cache_key = self.cache.create_key(request, **kwargs)
> TypeError: create_key() got an unexpected keyword argument 'timeout'
>
>

There is a known dependency deficiency of these python modules:

python3-urllib3
python3-requests
python3-requests-cache


Often, the latest releases do not fit together.
(See https://forum.mythtv.org/viewtopic.php?t=4037 )

It is up to the OS maintainers, do find valid combinations:

Debian Sid & Bullseye:
python3-urllib3_1.26.5-1~exp1_all.deb
python3-requests_2.25.1+dfsg-2_all.deb
python3-requests-cache_0.5.2-1_all.deb

Fedora Rawhide:
python3-urllib3-1.26.6-2.fc35.noarch.rpm
python3-requests-2.26.0-1.fc35.noarch.rpm
python3-requests-cache-0.5.1-9.fc35.noarch.rpm

Fedora 34:
python3-urllib3-1.25.10-4.fc34.noarch.rpm
python3-requests-2.25.1-1.fc34.noarch.rpm
python3-requests-cache-0.5.1-7.fc34.noarch.rpm
Re: ttvdb [ In reply to ]
On 9/19/21 6:20 AM, Roland Ernst wrote:
>
> There is a known dependency deficiency of these python modules:
>
> python3-urllib3
> python3-requests
> python3-requests-cache
>
>
> Often, the latest releases do not fit together.
> (See https://forum.mythtv.org/viewtopic.php?t=4037
> <https://forum.mythtv.org/viewtopic.php?t=4037> )
>
> It is up to the OS maintainers, do find valid combinations:
>
> Debian Sid & Bullseye:
> python3-urllib3_1.26.5-1~exp1_all.deb
> python3-requests_2.25.1+dfsg-2_all.deb
> python3-requests-cache_0.5.2-1_all.deb
>
> Fedora Rawhide:
> python3-urllib3-1.26.6-2.fc35.noarch.rpm
> python3-requests-2.26.0-1.fc35.noarch.rpm
> python3-requests-cache-0.5.1-9.fc35.noarch.rpm
>
> Fedora 34:
> python3-urllib3-1.25.10-4.fc34.noarch.rpm
> python3-requests-2.25.1-1.fc34.noarch.rpm
> python3-requests-cache-0.5.1-7.fc34.noarch.rpm
>
>
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
>
Thanks, the rawhide combo was closest to what I had and now its working
again.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org