cmathews393 / spotify-to-plex

A python script/app to sync Spotify Playlists into Plex (optionally via Lidarr)
GNU General Public License v3.0
42 stars 3 forks source link

Grabbing Playlists not in Spotify Library #33

Closed AverageDave93 closed 1 month ago

AverageDave93 commented 3 months ago

The following is not the only scenario, but basically, playlists are getting made/grabbed by themselves.

"Grime Mix" was added in Spotify and then selected in the Spotify Lidarr import list, and then "Grime Mix" was added in plex as expected but also "Mix Grime" was made. Same Playlist art and tracks.

spotiplex.2024-07-15_01-00-05_381693.log

In Spotify; image

In Plex; image

image

image

Another situation is it is grabbing playlist such as "🌿 GECKO" which is a playlist I had and deleted a long time before using spotiplex.

I have confirmed these playlists are not in my Spotify library or my lidarr spotify import list.

image

cmathews393 commented 3 months ago

Sorry, I looked into this, I didn't see anything that immediately popped out, I'll need to investigate further

AverageDave93 commented 3 months ago

Ok thank you, let me know if you need anything.

cmathews393 commented 3 months ago

Can you confirm your manual import lists in the config/env is empty?

AverageDave93 commented 3 months ago

Correct, I don't even have that as an environment.

AverageDave93 commented 2 months ago

It now made another version 😂 image image

cmathews393 commented 2 months ago

Hey sorry I've been super busy. That's very weird. So just to confirm, that playlist is a playlist you're trying to sync, but its syncing multiple/duplicate/weird versions of it as well, but not consistently? Do you have the playlist URL handy?

AverageDave93 commented 2 months ago

Yeah that's correct, it is also syncing playlists not on my Spotify aswell. My server is rebooting atm, I'll garb the url in a bit for you.

AverageDave93 commented 2 months ago

https://open.spotify.com/playlist/37i9dQZF1EQp44yrWTfG1K

AverageDave93 commented 2 months ago

so this example is interesting, i have a playlist in spotify called "HARD Summer Guest List" with the playlist id of "37i9dQZF1DX3FNkD0kDpDV" and url is "https://open.spotify.com/playlist/37i9dQZF1DX3FNkD0kDpDV"

In spotify it looks like this; image

a playlist with a differnt name was created in plex called "Tomorrowland Guest List" and a different image but with the same playlist id image

Then after a while another playlist was created with the correct name and image but no id in the description image

AverageDave93 commented 2 months ago

Just seen it has added another playlist not in my spotify library. Screenshot_20240808_001024_Chrome

AverageDave93 commented 2 months ago

Oh I think I've found a connection to this one. So it seems it is a spotify made for you playlist. This is not in my library. Screenshot_20240808_001411_Spotify

AverageDave93 commented 2 months ago

I just used the following script to retrieve my playlists from spotify;

import spotipy
from spotipy.oauth2 import SpotifyOAuth

SPOTIPY_CLIENT_ID = 'your_client_id'
SPOTIPY_CLIENT_SECRET = 'your_client_secret'
SPOTIPY_REDIRECT_URI = 'your_redirect_uri'

scope = "playlist-read-private"
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id=SPOTIPY_CLIENT_ID,
                                               client_secret=SPOTIPY_CLIENT_SECRET,
                                               redirect_uri=SPOTIPY_REDIRECT_URI,
                                               scope=scope))

# Fetch all playlists
playlists = []
limit = 50
offset = 0

while True:
    current_playlists = sp.current_user_playlists(limit=limit, offset=offset)
    playlists.extend(current_playlists['items'])
    if len(current_playlists['items']) < limit:
        break
    offset += limit

# Print out each playlist's name
for playlist in playlists:
    print(f"Playlist: {playlist['name']} (ID: {playlist['id']})")

