Main Site Discussion > Projects

Plex Playlist Importer

(1/10) > >>

Dakusan:
Full content for the Plex Playlist Importer project can be found at https://www.castledragmire.com/Projects/Plex_Playlist_Importer.
Description: Import playlists into PlexInformation: My music directories have been growing for over 2 decades in a folder based hierarchy, often using playlists for organization. Plex’s music organization is counterintuitive to this organizational structure, and Plex currently does not have an easy way to import external playlists. Hence this script was born :-)Languages: Python

Dakusan:
If running in Cygwin with the Windows install of Python 3, the following could be put into a shell script to automatically convert the cygwin path to the windows path. This helps with tab completion when typing a path


--- Code: ---./PlexPlaylistImporter.exe "`cygpath -wp "$1"`" "$2"
--- End code ---

So this could be called like:


--- Quote ---./SCRIPT_NAME /cygdrive/c/playlist.path "Plex Playlist Name"
--- End quote ---

Dakusan:
You just made me realize something very important that [I think] I need to add in to the documentation. The songs you want to play have to already exist in the Plex database.

When you add a song to Plex (through Plex), it stores the song's full file path in the Plex database. What my script does is derive the full paths for files in a playlist file you give it, checks those paths against plex's database, and then adds the matches in the proper order into the Plex playlist you specified.

So for this reason, the script must be ran on the same computer running the Plex server so that it can match the paths.

So to more specifically answer your question, if Plex supports loading files in through smb shares (accessed via "\\" in Windows), then I believe my program should be ok with it too.

I have not specifically tested this, so let me know if you think my program is not handling it correctly and I'll look into it.

Out of curiosity, was that MortScript thing you mentioned previously related to Plex or Python?

clowg:
I am running the script on the Plex Media Server computer (Windows 7).
The media in question is all in the PMS library, but it is present on a different server.

When I run your script I get:

C:\7MC>plexplaylistimporter "top 501 songs.m3u" "Top500Rock" "D:\Media3\AppData\Local\Plex Media Server"
ListImporter 'Winamp playlist': Cannot find file listed in playlist (must be relative to the playlist): ÿþ\ \ D o r i s 4 \ M u s i c \
 R O C K \ D a v i d   B o w i e \ Y o u n g   A m e r i c a n s \ 0 8   -   F a m e . m p 3

Does that command line and subsequent output make sense to you?

clowg:

--- Quote from: Dakusan on November 27, 2014, 04:54:52 am ---Out of curiosity, was that MortScript thing you mentioned previously related to Plex or Python?

--- End quote ---

Sorry about that.  I mixed up two different sources for Plex Playlist import scripts.  mortscript.exe is used by the other one I am trying to get working at the same time as yours.  But that is failing as well becuase mortscript.exe wont run on my Windows 7 32-bit computer.

Navigation

[0] Message Index

[#] Next page

Reply

Go to full version