Skip to content

Issue getting token when running example.py #2

@mflammia

Description

@mflammia

Quick thank you for creating the code, look forward to getting it working :)

Just at this step of the process:

"The script will ask you to open a browser, log in, and then paste the URL you're redirected to. It will then write a JSON file called wideq_state.json._"

I copy the URL into the browser, enter my LG account details and it just keeps coming back with the message:

us.m.lgaccount.com says:
Please check your network and try again

I can login with the same account to the following:

https://sso.lg.com/oauth/page/login?authorizeKey=9c837df5-72db-4991-82e6-451be0636657

There is an option to login with facebook, which then returned the following URL:

https://us.m.lgaccount.com/login/sign_in?country=UK&language=en-EN&svcCode=SVC202&authSvr=oauth2&client_id=LGAO221A02&onyx_feature=N&division=ha&show_select_country=N&show_add_services=N&oauthTokenExpiredFlag=N&os_type=PC&thirdParty=facebook#_=_

Then read somewhere else the details in the wideq.py file needs to be precise, so although I'm in the country UK I set it back to 'PL'. The URL then seemed to work and took my through a menu asking for date of birth and some terms and conditions.

After that I got a page could not be found message.

Followed the link again and got what seemed the correct URL, but when entering got the following:

root@Home-NAS:~/LGAC_SmartT# python3 example.py
Log in here:
https://pl.m.lgaccount.com/login/sign_in?svcCode=SVC202&country=PL&language=en-EN&grant_type=password&division=ha&authSvr=oauth2&client_id=LGAO221A02
Then paste the URL where the browser is redirected:
https://gb.m.lgaccount.com/login/iabClose?access_token=d0987ba87a6e753805fe0ca1331a3ed8f4b268a93e87c524bab1926f34918df5b69bba82d94443ab78a31db1fce1a6c2&refresh_token=968a114090eb4216fc78f2f6016cf8681e0318bf42be3b22a383b4a6290ffb3052ea754b4f4a8fda89e4440c727fdd7a&oauth2_backend_url=https://gb.lgeapi.com/
Traceback (most recent call last):
  File "example.py", line 214, in <module>
    example(sys.argv[1:])
  File "example.py", line 200, in example
    example_command(client, args)
  File "example.py", line 177, in example_command
    ls(client)
  File "example.py", line 25, in ls
    for device in client.devices:
  File "/root/LGAC_SmartT/wideq.py", line 474, in devices
    self._devices = self.session.get_devices()
  File "/root/LGAC_SmartT/wideq.py", line 465, in session
    self._session, self._devices = self.auth.start_session()
  File "/root/LGAC_SmartT/wideq.py", line 257, in start_session
    return Session(self, session_id), as_list(session_info['item'])
KeyError: 'item'

So at this point I'm stuck.

One additoinal bit of information I'm not sure is relevant I got a warning about a PATH when running the command below:

root@Home-NAS:~/LGAC_SmartT# python3 -m pip install -e .
Obtaining file:///root/LGAC_SmartT
Collecting requests
  Downloading requests-2.23.0-py2.py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 641 kB/s
Collecting chardet<4,>=3.0.2
  Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 5.7 MB/s
Collecting idna<3,>=2.5
  Downloading idna-2.9-py2.py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 1.7 MB/s
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
  Downloading urllib3-1.25.8-py2.py3-none-any.whl (125 kB)
     |████████████████████████████████| 125 kB 5.9 MB/s
Collecting certifi>=2017.4.17
  Downloading certifi-2020.4.5.1-py2.py3-none-any.whl (157 kB)
     |████████████████████████████████| 157 kB 5.7 MB/s
Installing collected packages: chardet, idna, urllib3, certifi, requests, wideq
  WARNING: The script chardetect is installed in '/volume1/@appstore/py3k/usr/local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  Running setup.py develop for wideq

Be useful for some pointers.

Many thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions