Skip to content

Conversation

@whyscream
Copy link

@whyscream whyscream commented Jan 4, 2026

New attempt on #5

  • Connect to the TV
  • Trigger the TV to display a pairing code
  • Use pairing code to authenticate
  • Execute commands
  • Implement HDCP-specific list of commands (command IDs)
  • Query TV status (required for volume change and channel switching)
  • ...

I have a LG 42LW650S from 2011, running Netcast and an 'LG HDCP Server' according to the HTTP response headers.

I found some earlier (partial) implementations and discussions of this interface at:

@whyscream
Copy link
Author

whyscream commented Jan 4, 2026

The data querying requests all go nowhere: GET /hdcp/api/data?target=foo HTTP/1.1" returns a HTTP 400. This blocks support for higher level functionality like set_volume, change_channel. There is nothing about querying in the other implementations either. Maybe it was never supported? Some further research needed.

The interesting part is that not all requests are handled equal: some get a HTTP 400, others a HTTP 401. There is no difference in whether or not the User-Agent: UDAP/2.0 header is sent along.

DEBUG:pylgnetcast.pylgnetcast:_send_to_tv: message_type=data, message=None, payload={'target': 'cur_channel'}
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): lgtv.fritz.box:8080
DEBUG:urllib3.connectionpool:http://lgtv.fritz.box:8080 "GET /hdcp/api/data?target=cur_channel HTTP/1.1" 401 160
DEBUG:pylgnetcast.pylgnetcast:_send_to_tv: message_type=data, message=None, payload={'target': 'volume_info'}
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): lgtv.fritz.box:8080
DEBUG:urllib3.connectionpool:http://lgtv.fritz.box:8080 "GET /hdcp/api/data?target=volume_info HTTP/1.1" 400 159
DEBUG:pylgnetcast.pylgnetcast:_send_to_tv: message_type=data, message=None, payload={'target': 'context_ui'}
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): lgtv.fritz.box:8080
DEBUG:urllib3.connectionpool:http://lgtv.fritz.box:8080 "GET /hdcp/api/data?target=context_ui HTTP/1.1" 401 160
DEBUG:pylgnetcast.pylgnetcast:_send_to_tv: message_type=data, message=None, payload={'target': 'is_3d'}
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): lgtv.fritz.box:8080
DEBUG:urllib3.connectionpool:http://lgtv.fritz.box:8080 "GET /hdcp/api/data?target=is_3d HTTP/1.1" 400 159

@whyscream whyscream changed the title HDCP protocol support HDCP protocol support (pre 2012 LG TV) Jan 4, 2026
@whyscream whyscream force-pushed the hdcp-support branch 2 times, most recently from 0847dc1 to 646b9b0 Compare January 4, 2026 20:22
This resolves authentication issues with HDCP, and proper command sending
…e two.

This helps in keeping upstream functionality simple. You can use ROAP commands
and they will be translated to HDCP automatically (as far as supported).
Use `client.send_command(2, command_protocol=LG_PROTOCOL.HDCP)` when you're sending native HDCP commands.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant