Open arsaboo opened 2 years ago
Hmm, I'm not too sure, it might be that Plex changed the API slightly and my code is mis-reading it now. As mentioned in #30 could you please download the latest https://github.com/XDGFX/ultrasonics/tree/1.2.0 branch, try syncing with the new 'plex beta' plugin instead, and let me know how you get on?
This uses a proper plex-python api so it should be more reliable!
@XDGFX With 1.2.0, there is some progress, but when I try to sync Spotify to Plex, I get the following error (and nothing is synced)
2021-10-24 12:17:05,560 - 🎧 plex beta - INFO - Processing playlist: LastFM Songs (up_plex beta.py:165)
Adding songs: 0%| | 0/22 [00:01<?, ?it/s]
Processing playlists: 0%| | 0/6 [00:01<?, ?it/s]
2021-10-24 12:17:06,591 - plugins - ERROR - could not convert string to float: '' (plugins.py:291)
Traceback (most recent call last):
File "/home/arsaboo/ultrasonics/ultrasonics/plugins.py", line 285, in applet_run
plugin_run(*get_info(plugin), component="outputs",
File "/home/arsaboo/ultrasonics/ultrasonics/plugins.py", line 162, in plugin_run
response = found_plugins[name].run(
File "/home/arsaboo/ultrasonics/ultrasonics/official_plugins/up_plex beta.py", line 207, in run
if max(scores) >= float(settings_dict["fuzzy_ratio"]):
ValueError: could not convert string to float: ''
When I try to sycn Plex to Spotify, I get the following error (again, nothing is synced)
021-10-24 12:17:40,468 - 🎧 plex beta - DEBUG - Processing track: Wakhra Swag (feat. Badshah) (up_plex beta.py:128)██████████████████████████████████████████████████▎ | 94/99 [00:08<00:01, 4.90it/s]
2021-10-24 12:17:40,669 - 🎧 plex beta - DEBUG - Processing track: Small Town Girl (up_plex beta.py:128)███████████████████████████████████████████████████████████████▊ | 95/99 [00:08<00:00, 4.92it/s]
2021-10-24 12:17:40,697 - 🎧 plex beta - DEBUG - Processing track: Sharabi (up_plex beta.py:128)
2021-10-24 12:17:40,722 - 🎧 plex beta - DEBUG - Processing track: Kukkad (up_plex beta.py:128)
2021-10-24 12:17:40,748 - 🎧 plex beta - DEBUG - Processing track: Kangna (up_plex beta.py:128)
Getting songs: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 99/99 [00:08<00:00, 11.57it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:08<00:00, 8.64s/it]
2021-10-24 12:17:40,770 - plugins - DEBUG - Running plugin spotify v0.5 (plugins.py:158)
2021-10-24 12:17:40,771 - 🎧 spotify - INFO - Credentials will be cached in: /home/arsaboo/ultrasonics/config/up_spotify/up_spotify.bz2 (up_spotify.py:93)
2021-10-24 12:17:40,771 - 🎧 spotify - DEBUG - Fetching your Spotify token (up_spotify.py:110)
2021-10-24 12:17:41,065 - 🎧 spotify - DEBUG - Token is valid. (up_spotify.py:136)
2021-10-24 12:17:41,065 - 🎧 spotify - DEBUG - Returning cached token (up_spotify.py:118)
2021-10-24 12:17:41,289 - 🎧 spotify - INFO - Found 6 playlist(s) on Spotify. (up_spotify.py:331)
2021-10-24 12:17:41,289 - plugins - ERROR - 'name' (plugins.py:291)
Traceback (most recent call last):
File "/home/arsaboo/ultrasonics/ultrasonics/official_plugins/up_spotify.py", line 645, in run
if playlist["id"]["spotify"] in [
KeyError: 'spotify'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/arsaboo/ultrasonics/ultrasonics/plugins.py", line 285, in applet_run
plugin_run(*get_info(plugin), component="outputs",
File "/home/arsaboo/ultrasonics/ultrasonics/plugins.py", line 162, in plugin_run
response = found_plugins[name].run(
File "/home/arsaboo/ultrasonics/ultrasonics/official_plugins/up_spotify.py", line 650, in run
if playlist["name"] in [item["name"] for item in current_playlists]:
KeyError: 'name'
Hopefully these logs give you some idea about what is going on and we can fix them. Let me know if you need anything else.
Ok..so I added the fuzzy ratio and now I can sync from Spotify to Plex.
Plex to Spotify is still not working and shows the same error above. It may be because I have not set things properly. Here's how my applet looks:
Ah, I had incorrectly named a dict entry in the new beta plugin, try with the latest commit on the 1.2.0 branch (or the latest 1.2.0 Docker tag)
So, looks like the process is working. However, the matching is terrible. I have a playlist of over 10K tracks and only 1200 were matched :(
This is not your fault, but how Spotify organizes tracks. Sometimes the tracks are organized in albums
, sometimes they will organize it as tracktitle (from albumtitle)
and so on. I like how beets handles this situation by giving an option to manually intervene. Wondering if it would be a better idea to give an option for manual matching like beets does.
Here's some code snippet that uses beets library for basic import and here's some discussion implementing the same in Beets forum.
I am trying to sync my Plex playlists to Spotify. I have connected both the services. But, when I run the applet, I see that no playlists are found. When I visit the URL (and manually add the token), I can see all the playlists.
Any thoughts on what may be going on? Not sure if it matters, but I am using the docker container.