This gave me the following output; Playlist: French Hip Hop Mix (ID: 37i9dQZF1EId4tyVYo0Omv) Playlist: Sing Along (ID: 37i9dQZF1DWWu0xeeDiEZc) Playlist: This Is Super Simple Songs (ID: 37i9dQZF1DZ06evO4vF667) Playlist: Grime Shutdown (ID: 37i9dQZF1DWSOkubnsDCSS) Playlist: Grime Classics (ID: 37i9dQZF1DX7bxurrN0PHJ) Playlist: Grime Mix (ID: 37i9dQZF1EQp44yrWTfG1K) Playlist: dazed (ID: 37i9dQZF1DX2qBJch9g3qw) Playlist: Gentle (ID: 37i9dQZF1DWWxd0qWj50iH) Playlist: 4AM Chillout (ID: 37i9dQZF1DXdbizRAR17Ui) Playlist: Nightcap (ID: 37i9dQZF1DX5ZYqTmgPJ9Z) Playlist: FIFA Bangers - Best Of All Time (ID: 4y85MI3qRoui5GPSHWl8Op) Playlist: Video Game Soundtracks (ID: 37i9dQZF1DXdfOcg1fm0VG) Playlist: Anime Now (ID: 37i9dQZF1DWT8aqnwgRt92) Playlist: Just Dropped (ID: 37i9dQZF1DX173KZtX43vV) Playlist: All New Country (ID: 37i9dQZF1DWVn8zvR5ROMB) Playlist: Songs to Sing in the Car (ID: 37i9dQZF1DWWMOmoXKqHTD) Playlist: This Is Bluey (ID: 37i9dQZF1DZ06evO3EG7kZ) Playlist: Kids Party Songs 2024 🎉 (ID: 1P27ra5VqAizmkcUzVAvp2) Playlist: Lofi Girl - beats to relax/study to (ID: 0vvXsWCC9xrXsKd4FyS8kM) Playlist: Songs To Test Headphones With (ID: 37i9dQZF1DWZtZ8vUCzche) Playlist: Gentle Classical (ID: 37i9dQZF1DX7cBprxbt1Fn) Playlist: Opera Classics (ID: 37i9dQZF1DWVfS4Cdd3PNf) Playlist: Atmospheric Sci-fi Soundtracks (ID: 37i9dQZF1DXbIeCFU20wRm) Playlist: Classical Halloween (ID: 37i9dQZF1DXafCT9DHTijq) Playlist: Classical New Releases (ID: 37i9dQZF1DWV0gynK7G6pD) Playlist: Haitian Heat (ID: 37i9dQZF1DX3XjJqhm9fqD) Playlist: Ushuaïa Ibiza Guest List (ID: 37i9dQZF1DX3FNkD0kDpDV) Playlist: Dubstep Don (ID: 37i9dQZF1DX5Q27plkaOQ3) Playlist: Heart Beats (ID: 37i9dQZF1DWSRc3WJklgBs) Playlist: UK House Music (ID: 37i9dQZF1DWSrVdvTl1tVY) Playlist: Trap Mojito (ID: 37i9dQZF1DX1OIMC8iDi74) Playlist: Trance Mission (ID: 37i9dQZF1DX91oIci4su1D) Playlist: Shuffle Syndrome (ID: 37i9dQZF1DWUq3wF0JVtEy) Playlist: Nasty Bits (ID: 37i9dQZF1DX2VvACCrgjrt) Playlist: Orgánica (ID: 37i9dQZF1DX2pprEpa9URZ) Playlist: Night Rider (ID: 37i9dQZF1DX6GJXiuZRisr) Playlist: Tech House Operator (ID: 37i9dQZF1DWVY4eLfA3XFQ) Playlist: metropolis (ID: 37i9dQZF1DX8CopunbDxgW) Playlist: Hype (ID: 37i9dQZF1DX4eRPd9frC1m) Playlist: Happy Beats (ID: 37i9dQZF1DWSf2RDTDayIx) Playlist: Hardstyle Bangers (ID: 37i9dQZF1DX0pH2SQMRXnC) Playlist: Rocktronic (ID: 37i9dQZF1DWTfrr8pte1rT) Playlist: Power Hour (ID: 37i9dQZF1DX32NsLKyzScr) Playlist: Deep House Relax (ID: 37i9dQZF1DX2TRYkJECvfC) Playlist: Dance Party (ID: 37i9dQZF1DXaXB8fQg7xif) Playlist: creamy (ID: 37i9dQZF1DXdgz8ZB7c2CP) Playlist: Chill Tracks (ID: 37i9dQZF1DX6VdMW310YC7) Playlist: Lowkey Tech (ID: 37i9dQZF1DX0r3x8OtiwEM) Playlist: Brain Food (ID: 37i9dQZF1DWXLeA8Omikj7) Playlist: Bass Arcade (ID: 37i9dQZF1DX0hvSv9Rf41p) Playlist: All New Dance (ID: 37i9dQZF1DXa41CMuUARjl) Playlist: Housewerk (ID: 37i9dQZF1DXa8NOEUWPn9W) Playlist: Dance Hits (ID: 37i9dQZF1DX0BcQWzuB7ZO) Playlist: Pop Remix (ID: 37i9dQZF1DXcZDD7cfEKhW) Playlist: Dance Rising (ID: 37i9dQZF1DX8tZsk68tuDw) Playlist: Queen (ID: 37i9dQZF1DWSIO2QWRavWZ) Playlist: I Love My '00s R&B (ID: 37i9dQZF1DWYmmr74INQlb) Playlist: ’80s Jam Session (ID: 37i9dQZF1DX0H8hDpv38Ju) Playlist: I Love My '90s R&B (ID: 37i9dQZF1DX6VDO8a6cQME) Playlist: Funk Outta Here (ID: 37i9dQZF1DX70TzPK5buVf) Playlist: Wine & Dine (ID: 37i9dQZF1DWTJNOeepZTGy) Playlist: Love Deluxe (ID: 37i9dQZF1DWVEvzGeX3eRs) Playlist: Soul Lounge (ID: 37i9dQZF1DX62Nfha2yFhL) Playlist: Chilled R&B (ID: 37i9dQZF1DX2UgsUIg75Vg) Playlist: Vanguard (ID: 37i9dQZF1DWSfMe9z89s9B) Playlist: Gold Edition (ID: 37i9dQZF1DWXnexX7CktaI) Playlist: Channel-X (ID: 37i9dQZF1DX4y8h9WqDPAE) Playlist: R&B Weekly (ID: 37i9dQZF1DWUzFXarNiofw) Playlist: Country Rocks (ID: 37i9dQZF1DWWH0izG4erma) Playlist: Classic Honky Tonk (ID: 0NfjMqrzcGKVsbYZmhf4Md) Playlist: Southern Rock (ID: 37i9dQZF1DXbDjX0hus3Iu) Playlist: New Traditions Country Heroes (ID: 37i9dQZF1DX24Kh15JFQJ0) Playlist: 90s Country (ID: 37i9dQZF1DWVpjAJGB70vU) Playlist: Country by the Grace of God (ID: 37i9dQZF1DWU2LcZVHsTdv) Playlist: Chillin' on a Dirt Road (ID: 37i9dQZF1DWTkxQvqMy4WW) Playlist: Country Nights (ID: 37i9dQZF1DWXi7h4mmmkzD) Playlist: Country Kind of Love (ID: 37i9dQZF1DX8WMG8VPSOJC) Playlist: Breakout Country (ID: 37i9dQZF1DWW7RgkOJG32Y) Playlist: Country Coffeehouse (ID: 37i9dQZF1DWYiR2Uqcon0X) Playlist: Texas Country Now (ID: 37i9dQZF1DX3Ee0ngF5ZVQ) Playlist: Country Gold (ID: 37i9dQZF1DWYnwbYQ5HnZU) Playlist: Wild Country (ID: 37i9dQZF1DX5mB2C8gBeUM) Playlist: New Boots (ID: 37i9dQZF1DX8S0uQvJ4gaa) Playlist: Ultimate Rock Gaming (ID: 37i9dQZF1DWZjmJmeiazwd) Playlist: Classic Hardcore (ID: 37i9dQZF1DXaGNG7NmtmZv) Playlist: Emo Forever (ID: 37i9dQZF1DX9wa6XirBPv8) Playlist: Rock Me Up (ID: 37i9dQZF1DX0wiundViT27) Playlist: Shoegaze Classics (ID: 37i9dQZF1DX6ujZpAN0v9r) Playlist: Rock Covers (ID: 37i9dQZF1DX2S9rTKTX6JP) Playlist: Alternative Beats (ID: 37i9dQZF1DWXMg4uP5o3dm) Playlist: Nu Metal Era (ID: 37i9dQZF1DXcfZ6moR6J0G) Playlist: Rock Ballads (ID: 37i9dQZF1DWXs1L3AC0Xio) Playlist: Rockin' Vibes (ID: 37i9dQZF1DX2aneNMeYHQ8) Playlist: License To Chill (ID: 37i9dQZF1DXa9xHlDa5fc6) Playlist: Soak Up The Sun (ID: 37i9dQZF1DX6ALfRKlHn1t) Playlist: 90s Rock Anthems (ID: 37i9dQZF1DX1rVvRgjX59F) Playlist: VOLUME (ID: 37i9dQZF1DWWJOmJ7nRx0C) Playlist: The Scene (ID: 37i9dQZF1DWZkHEX2YHpDV) Playlist: it's alt good (ID: 37i9dQZF1DX2SK4ytI2KAZ) Playlist: You & Me (ID: 37i9dQZF1DX6mvEU1S6INL) Playlist: Rock Party (ID: 37i9dQZF1DX8FwnYE6PRvL) Playlist: Rock Solid (ID: 37i9dQZF1DX49jUV2NfGku) Playlist: The New Alt (ID: 37i9dQZF1DX82GYcclJ3Ug) Playlist: New Noise (ID: 37i9dQZF1DWT2jS7NwYPVI) Playlist: Big Mood (ID: 37i9dQZF1DWT6SJaitNDax) Playlist: Workout Twerkout (ID: 37i9dQZF1DX0HRj9P7NxeE) Playlist: Alternative Hip-Hop (ID: 37i9dQZF1DWTggY0yqBxES) Playlist: State of Mind (ID: 37i9dQZF1DX1YPTAhwehsC) Playlist: No Cap (ID: 37i9dQZF1DX0Tkc6ltcBfU) Playlist: Power Workout (ID: 37i9dQZF1DWUVpAXiEPK8P) Playlist: Westside Story (ID: 37i9dQZF1DWSvKsRPPnv5o) Playlist: Dancehall Official (ID: 37i9dQZF1DXan38dNVDdl4) Playlist: African Heat (ID: 37i9dQZF1DWYkaDif7Ztbp) Playlist: B.A.E. (ID: 37i9dQZF1DWX3387IZmjNa) Playlist: Get Turnt (ID: 37i9dQZF1DWY4xHQp97fN6) Playlist: Gold School (ID: 37i9dQZF1DWVA1Gq4XHa6U) Playlist: Most Necessary (ID: 37i9dQZF1DX2RxBh64BHjQ) Playlist: Signed XOXO (ID: 37i9dQZF1DX2A29LI7xHn1) Playlist: Soft Pop Hits (ID: 37i9dQZF1DWTwnEm1IYyoj) Playlist: All Out 50s (ID: 37i9dQZF1DWSV3Tk4GO2fq) Playlist: All Out 60s (ID: 37i9dQZF1DXaKIA8E7WcJj) Playlist: All Out 70s (ID: 37i9dQZF1DWTJ7xPn4vNaz) Playlist: All Out 80s (ID: 37i9dQZF1DX4UtSsGT1Sbe) Playlist: All Out 90s (ID: 37i9dQZF1DXbTxeAdrVG2l) Playlist: All Out 2000s (ID: 37i9dQZF1DX4o1oenSJRJd) Playlist: just hits (ID: 37i9dQZF1DXcRXFNfZr7Tp) Playlist: MARROW (ID: 37i9dQZF1DXcF6B6QPhFDv) Playlist: mint (ID: 37i9dQZF1DX4dyzvuaRJ0n) Playlist: Rock Classics (ID: 37i9dQZF1DWXRqgorJj26U) Playlist: RNB X (ID: 37i9dQZF1DX4SBhb3fqCJd) Playlist: Peaceful Piano (ID: 37i9dQZF1DX4sWSpwq3LiO) Playlist: New Music Friday (ID: 37i9dQZF1DX4JAvHpjipBk) Playlist: Viva Latino (ID: 37i9dQZF1DX10zKzsJ2jva) Playlist: Hot Country (ID: 37i9dQZF1DX1lVhptIYRda) Playlist: RapCaviar (ID: 37i9dQZF1DX0XUsuxWHRQd) Playlist: Today’s Top Hits (ID: 37i9dQZF1DXcBWIGoYBM5M)

Im not sure why the others are being created. Do your scripts grab playlists differently from this?

AverageDave93 commented 2 months ago

I've retrieved the playlist information separately from both the Lidarr API and the Spotify API, and discovered that Lidarr has additional playlists that do not appear in the Spotify import list within the Lidarr GUI. See attached Playlist Issue.xlsx

AverageDave93 commented 2 months ago

It looks like the issue has been resolved. The problem was related to Lidarr's Spotify import list cache. To address this, I deleted the Spotiplex container, removed the Spotify import list from Lidarr, and restarted the Lidarr container. After that, I re-added the Spotify import list in Lidarr and then re-deployed the Spotiplex container. I’ve also confirmed that the playlists from the Lidarr API now match those from the Spotify API. I'll update/close in a day or two once I have confirmed if any extra playlists are added into plex. :)

cmathews393 commented 2 months ago

Interesting. Sorry again for not being able to look at it on my end, but I'm glad you got it figured out. It makes sense I guess but still, really odd.

cmathews393 commented 2 months ago

Might be worth opening an issue with Lidarr, though it probably doesn't affect day to day use that much.