Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not import user playlists #46

Closed
formeo14 opened this issue Nov 30, 2024 · 11 comments
Closed

Can not import user playlists #46

formeo14 opened this issue Nov 30, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@formeo14
Copy link

Description
When the scheduled task for importing Spotify playlists runs, it encounters a NullReferenceException and fails. This issue started occurring recently, and it was working without any problems before. The authorization for the Spotify API is correctly configured and enabled. My username is also right.

Configuration:
User Setup: A specific user is configured to import all their Spotify playlists.

Steps to Reproduce:

  1. Trigger the scheduled task to import Spotify playlists.
  2. The task fails with a NullReferenceException.

Logs

Log Entries
  • [2024-11-30 11:06:08.250 +00:00] [INF] [24] Viperinius.Plugin.SpotifyImport.Spotify.SpotifyLogger: "POST" https://accounts.spotify.com/api/token [""] "System.Net.Http.FormUrlEncodedContent"
  • [2024-11-30 11:06:08.299 +00:00] [WRN] [24] Jellyfin.Networking.Manager.NetworkManager: "xxx.xxx.xxx.xxx": Only loopback "127.0.0.1" returned, using that as bind address.
  • [2024-11-30 11:06:08.789 +00:00] [INF] [30] Viperinius.Plugin.SpotifyImport.Spotify.SpotifyLogger: --> OK "application/json" "{"access_token":"xxxx","token_type":"Bearer","expi"
  • [2024-11-30 11:06:08.805 +00:00] [INF] [30] Viperinius.Plugin.SpotifyImport.Spotify.SpotifyLogger: "GET" users/3nvv3ll7vy034sai0x72xxxxx/playlists [""] null
  • [2024-11-30 11:06:09.222 +00:00] [INF] [30] Viperinius.Plugin.SpotifyImport.Spotify.SpotifyLogger: --> OK "application/json" "{"href":"https://api.spotify.com/v1/users/3nvv3ll7"
  • [2024-11-30 11:06:09.223 +00:00] [ERR] [30] Emby.Server.Implementations.ScheduledTasks.TaskManager: Error executing Scheduled Task
    System.NullReferenceException: Object reference not set to an instance of an object.
    at Viperinius.Plugin.SpotifyImport.Spotify.SpotifyPlaylistProvider.GetUserPlaylistsInfo(TargetUserConfiguration target, Nullable1 cancellationToken) at Viperinius.Plugin.SpotifyImport.Spotify.SpotifyPlaylistProvider.GetUserPlaylistsInfo(TargetUserConfiguration target, Nullable1 cancellationToken)
    at Viperinius.Plugin.SpotifyImport.GenericPlaylistProvider.GetUserPlaylistIds(TargetUserConfiguration target, Nullable1 cancellationToken) at Viperinius.Plugin.SpotifyImport.Tasks.SpotifyImportTask.ExecuteAsync(IProgress1 progress, CancellationToken cancellationToken)
    at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options)
  • [2024-11-30 11:06:09.236 +00:00] [INF] [30] Emby.Server.Implementations.ScheduledTasks.TaskManager: "Import Spotify playlists" Failed after 0 minute(s) and 1 seconds
@formeo14 formeo14 added the bug Something isn't working label Nov 30, 2024
@Viperinius
Copy link
Owner

Viperinius commented Nov 30, 2024

Oh boy, Spotify changed its API again, restricting access to quite a lot of stuff (for reference: https://developer.spotify.com/blog/2024-11-27-changes-to-the-web-api and JohnnyCrazy/SpotifyAPI-NET#1012).
It seems like this also affects playlists in the sense that the API now only returns user-created playlists. "Spotify-owned" playlists like the weekly discovery or playlists for some genres are returning null, which causes the exception you are seeing...

A fix for that exception is included in the new plugin release (1.11.0.0), please try again with that version.

Viperinius added a commit that referenced this issue Nov 30, 2024
…all playlists anymore, see #46

non user created playlists are still present in the response but are null
@formeo14
Copy link
Author

It appears to be working. It needs now a few hours to run, but the initial start was successful, so I'm hopeful.
Thank you for the fast fix!

@formeo14
Copy link
Author

It works, and it was much faster, as you mentioned, because it ignores Spotify's created playlists. This is a bit disappointing, but I can manage since I can copy them to my own playlists.
However, Lidarr can still grab all playlists. I'm not sure what they're doing differently there.
Thanks for your help!

@Viperinius
Copy link
Owner

Interesting, maybe they scrape Spotify without using the API

@formeo14
Copy link
Author

I'm not sure, but I think it's unlikely because Spotify playlists are always different for each user, and I need to authenticate with Spotify, which is the same process as with Jellyfin.
Here's a screenshot in German for my account: Image

@Viperinius
Copy link
Owner

Ah, I'll take a look if I can find out what they do

@Druidblack
Copy link

Druidblack commented Dec 1, 2024

good afternoon. I didn't quite get it. is the plugin currently unable to update playlist data from spotify?

Playlists that were from spotify have not been updated (plugins of the latest version). It is sad.
I hope the author can get around this limitation.

@formeo14
Copy link
Author

formeo14 commented Dec 1, 2024

The Plugin supports all playlists except those from Spotify.

If you want to use a Spotify playlist, you'll need to convert it to your own playlist first.

I need to correct my earlier statement: Lidarr does not work with Spotify playlists either. Adding just one Spotify playlist will cause an error, and pressing another playlist will ignore the Spotify one. So, Lidarr has the same issue. I apologize for providing incorrect information.

@Druidblack
Copy link

It was convenient when the playlists were from spotify and they were updated periodically.

I assume that the converted playlists will be static. And they won't be updated like spotify playlists. They will need to be updated manually.

@Viperinius
Copy link
Owner

Viperinius commented Dec 1, 2024

I assume that the converted playlists will be static. And they won't be updated like spotify playlists. They will need to be updated manually.

Correct.

For the time being this is necessary, let's hope Spotify change their mind on how much they make inaccessible or maybe I can find another way to get the data.

@Viperinius
Copy link
Owner

I need to correct my earlier statement: Lidarr does not work with Spotify playlists either. Adding just one Spotify playlist will cause an error, and pressing another playlist will ignore the Spotify one. So, Lidarr has the same issue. I apologize for providing incorrect information.

Ah, no problem, what a shame though that is doesn't work. There might be apps that are still working because in the Spotify announcement it seemed like some bigger apps could get at least some kind of grace period.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants