Trying to make a python script that can add songs to a Plex playlist from a CSV

Hi, I use Plex Playlist Sync to add my Spotify playlists on Plex. this is after I have all the songs downloaded. It works pretty well but misses a few songs. Now I’m trying to make a script that will look through the CSV files that PSS generates of the missing songs and search in my mp3 library for them, then add them to the appropriate playlist. Here is my github repo for the project.

I’m using it in docker and I have the dockerfile, config, reqs, and run command with the mounted drives set up. The script works for the most part and can search/match the songs, but I havent been able to get it to add the song to the plex playlist.

The code I linked earlier has this file in it that I’m trying to take from but I can’t figure it out. Any suggestions? This is my first time coding or making anything like this so let me know where i messed up. Thanks!