[mythtv-users] mythbackend --printexpire
Tom Hayward
esarfl at gmail.com
Tue Jul 31 19:42:39 UTC 2012
On Tue, Jul 31, 2012 at 12:26 PM, Raymond Wagner <raymond at wagnerrp.com> wrote:
> On 7/31/2012 13:11, Tom Hayward wrote:
>>
>> In 0.24, I could run the command "mythbackend --printexpire" and see a
>> list of the recordings next eligible for autoexpire. This was helpful
>> for tuning my priorities--and no surprises when recordings were
>> expired. With 0.25, the expire list never prints. I just get the
>> normal startup lines...
>
>
> Thanks for spotting that. I accidentally inverted the logic to run that
> option about a year back, so it would just terminate immediately rather than
> printing out those lines. Corrected in 0.25 and 0.26.
Thanks for the fix Raymond. Unfortunately I'm not sure I'll have time
to install while the Olympics are in progress. Uptime is critical for
WAF...
A more customized solution will solve my use case better anyway. I've
started playing with the python bindings for the first time and I've
run into some issues.
MythXML().getExpiring() seems to map to Dvr/GetExpiring, when the
correct url is Dvr/GetExpiringList.
>>> import MythTV
>>> for i in MythTV.MythXML().getExpiring():
... i
... break
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/pymodules/python2.7/MythTV/methodheap.py", line 1202,
in getExpiring
for prog in self._request('Dvr/GetExpiring')\
File "/usr/lib/pymodules/python2.7/MythTV/connections.py", line 574,
in readJSON
return json.loads(self.read())
File "/usr/lib/pymodules/python2.7/MythTV/connections.py", line 563, in read
def read(self): return self.open().read()
File "/usr/lib/pymodules/python2.7/MythTV/connections.py", line 562, in open
def open(self): return urllib2.urlopen(self)
File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 406, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 444, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 527, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found
And MythBE().getExpiring() is not sorted, or sorted by record date,
not expire priority:
>>> for i in MythTV.MythBE().getExpiring():
... i
... break
...
<Program 'Good Eats','2010-10-14 17:30:00' at 0x1b113d0>
That is my earliest recording, and it is unwatched so very low on the
autoexpire list.
This url works: http://t3:6544/Dvr/GetExpiringList. Now I'm
considering using an XML library instead of Myth python bindings to
parse that response. But maybe I'm just doing something wrong.
Tom
More information about the mythtv-users
mailing list