tehkillerbee / mopidy-tidal

Tidal Backend plugin for Mopidy
Apache License 2.0
93 stars 28 forks source link

Unable to authorize tidal account and create the .json file #105

Closed derok11 closed 1 year ago

derok11 commented 1 year ago

Moin, hope somebody can help me with my problem to create the json file and authorize my tidal account here is the code before and after the OAuth Flow.

pi@rekorder:~` $ journalctl -u mopidy | tail -10
Apr 23 18:03:16 rekorder mopidy[1118]: INFO     [MainThread] mopidy.__main__ Disabled extensions: none
Apr 23 18:03:16 rekorder mopidy[1118]: INFO     [MainThread] mopidy.commands Starting Mopidy mixer: SoftwareMixer
Apr 23 18:03:16 rekorder mopidy[1118]: INFO     [MainThread] mopidy.commands Starting Mopidy audio
Apr 23 18:03:16 rekorder mopidy[1118]: INFO     [MainThread] mopidy.commands Starting Mopidy backends: TidalBackend, FileBackend, M3UBackend, StreamBackend
Apr 23 18:03:16 rekorder mopidy[1118]: INFO     [TidalBackend-3] mopidy_tidal.backend Connecting to TIDAL.. Quality = LOSSLESS
Apr 23 18:03:16 rekorder mopidy[1118]: INFO     [TidalBackend-3] mopidy_tidal.backend Connecting to TIDAL.. using default client id & client secret from python-tidal
Apr 23 18:03:16 rekorder mopidy[1118]: INFO     [TidalBackend-3] mopidy_tidal.backend Could not load OAuth session from /var/lib/mopidy/tidal/tidal-oauth.json: [Errno 2] No such file or directory: '/var/lib/mopidy/tidal/tidal-oauth.json'
Apr 23 18:03:16 rekorder mopidy[1118]: INFO     [TidalBackend-3] mopidy_tidal.backend Creating new OAuth session...
Apr 23 18:03:16 rekorder mopidy[1118]: INFO     [Audio-2] mopidy.audio.actor Audio output set to "autoaudiosink"
Apr 23 18:03:17 rekorder mopidy[1118]: INFO     [TidalBackend-3] mopidy_tidal.backend Visit link.tidal.com/SDRAI to log in, the code will expire in 300 seconds

pi@rekorder:~ $ journalctl -u mopidy | tail -10
Apr 23 18:05:07 rekorder mopidy[1118]: KeyError: 'picture'
Apr 23 18:05:07 rekorder mopidy[1118]: ERROR    [MainThread] mopidy.commands Actor died: TidalBackend (urn:uuid:a2264bbd-0b0c-4833-bf8f-71c62f4973af) stopped before handling the message
Apr 23 18:05:07 rekorder mopidy[1118]: INFO     [MainThread] mopidy.commands Starting Mopidy core
Apr 23 18:05:07 rekorder mopidy[1118]: INFO     [MainThread] mopidy.commands Starting Mopidy frontends: IrisFrontend, HttpFrontend
Apr 23 18:05:07 rekorder mopidy[1118]: INFO     [IrisFrontend-8] mopidy_iris.core Starting Iris 3.66.1
Apr 23 18:05:07 rekorder mopidy[1118]: INFO     [HttpFrontend-10] mopidy.http.actor HTTP server running at [::ffff:0.0.0.0]:6680
Apr 23 18:05:07 rekorder mopidy[1118]: INFO     [MainThread] mopidy.commands Starting GLib mainloop
Apr 23 18:05:27 rekorder mopidy[1118]: WARNING  [FileBackend-4] mopidy.file.library Failed looking up file:///var/lib/mopidy: gst-resource-error-quark: "/var/lib/mopidy" is a directory. (5)
Apr 23 18:05:27 rekorder mopidy[1118]: WARNING  [FileBackend-4] mopidy.file.library Failed looking up file:///var/lib/mopidy: gst-resource-error-quark: "/var/lib/mopidy" is a directory. (5)
Apr 23 18:05:28 rekorder mopidy[1118]: WARNING  [FileBackend-4] mopidy.file.library Failed looking up file:///var/lib/mopidy/tidal: gst-resource-error-quark: "/var/lib/mopidy/tidal" is a directory. (5)
pi@rekorder:~ $ cd /var/lib/mopidy
pi@rekorder:/var/lib/mopidy $ ls -la
total 28
drwxr-xr-x  7 mopidy audio 4096 Apr 11 20:32 .
drwxr-xr-x 25 root   root  4096 Apr 11 20:17 ..
drwxr-xr-x  3 mopidy audio 4096 Apr 11 20:21 .cache
drwxr-xr-x  2 mopidy audio 4096 Apr 11 20:23 http
drwxr-xr-x  2 mopidy audio 4096 Apr 11 20:32 iris
drwxr-xr-x  2 mopidy audio 4096 Feb  5 22:43 m3u
drwxr-xr-x  2 mopidy audio 4096 Apr 11 20:26 tidal
pi@rekorder:/var/lib/mopidy $ cd /var/lib/mopidy/tidal
pi@rekorder:/var/lib/mopidy/tidal $ ls -la
total 8
drwxr-xr-x 2 mopidy audio 4096 Apr 11 20:26 .
drwxr-xr-x 7 mopidy audio 4096 Apr 11 20:32 ..

Thanks derok11

fmarzocca commented 1 year ago

Did you install latest release?? It fixes this. If you install latest mopidy-tidal from master, you should not have any issues.

derok11 commented 1 year ago

Yes I do. I've uninstalled everything and then installed the latest version by using sudo pip3 install Mopidy-Tidal That should be the master!?!

derok11 commented 1 year ago

Here is an other Error Message

Apr 23 20:05:53 rekorder mopidy[894]: File "/usr/local/lib/python3.9/dist-packages/tidalapi/user.py", line 77, in parse Apr 23 20:05:53 rekorder mopidy[894]: self.picture_id = json_obj['picture'] Apr 23 20:05:53 rekorder mopidy[894]: KeyError: 'picture'

maybe this one helps to solve my Problem...

tehkillerbee commented 1 year ago

@derok11 This is a known issue caused by a bug in tidalapi that have not yet been fixed.

Please refer to #97 and make sure you have installed the latest version of mopidy-tidal from master.

The mopidy-tidal package on Pypi is unfortunately not currently the latest version so please install directly from the git repository.

derok11 commented 1 year ago

Thanks! In my case

sudo pip3 uninstall mopidy-tidal
sudo pip3 install git+https://github.com/tehkillerbee/mopidy-tidal

?!?

tehkillerbee commented 1 year ago

@derok11 Yes, that should work as BlackLight's changes has been merged in :)

derok11 commented 1 year ago

@tehkillerbee Sorry it´s me again. So I have instaled the latest version from your git

pi@rekorder:~ $ sudo pip3 install git+https://github.com/tehkillerbee/mopidy-tidal.git
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting git+https://github.com/tehkillerbee/mopidy-tidal.git
  Cloning https://github.com/tehkillerbee/mopidy-tidal.git to /tmp/pip-req-build-92hmn02y
  Running command git clone -q https://github.com/tehkillerbee/mopidy-tidal.git /tmp/pip-req-build-92hmn02y
Collecting tidalapi@ git+https://github.com/BlackLight/python-tidal
  Cloning https://github.com/BlackLight/python-tidal to /tmp/pip-install-mat6ty7v/tidalapi_afc666e892a841a99a302c4a3ef3a500
  Running command git clone -q https://github.com/BlackLight/python-tidal /tmp/pip-install-mat6ty7v/tidalapi_afc666e892a841a99a302c4a3ef3a500
Requirement already satisfied: Mopidy>=3.0 in /usr/lib/python3/dist-packages (from Mopidy-Tidal==0.3.2) (3.4.1)
Requirement already satisfied: Pykka>=1.1 in /usr/lib/python3/dist-packages (from Mopidy-Tidal==0.3.2) (2.0.3)
Requirement already satisfied: requests>=2.0.0 in /usr/lib/python3/dist-packages (from Mopidy-Tidal==0.3.2) (2.25.1)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from Mopidy-Tidal==0.3.2) (52.0.0)
Requirement already satisfied: python-dateutil in /usr/local/lib/python3.9/dist-packages (from tidalapi@ git+https://github.com/BlackLight/python-tidal->Mopidy-Tidal==0.3.2) (2.8.2)
Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil->tidalapi@ git+https://github.com/BlackLight/python-tidal->Mopidy-Tidal==0.3.2) (1.16.0)
Building wheels for collected packages: Mopidy-Tidal
  Building wheel for Mopidy-Tidal (setup.py) ... done
  Created wheel for Mopidy-Tidal: filename=Mopidy_Tidal-0.3.2-py2.py3-none-any.whl size=27582 sha256=a5982eb0d2965220fb2ec7ae26a1e85f6b7d76f25be46f2ca79d9d3b5c3385b0
  Stored in directory: /tmp/pip-ephem-wheel-cache-pih5ex2q/wheels/bc/cd/e2/4cb22ed7700d2140a369d2dfb8e20fae6cf4938e2f154b7d13
Successfully built Mopidy-Tidal
Installing collected packages: Mopidy-Tidal
Successfully installed Mopidy-Tidal-0.3.2

then I add the tidal configuration in the config file

[tidal]
enabled = true
quality = LOSSLESS
client_id =
client_secret =
playlist_cache_refresh_secs = 0
lazy = false

restart mopidy, run journalctl -u mopidy | tail -10 copy the link, tidal device success connected run Iris in the Browser nothing changed run journalctl -u mopidy | tail -10 again:

pi@rekorder:~ $ journalctl -u mopidy | tail -10
Apr 24 20:13:43 rekorder mopidy[10905]:     self.picture_id = json_obj['picture']
Apr 24 20:13:43 rekorder mopidy[10905]: KeyError: 'picture'
Apr 24 20:13:43 rekorder mopidy[10905]: ERROR    [MainThread] mopidy.commands Actor died: TidalBackend (urn:uuid:770250ec-022d-49b0-a2db-34d14402902c) stopped before handling the message
Apr 24 20:13:43 rekorder mopidy[10905]: INFO     [MainThread] mopidy.commands Starting Mopidy core
Apr 24 20:13:43 rekorder mopidy[10905]: INFO     [MainThread] mopidy.commands Starting Mopidy frontends: IrisFrontend, HttpFrontend
Apr 24 20:13:43 rekorder mopidy[10905]: INFO     [IrisFrontend-8] mopidy_iris.core Starting Iris 3.66.1
Apr 24 20:13:43 rekorder mopidy[10905]: INFO     [HttpFrontend-10] mopidy.http.actor HTTP server running at [::ffff:0.0.0.0]:6680
Apr 24 20:13:43 rekorder mopidy[10905]: INFO     [MainThread] mopidy.commands Starting GLib mainloop
Apr 24 20:13:50 rekorder mopidy[10905]: WARNING  [FileBackend-4] mopidy.file.library Failed looking up file:///var/lib/mopidy/tidal: gst-resource-error-quark: "/var/lib/mopidy/tidal" is a directory. (5)
Apr 24 20:13:50 rekorder mopidy[10905]: WARNING  [FileBackend-4] mopidy.file.library Failed looking up file:///var/lib/mopidy/tidal: gst-resource-error-quark: "/var/lib/mopidy/tidal" is a directory. (5)

Ok I´m a beginner in that thing, but maybe with your help I can fix the issue... THANKS!

derok11 commented 1 year ago

Ok solved the issue by myself. Had to install git+https://github.com/BlackLight/mopidy-tidal additionally and now Tidal is running!

tehkillerbee commented 1 year ago

@derok11 Great to hear! It looks like the issue stems from the old version of tidalapi not being removed, when you only removed mopidy-tidal

So as a future reference;

sudo pip3 uninstall mopidy-tidal
sudo pip3 uninstall tidalapi
sudo pip3 install git+https://github.com/tehkillerbee/mopidy-tidal
derok11 commented 1 year ago

@tehkillerbee Thanks for the Tip!