[mythtv] Services API for ChannelServices / Video Source

Bill Meek keemllib at gmail.com
Thu Oct 31 14:07:11 UTC 2019

On 10/31/19 6:26 AM, Klaas de Waal wrote:
> Hi,
> I've recently added two parameters to the Video Source page of
> mythtv-setup, bouquet_id and region_id. These are used to get the
> channel numbers for Freesat and BSkyB on the Astra-2 28.2E satellite.
> I am now about to add these parameters to functions in
> channelservices.cpp/h such as AddVideoSource which are, as I
> understand it, part of what is called the Services API. This does
> compile cleanly but I am not aware of which other code or applications
> does actually use this.
> Are there applications I can test with or other steps I should take or
> shall I just commit this to master and wait what happens?
> Groetjes,
> Klaas.

Hi Klaas,

If you'd like me to run some test, just let me know when you push.

Otherwise, if it helps, I just added a parameter to an existing endpoint here:

     git log --author Bill --patch -1

5 files changed:


For testing, curl works OK. Sounds like the above adds/changes data,
which means a POST is required. Here's an old example of the format:

curl \
     --data ChanID=1021 \
     --data XMLTVID=20454 \

Or, you can use the Python bindings for the Services API similar to this:

"""Simple POST example"""

from __future__ import print_function
import os.path
import sys
from MythTV.services_api import send as api

def main():
     """Check arguments and call send() with a POST"""

         behost = sys.argv[1]
         dbhost = sys.argv[2]
         dbuser = sys.argv[3]
         dbpswd = sys.argv[4]
     except IndexError:
         sys.exit('\nUsage: {} backend_host db_host db_user db_password'

     postdata = {'HostName': dbhost, 'UserName': dbuser, 'Password': dbpswd}

     backend = api.Send(host=behost)
     backend.send(endpoint='Myth/TestDBSettings', postdata=postdata,
                  opts={'wrmi': True})

if __name__ == '__main__':


More information about the mythtv-dev mailing list