christopher-dG / gpymusic

Google Py Music: A simple TUI client for Google Play Music
MIT License
200 stars 13 forks source link

Oauth support for free and paid users #50

Closed academo closed 2 years ago

academo commented 5 years ago

Changes to add support for oauth to the player and avoid using username/password or app passwords.

In the last week oauth login support was introduced for the mobile client on gmusicapi which is the base lib for this client.

These changes are backwards compatible and should work with old versions of the library but if you want to use oauth you will need to uninstall the current gmusicapi and install the develop branch instead

pip3 uninstall gmusicapi pip3 install git+https://github.com/simon-weber/gmusicapi.git@develop#egg=gmusicapi

To tell gpymusic that should login with oauth you should add oauth: true to the user section on the configuration file

    "user": {
        "email": "email@gmail.com",
        "deviceid": "DEVICE_ID",
        "oauth": true
    },

the password is not longer required and email also should not be required but I want to keep it for future functionalities.

On the first run with oauth: true You'll be prompted to open an url, allow permissions and copy the given token from the web interface to the terminal. If this process fails the program will finish and you'll have to start over.

Please test and let me know if this works for you.