Overview¶

Unofficial Python bindings for the Plex API. Our goal is to match all capabilities of the officialPlex Web Client. A few of the many features we currently support are:

Plex Import Photos Library 2019

As a Plex user, you can easily store all of your movies, videos, TV shows, songs and photos on a central server and play them anywhere you want. And playing a MP4 video in Plex is really simple in usual. Whereas, some errors still pop up when stream MP4 files via Plex: - Can't recognize MP4 files for Plex 'I have just set up a Plex Server. The Plex search function will scan both your own library and all the libraries shared with you. If we search for the term “war”, for example, you can see that the first search result is located on our server but the next three results are located on our friend’s server. I don't have plex pass at the moment, but I have my photos syncing from my phone to box, and then box syncs to my server, which the photo library watches the folder. My library has over 100,000 photos in it, and is about 450gb of files. A fair bit of SLR stuff, though I shoot JPG + raw, so plex can just display the jpgs. Raw is for editing.

  • Navigate local or remote shared libraries.

  • Perform library actions such as scan, analyze, empty trash.

  • Remote control and play media on connected clients, including Controlling Sonos speakers

  • Listen in on all Plex Server notifications.

Installation & Documentation¶

Documentation can be found at Read the Docs.

Join our Discord for support and discussion.

Getting a PlexServer Instance¶

There are two types of authentication. If you are running on a separate networkor using Plex Users you can log into MyPlex to get a PlexServer instance. Anexample of this is below. NOTE: Servername below is the name of the server (notthe hostname and port). If logged into Plex Web you can see the server name inthe top left above your available libraries.

If you want to avoid logging into MyPlex and you already know your auth tokenstring, you can use the PlexServer object directly as above, by passing inthe baseurl and auth token directly.

Usage Examples¶

Controlling Sonos speakers¶

To control Sonos speakers directly using Plex APIs, the following requirements must be met:

  1. Active Plex Pass subscription

  2. Sonos account linked to Plex account

  3. Plex remote access enabled

Due to the design of Sonos music services, the API calls to control Sonos speakers route through https://sonos.plex.tvand back via the Plex server’s remote access. Actual media playback is local unless networking restrictions prevent theSonos speakers from connecting to the Plex server directly.

Running tests over PlexAPI¶

Plex Import Photos Library

Use:

with appropriatearguments and add this new server to a shared user which username is defined in environment veriable SHARED_USERNAME.It uses official docker image to create a proper instance.

For skipping the docker and reuse a existing server use

Also in order to run most of the tests you have to provide some environment variables:

Plex import photos library mac
  • PLEXAPI_AUTH_SERVER_BASEURL containing an URL to your Plex instance, e.g. http://127.0.0.1:32400 (without trailingslash)

  • PLEXAPI_AUTH_MYPLEX_USERNAME and PLEXAPI_AUTH_MYPLEX_PASSWORD with your MyPlex username and password accordingly

After this step you can run tests with following command:

Some of the tests in main test-suite require a shared user in your account (e.g. test_myplex_users,test_myplex_updateFriend, etc.), you need to provide a valid shared user’s username to get them running you need toprovide the username of the shared user as an environment variable SHARED_USERNAME. You can enable a Guest account andsimply pass Guest as SHARED_USERNAME (or just create a user like plexapitest and play with it).

To be able to run tests over Mobile Sync api you have to some some more environment variables, to following valuesexactly:

  • PLEXAPI_HEADER_PROVIDES=’controller,sync-target’

  • PLEXAPI_HEADER_PLATFORM=iOS

  • PLEXAPI_HEADER_PLATFORM_VERSION=11.4.1

  • PLEXAPI_HEADER_DEVICE=iPhone

And finally run the sync-related tests:

Common Questions¶

Why are you using camelCase and not following PEP8 guidelines?

This API reads XML documents provided by MyPlex and the Plex Server.We decided to conform to their style so that the API variable names directlymatch with the provided XML documents.

Why don’t you offer feature XYZ?

This library is meant to be a wrapper around the XML pages the Plexserver provides. If we are not providing an API that is offerered in theXML pages, please let us know! – Adding additional features beyond thatshould be done outside the scope of this library.

Plex Import Photos Library Download

What are some helpful links if trying to understand the raw Plex API?

