[mythtv] Myth Services API - Authentication
Kai T. Hillmann
info at kaih.de
Mon Sep 19 20:36:22 UTC 2016
Am 19.09.2016 um 16:36 schrieb Bill Meek:
> On 09/19/2016 08:36 AM, Kai T. Hillmann wrote:
> ...
>> I've tried yesterday using json encoding - is that possible too or only
>> formular based?
>
> JSON works too. I use this:
>
>
> https://www.mythtv.org/wiki/Python_API_Examples#The_module_used_in_the_examples_above
>
>
> which does:
>
> session.headers.update({'Accept':'application/json'})
Well, i tried it using this utility/api...
#!/usr/bin/env python
import utilities as api
opts={}
opts['user']='admin'
opts['pass']='mythtv'
opts['debug']=True
opts['wrmi']=True
postdata={'username':'admin', 'oldpassword': 'mythtv', 'newpassword':
'test'}
resultDict = api.Send(host='localhost', endpoint='Myth/ChangePassword',
opts=opts, postdata=postdata)
print 'Entire response:', resultDict
#print 'Backend hostname (MythTV profile name) is: ', resultDict['String']
but that lead to
Debug: Missing opts set to False: noetag, nogzip, usexml, wsdl
Debug: New session: <requests.sessions.Session object at 0x7f5058f644d0>
Debug: URL = http://localhost:6544/Myth/version
Debug: 1st 60 bytes of response: {"String": "5.0"}
Debug: URL = http://localhost:6544/Myth/ChangePassword
Debug: The following postdata was included:
username admin
newpassword test
oldpassword mythtv
Entire response: {'Abort': 'Unexpected status returned: 500: URL was:
http://localhost:6544/Myth/ChangePassword'}
Changing the dictionary keys to the camelcase ones won't help...
Some log information (as suggested with --setverbose http:debug):
http://pastebin.com/jXQXJ4j1 - i'm a bit confused - valid authentication
but old password invalid to change?!?
Any ideas left? ;)
More information about the mythtv-dev
mailing list