Project

General

Profile

Bug #3939

HTSP Api calls with Python HTSPClient

Added by C K over 8 years ago. Updated over 8 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
HTSP
Target version:
-
Start date:
2016-08-16
Due date:
% Done:

100%

Estimated time:
Found in version:
4.1-2163
Affected Versions:

Description

Hi, i'm trying to access some api calls with the python HTSPClient:

With this code I get a response:

>>> htsp = HTSPClient((hostname, 9982))
>>> msg = htsp.hello()
>>> htsp.send('api', {'path': 'status/inputs'})
>>> htsp.recv()
{'noaccess': 1}

But with authentication it returns nothing and TVH hangs up and needs to be restarted:

>>> htsp = HTSPClient((hostname, 9982))
>>> msg = htsp.hello()
>>> htsp.authenticate(username, password)
>>> htsp.send('api', {'path': 'status/inputs'})
>>> htsp.recv()

All other methods described in Wiki/Htsp works as expected.

History

#1

Updated by C K over 8 years ago

I'm not very well in C, but afaik the api method is defined here: https://github.com/tvheadend/tvheadend/blob/master/src/htsp_server.c#L1291

#2

Updated by C K over 8 years ago

I did a bit debugging:

  • htsp_method_api is called
  • r = api_exec(htsp->htsp_granted_access, remain, args, &resp); is called
  • i don't get the log entry failed to find subsystem api, so looking up the subsystem is ok, i checked that with other methods

so everything looks okay until src/api.c#L86, after that, some mysterious hooks are done :-)

#3

Updated by Jaroslav Kysela over 8 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset commit:tvheadend|9768e5d8cb71772d8023257b4727225261dc38bf.

#4

Updated by C K over 8 years ago

Wow thanks perexg. Will test it tomorrow

Also available in: Atom PDF