akhan23wgu / amazon-alexa-lg-tv

⛔️ DEPRECATED Control your LG TV (webOS 2.0+) with Amazon Alexa
57 stars 21 forks source link

Error running command #9

Closed twaltersr closed 6 years ago

twaltersr commented 6 years ago

Getting the following error when running "python.exe lgtv.py auth 192.168.x.x File "lgtv.py", line 126 print e.message SyntaxError: Missing parentheses in call to 'print'. Did you mean print(print e.message)?

I am running PIP and Python from Windows 10.

twaltersr commented 6 years ago

I updated the line 126 to read: print (e.message) instead of print e.message and now getting this error.

File "lgtv.py", line 221 print "Error: Handshake failed"

twaltersr commented 6 years ago

After going through the entire file and adding ( ) around each print command, i am now getting this error.

Traceback (most recent call last): File "lgtv.py", line 480, in ws = LGTVClient(sys.argv[2]) File "lgtv.py", line 211, in init self.macAddress = getMacAddress(self.ip) File "lgtv.py", line 157, in getMacAddress matches = re.search(r"(([a-f\d]{1,2}\:){5}[a-f\d]{1,2})", s) File "C:\Users\Yoga\AppData\Local\Programs\Python\Python36-32\lib\re.py", line 182, in search return _compile(pattern, flags).search(string) TypeError: cannot use a string pattern on a bytes-like object

twaltersr commented 6 years ago

I downgraded to Python 2.7.14 and still getting an error when running "python.exe lgtv.py auth 192.168.x.x"

Traceback (most recent call last): File "lgtv.py", line 479, in ws = LGTVClient(sys.argv[2]) File "lgtv.py", line 215, in init super(LGTVClient, self).init('ws://' + self.__hostname + ':3000/', exclude_headers=["Origin"]) TypeError: init() got an unexpected keyword argument 'exclude_headers'

twaltersr commented 6 years ago

After finally getting past the above issues, Running "lgtv.py auth 192.168.x.x, and accepting the request on the TV: "Connection Request: LG Remove App" and selecting "Yes" , i get the following error.

{"closing": {"reason": "", "code": 1000}}

py -m c:\Python27\python.exe alex-tv.py C:\Python27\python.exe: Import by filename is not supported.

akhan23wgu commented 6 years ago

Doesn't run in Windows. Try an ubuntu VM or docker container.