Hi Renato,
I've been using the API via Python in order to gain information on the services. When using the API a JSON object is returned which you can parse and get the information.
http://<ip_for_tvh>:9981/api/service/list
That should return the JSON object for you. Below is a function from the script that I've written that will parse the JSON response and return the services that were found in last number of given days. It's part of a larger script that I use to email me if new services are found. It will inform me of the type of service and give me links to either map or disable the service from that email.
def getNew(self, offsetDays):
ret = []
if self.services is None:
self.get()
if not self.services is None:
for s in self.services['entries']:
p = s['params']
svc = None
for idx, val in enumerate(p):
if val['id'] == 'created' and 'value' in val:
c = val['value']
e = int(time.time())
o = e - (offsetDays * 24 * 60 * 60)
if c > o: #new service so get the name and when it was found
name = [val['value'] for idx, val in enumerate(p) if val['id'] == 'svcname' and 'value' in val]
if len(name):
svctype = [val['value'] for idx, val in enumerate(p) if val['id'] == 'dvb_servicetype' and 'value' in val]
svctype = Services.DVBServiceType[svctype[0]] if Services.DVBServiceType.has_key(svctype[0]) else svctype[0]
multiplex = [val['value'] for idx, val in enumerate(p) if val['id'] == 'multiplex' and 'value' in val][0]
if '.m3u - ' in multiplex:
svctype += ' (from playlist)'
mapdata = urllib.urlencode({'node': json.dumps({'services': [s['uuid']], 'encrypted': False, 'merge_same_name': True}, separators=(',', ':'))})
disabledata = urllib.urlencode({'node': json.dumps([{'enabled': False, 'uuid': s['uuid']}], separators=(',', ':'))})
svc = (name[0], svctype, Mail.getDateTimeFromEpoch(c), (self.rest.getURL('/api/service/mapper/save', creds=True), mapdata), (self.rest.getURL('/api/idnode/save', creds=True), disabledata))
break
if svc:
ret.append(svc)
if len(ret) == 0:
ret = None
else:
ret = sorted(ret, key=itemgetter(1), reverse=True)
return ret
Hope that helps.