klattimer / LGWebOSRemote

Command line webOS remote for LGTVs
MIT License
490 stars 97 forks source link

Can't auth with TV #130

Closed elomeno closed 7 months ago

elomeno commented 7 months ago

DEBUG:getmac:Initializing 'ip4' method cache (platform: 'darwin') DEBUG:getmac:Finished initializing 'ip4' method cache DEBUG:getmac:Raw MAC found: b4:b2:91:c4:b3:4b Traceback (most recent call last): File "/opt/lgtv-venv/bin/lgtv", line 8, in sys.exit(main()) ^^^^^^ File "/opt/lgtv-venv/lib/python3.12/site-packages/LGTV/init.py", line 150, in main ws.connect() File "/opt/lgtv-venv/lib/python3.12/site-packages/ws4py/client/init.py", line 214, in connect self.sock = ssl.wrap_socket(self.sock, **self.ssl_options) ^^^^^^^^^^^^^^^ AttributeError: module 'ssl' has no attribute 'wrap_socket'

asebert-caue commented 7 months ago

Can someone help us with the same issue ?

❯lgtv auth 194.107.100.42 mytv ssl
DEBUG:getmac:Initializing 'ip4' method cache (platform: 'darwin')
DEBUG:getmac:Finished initializing 'ip4' method cache
DEBUG:getmac:Raw MAC found: 80:5b:65:a5:f8:4
DEBUG:getmac:Length of MAC 80:5b:65:a5:f8:4 is 16, padding single-character octets with zeros
Traceback (most recent call last):
  File "/Users/asebert/.local/bin/lgtv", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/asebert/.local/pipx/venvs/lgtv/lib/python3.12/site-packages/LGTV/__init__.py", line 150, in main
    ws.connect()
  File "/Users/asebert/.local/pipx/venvs/lgtv/lib/python3.12/site-packages/ws4py/client/__init__.py", line 214, in connect
    self.sock = ssl.wrap_socket(self.sock, **self.ssl_options)
                ^^^^^^^^^^^^^^^
AttributeError: module 'ssl' has no attribute 'wrap_socket'
steelsnake commented 7 months ago

Unfortunately this is due to a change in Python3 - it requires a code change. I'm not proficient in Python, but if anyone wants to have a gander, look at this post: https://github.com/eventlet/eventlet/issues/795#issuecomment-1806126264

klattimer commented 7 months ago

This isn't a problem with LGTV, it's a problem with ws4py.

Upstream issue appears to be tracked here: https://github.com/Lawouach/WebSocket-for-Python/issues/262

tonissssssss8eses commented 7 months ago

Try: lgtv --ssl auth 194.107.100.42 mytv

Work for me. Ubuntu Linux