[mythtv-users] Finding next schedluled recording externally?

Raymond Wagner raymond at wagnerrp.com
Sat Feb 6 18:20:50 UTC 2010


On 2/6/2010 11:24, Michael T. Dean wrote:
> http://www.mythtv.org/wiki/Python_bindings
>    

A bit of explanation on that...

The documentation on that page is for the bindings in trunk.  Under 
0.22, you would do something like the following.

 >>> from MythTV import MythTV
 >>> be = MythTV()
 >>> a = be.getUpcomingRecordings()
 >>> a[0]
House (2010-02-08 20:00:00)
 >>> a[0].title, a[0].subtitle
(u'House', u'5 to 9')

Under trunk, you've got two options.  You can use the backend connection 
as before.

 >>> from MythTV import MythBE
 >>> be = MythBE()
 >>> a = be.getUpcomingRecordings()
 >>> a[0]
<Program 'House','2010-02-08 20:00:00' at 0x803b085d0>

Or you can use the XML interface used by mythtv-status.

 >>> from MythTV import MythXMLConn
 >>> xml = MythXMLConn()
 >>> a = xml._queryTree('xml')
 >>> a.find('Scheduled').getchildren()[0].attrib
{'category': 'Drama', 'seriesId': 'EP00688359', 'catType': 'series', 
'subTitle': '5 to 9', 'startTime': '2010-02-08T20:00:00', 'title': 
'House', 'programFlags': '0', 'hostname': 'mythbe', 'airdate': 
'2010-02-08', 'programId': 'EP006883590129', 'repeat': '0', 'fileSize': 
'0', 'stars': '0', 'lastModified': '2010-02-06T05:05:00', 'endTime': 
'2010-02-08T21:00:00'}


More information about the mythtv-users mailing list