Synchronize a local directory of songs' (MP3, MP4) metadata (genre, ratings) and playlists with a Plex server.

Related tags

Audio PlexMusicSync
Overview

PlexMusicSync

Synchronize a local directory of songs' (MP3, MP4) metadata (genre, ratings) and playlists (m3u, m3u8) with a Plex server. The song files must already be present in Plex.

I'm a long time Plex user, but until recently I've only used Plex for Movies and TV shows because I found Plex music support to be lacking. I have a large msuic library and need smart playlists based on track rating, track genre, track explicit lyrics, disabling of duplicate tracks (from compilations), etc. None of this metadata was present in Plex or supported by the Plex import. This script fills that gap by syncing that metadata from song files and playlists.

Syncing tags:

  • MP3 or MP4 file genre to.
    • Song artist genre on Plex.
    • Song album genre on Plex.
    • Song mood on Plex (since Plex doesn't have per-song genre).
  • MP3 or MP4 song rating to song rating on Plex.
  • If MP3 or MP4 file comment contains the word explicit, then 'Explicit' is added to the Plex song mood tags.

Syncing Playlists

  • Sync m3u and m3u8 files found locally to music playlists on Plex.
    • If a playlist named 'Unchecked' is found it is considered special and is assumed to be a list of songs that are NOT checked in Apple Music. Songs in this playlist are tgged with a mood value 'Unchecked'.
    • If a playlist named 'Explicit' is found it is considered special and is assumed to be a list of songs that contain explciti lyrics. Songs in this playlist are tgged with a mood value 'Explicit'.

Clearing tags:

  • For each MP3 or MP4 file.
    • Clear all song artist genre tags on Plex.
    • Clear all song album genre tags on Plex.
    • Clear all song mood tags on Plex.

Usage

Install required Python modules with

pip3 install -r requirements.txt

then run the script as follows:

usage: plex_music_sync.py [-h] [-v] [-s SERVER] [-u USERNAME] [-p PASSWORD] [-d DIRECTORY] [-S] [-P] [-c] [-D] [-f]

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         Print the program's version
  -s SERVER, --server SERVER
                        Hostname of the Plex server
  -u USERNAME, --username USERNAME
                        Username of the Plex server
  -p PASSWORD, --password PASSWORD
                        Password of the Plex server
  -d DIRECTORY, --directory DIRECTORY
                        Directory that contains the music files
  -S, --sync            Sync genres, ratings, and playlists to Plex
  -P, --specialplaylists
                        Sync special playlists as playlists. Don't just tag the songs in them.
  -c, --clear           Clear ratings and genre on Plex
  -D, --debug           Log more error messages

Todo:

  • Token based Plex server login.
  • Some way of handling track year.
You might also like...
Library for working with sound files of the format: .ogg, .mp3, .wav

Library for working with sound files of the format: .ogg, .mp3, .wav. By work is meant - playing sound files in a straight line and in the background, obtaining information about the sound file (author, performer, duration, bitrate, and so on). Playing goes through the pygame, and getting information through the mutagen.

Just-Music - Spotify API Driven Music Web app, that allows to listen and control and share songs

Just Music... Just Music Is A Web APP That Allows Users To Play Song Using Spoti

❤️ Hi There Im Cozmo Music Bot A next gen powerful telegram group Music bot for get  your Songs and music @Venuja_Sadew
❤️ Hi There Im Cozmo Music Bot A next gen powerful telegram group Music bot for get your Songs and music @Venuja_Sadew

🎵 Cozmo MUSIC 🎵 Cozmo Music is a Music powerfull bot for playing music on telegram voice chat groups. Requirements FFmpeg NodeJS nodesource.com Pyth

We built this fully functioning Music player in Python. The music player allows you to play/pause and switch to different songs easily.
We built this fully functioning Music player in Python. The music player allows you to play/pause and switch to different songs easily.

We built this fully functioning Music player in Python. The music player allows you to play/pause and switch to different songs easily.

Musillow is a music recommender app that finds songs similar to your favourites.
Musillow is a music recommender app that finds songs similar to your favourites.

MUSILLOW The music recommender app Check it out now!!! View Demo · Report Bug · Request Feature About The App Musillow is a music recommender app that

IDing the songs played on the do you radio show

IDing the songs played on the do you radio show

A Simple Script that will help you to Play / Change Songs with just your Voice
A Simple Script that will help you to Play / Change Songs with just your Voice

Auto-Spotify using Voice Recognition A Simple Script that will help you to Play / Change Songs with just your Voice Explore the docs » Table of Conten

Open-Source bot to play songs in your Telegram's Group Voice Chat. Powered by @Akki_ThePro

VcPlayer Telegram Voice-Chat Bot [PyTGCalls] ⇝ Requirements ⇜ Account requirements A Telegram account to use as the music bot, You cannot use regular

Python module for handling audio metadata

Mutagen is a Python module to handle audio metadata. It supports ASF, FLAC, MP4, Monkey's Audio, MP3, Musepack, Ogg Opus, Ogg FLAC, Ogg Speex, Ogg The

Comments
  • Better handling of slight punctuation differences

    Better handling of slight punctuation differences

    If the Artist name, Album title, and Song title do not match exactly character for character, it seems like it won't find a song in Plex.

    Things like a single quote character versus an apostrophe, or a "short hyphen" versus a "long hyphen". It seems like depending on the Plex music scraper used, different versions of these special characters are used.

    It would be great if there was a way to either be more flexible, or maybe even completely disregard the special characters entirely?

    opened by n0bodyyouknow 1
  • Handling songs with multiple

    Handling songs with multiple "Genre" tags

    It seems like currently this script just handles the first Genre in the sync, and ignores the rest. It would be great if it could sync over all Genre tags.

    opened by n0bodyyouknow 0
Owner
Tom Goetz
Tom Goetz
Automatically move or copy files based on metadata associated with the files. For example, file your photos based on EXIF metadata or use MP3 tags to file your music files.

Automatically move or copy files based on metadata associated with the files. For example, file your photos based on EXIF metadata or use MP3 tags to file your music files.

Rhet Turnbull 14 Nov 2, 2022
Read music meta data and length of MP3, OGG, OPUS, MP4, M4A, FLAC, WMA and Wave files with python 2 or 3

tinytag tinytag is a library for reading music meta data of MP3, OGG, OPUS, MP4, M4A, FLAC, WMA and Wave files with python Install pip install tinytag

Tom Wallroth 577 Dec 26, 2022
Read music meta data and length of MP3, OGG, OPUS, MP4, M4A, FLAC, WMA and Wave files with python 2 or 3

tinytag tinytag is a library for reading music meta data of MP3, OGG, OPUS, MP4, M4A, FLAC, WMA and Wave files with python Install pip install tinytag

Tom Wallroth 435 Feb 17, 2021
A python program to cut longer MP3 files (i.e. recordings of several songs) into the individual tracks.

I'm writing a python script to cut longer MP3 files (i.e. recordings of several songs) into the individual tracks called ReCut. So far there are two

Dönerspiess 1 Oct 27, 2021
Anki vector Music ❤ is the best and only Telegram VC player with playlists, Multi Playback, Channel play and more

Anki Vector Music ?? A bot that can play music on Telegram Group and Channel Voice Chats Available on telegram as @Anki Vector Music Features ?? Thumb

Damantha Jasinghe 12 Nov 12, 2022
nicfit 425 Jan 1, 2023
An app made in Python using the PyTube and Tkinter libraries to download videos and MP3 audio.

yt-dl (GUI Edition) An app made in Python using the PyTube and Tkinter libraries to download videos and MP3 audio. How do I download this? Windows: Fi

null 1 Oct 23, 2021
Improved Python UI to convert Youtube URL to .mp3 file.

YT-MP3 Improved Python UI to convert Youtube URL to .mp3 file. How to use? Just run python3 main.py Enter the URL of the video Enter the PATH of where

null 8 Jun 19, 2022
A python script that can play .mp3 URLs upon the ringing or motion detection of a Ring doorbell. The sound plays through Sonos speakers.

Ring x Sonos A python script that plays .mp3 files whenever a doorbell is rung or a doorbell detects motion. Features Music! Authors @braden Running T

braden 0 Nov 12, 2021
python script for getting mp3 files from yaoutube playlist

mp3-from-youtube-playlist python script for getting mp3 files from youtube playlist. Do your non-tech brown relatives ask you for downloading music fr

Shuhan Mirza 7 Oct 19, 2022