June 1, 2021, is the day that the free unlimited compressed photo backup & cloud storage on Google Photos ends. From now on, you’ll have to pay for cloud storage for your photos. So you’re probably searching for alternatives to Google Photos, but none of the others recommended in all of these articles are really comparable to what Google Photos used to be, and none of them are free for unlimited storage either.

Personally, I never used Google Photos as my only backup, it was always just a 3rd level backup since the free version doesn’t save full-quality images. However, it was pretty great for searching my photo library since the image recognition worked pretty nicely. It wasn’t perfect, but it was certainly better than nothing… and it was great to be able to see my full photo gallery from any phone. I still keep all of my full-resolution photos organized by year and day on my server, but having 13 terabytes of photos in the cloud was pretty nice, too. Paying for that much storage on Google Photos would be $100 per month!

I could just use Plex

So why don’t I just use Plex? I already have Plex for streaming videos and music throughout the house as well as remotely, but I never turned on the Photos aspect of the Plex server. It seems like maybe that would be a good way to access my photos remotely from the phone.

Plex has some cool view options for your photo library. You can look at it in a “timeline” mode that just shows everything in sequence, or you can look at in the normal folder structure view, or there’s a “Recommended” view that shows some automatically selected samples from different decades or “on this day” from a past year.

The search capability doesn’t do any image recognition like Google Photos does though, but it does search filenames and folder names. So if I remember to add the proper names to my folders, it’s pretty good.

Plex Photos Library

Plex

Syncing to the Server

Plex Photo Library Setup

Plex Import Photos LibraryImport

The Plex apps have automatic Camera Roll Upload, too! This could be practically perfect… Oh wait, Plex is also removing the automatic Camera Roll backup feature in June of 2021. Still, I already have Plex, so let’s give it a try. In the Plex Forums, there are a couple of auto-sync recommendations. The “FolderSync” app for Android sounds pretty good for automatically copying camera roll photos to the server, but I think I want to have more control over my photo library now, so I’m going to manually copy photos to the server periodically using “Material Files“. This open-source file manager has great support for SMB file shares, so I made a shortcut to my “2021” photos folder where I can easily move all of my photos whenever I want. It also has an FTP server built-in, so I can turn that on and access the phone’s photo storage from a desktop (or any other FTP client) if I want to transfer files the other way. FTP isn’t a secure file transfer protocol though, so I’ll only use that on the local network. Having the manual option means I won’t have unexpected network usage or battery level loss since I will choose when the images sync. I shoot everything in RAW, too, so I certainly don’t want to transfer those huge file sizes automatically. I’ve also got a VPN server on my home network so I can copy files to the server remotely and securely from where ever I want. Making a home VPN server is really easy with a cheap Raspberry Pi computer and PiVPN.io scripts.

Plex Import Photos Library

Meanwhile, on the server, I’ve got a series of rules set up on RoboBasket that will automatically create folders for each day within a year and move the image files to the proper folders so that everything is well organized.

Costs

Plex Server has a free option that will handle all of the personal media streaming. If you want to use the Android or iOS mobile apps instead of a web browser, each of those cost $5 as a one-time cost (unless you have a Plex Pass in which case they’re free). Apps for other systems like Xbox, PlayStation, and a huge list of other devices are often free. Plex also has a premium “Plex Pass” option that costs either $120 one-time forever price, or $5/month, or $40/year. The Plex Pass doesn’t add anything to your photo library features, but it does add some other nice things to your video & television watching capabilities. It adds the option to use a TV tuner to record shows from cable or HD over-the-air broadcasts, and it adds the option to download content to client devices for offline viewing. It also enables 4K playback and a discount for a Tidal subscription if you want unlimited music streaming. UPDATE: Another big cost difference is the fact that you need a server computer at home with a good amount of storage, Plex server installed, and an always-on internet connection.

Conclusion

The ending of Google’s free photo cloud storage service is certainly sad, but this is just another reminder that becoming too dependent on cloud services that you can’t control is probably a bad idea… and having diverse alternatives is a good idea. Sure, Plex may not last forever either, but it gives me a little more control over my media library streaming capabilities as well as my photo library backups. Still, it is certainly less feature-rich and syncing/management is more complicated, but perhaps that’s the price of freedom.