Skip to content

I use Plex solely for music, and I wanted a way to add in playlists generated by ChatGPT. This script does that.

Notifications You must be signed in to change notification settings

armandhammer/plex-playlist-chatgpt

Repository files navigation

plex-playlist-chatgpt

UPDATE: As of October 2024, Plex no longer includes Tidal integration. If Plex moves to a new streaming provider like Qobuz, I'll try to rewrite the script to support it. But as of November 4, 2024 Plex has not announced a streaming replacement for Tidal.

I use Plex solely for music, and I wanted a way to add playlists generated by ChatGPT (because Plex's new "Sonic Sage" is... not so great). This script does that. And BTW, 95% of this script was generated by ChatGPT itself, all I really had to do was figure out what Plex URLs to use to put the list of tracks into a playlist. That's underselling it a little bit, because it took a few hours of sleuthing and nudging ChatGPT in the right direction by feeding it XML responses from the server and training it how to extract the proper track IDs and such. But in the end, the script is legit.

It also prompts which Plex user account you want to put the script into, because using the Plex "share playlist" feature is buggy. With this script there's no need to share the playlist, just put it in whatever user account you want. By doing it this way, the playlist is owned by the specified user, they can edit it, and it shows up in Plexamp (for some weird reason, Plexamp has no ability to show shared playlists).

If you don't want the ability to select a user, see the file alternate-main-func-for-noprompt.py to substitute a main() function that removes the prompt and defaults to adding the playlist to the admin account.

Here's how I use it:

  1. Go to https://chat.openai.com and ask ChatGPT to generate a list of songs, e.g. Make a playlist of 5 songs from the early 2000s which are influenced by 80s synthpop. Output as ARTIST - TRACK. Don't include any "" quote marks
  2. Copy and paste this list into a text file called playlist.txt
  3. Run the script in the same directory as the .txt file

All you have to do is edit the top of the script to reflect the correct variables for your Plex server, and make sure all relevant Python dependencies are installed. Enjoy!

About

I use Plex solely for music, and I wanted a way to add in playlists generated by ChatGPT. This script does that.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages