Skip to main content

plexiglas

This piece of software was inspired by me buying the WD My Passport Wireless Pro, quite nice external hdd which is able to run Plex and stream all available media across connected wireless devices. The only remarkable problem was is requirement to manually copy required content to hdd, at least when you already have some instance of Plex set up. But now, with plexiglas, you can easily have multiple servers with similar data.

Features

  • Mobile Sync, Plex Pass subscribers only
    • Limit used space
    • Minimize transcoding somehow (no idea if it's possible)
  • Work with Python 2.7
    • Work on WD My Passport Wireless Pro (docs)
      • Run and able to download files
      • Keyring is working
  • Resume transfer
  • Simple downloading of original video for those, who don't have PlexPass
    • With configurable transcoding
    • Automatically remove watched videos
    • Download all video parts, not only first
  • Mark missing videos as watched
  • Limit bandwidth
  • Trailers downloading & converting to mp4
  • Confirmed working with Movies & TV-Shows
    • mobile sync
    • simple sync
  • Confirmed working with audio
    • mobile sync
    • simple sync
  • Confirmed working with photo
    • mobile sync
    • simple sync
  • Confirmed working with playlists
    • mobile sync
    • simple sync
  • --subdir as plugin
  • Sync watching position

Installation

pip install plexiglas

(sudo may be required)

If you'll receive an error like AttributeError: 'MyPlexAccount' object has no attribute 'syncItems' it means that you already have PlexAPI installed, but without my changes, to fix this please execute following commands:

pip uninstall plexapi
pip install 'plexapi>=3.1.0'

Usage

plexiglas -d "/Volumes/My Passport/PlexSync" --limit-disk-usage 10% -w

Following arguments are currently supported:

  • -u, --username — your Plex.tv username, after the first run in will be securely stored in a keychain
  • -p, --password — your Plex.tv password, after the first run in will be securely stored in a keychain
  • -n, --device-name — allows to set human-readable device name instead of computer name
  • -d, --destination — the path where to store downloaded files and Plexiglas' DB, current dir by default. Do not forget to copy .plexiglas.db file to the new path manually, If you'd like to change the folder
  • -w, --mark-watched — if a previously downloaded file is missing within destination directory the media would be marked as watched
  • --debug — enable debug logging
  • -v, --verbose — enable logging from underlying library (plexapi)
  • -s, --limit-disk-usage — sets disk usage limit, supported human-readable format and percents of total disk space
  • --loop — run the script in a loop, so it will monitor for updates
  • --delay — sets delay (in seconds) between iterations
  • -r, --resume-downloads — restart download if file is exist
  • --rate-limit — limit bandwidth usage
  • -q — close application right after initialization and storing all required data in keyring
  • -i, --insecure — use insecure keyring, which can be used in non-interactive mode
  • --skip — skip specified file from downloading, can be used multiple times. E.g. passing Rewatch/The Butterfly Effect (2004).mp4 as an argument will skip the movie The Butterfly Effect from downloading to sync named Rewatch
  • --subdir — store each movie in subdirectory, so you can easily add extras (e.g. trailers)
  • --simple-sync-url — download media from specific part of the library, you should enter argument value in format URL [<COUNT> [<ALLOW_WATCHED>]], where items in square braces are optional. To get the URL simply open your Plex Web UI, go to the library you're interested in (syncing for single items like Movie, TVShow, Season also supported), set any required filters and / or sorting and copy the resulting URL from the browser. Sample usage:
    • Download 10 unwatched movies, sorted by year of release (all filters and sorting are set in Plex Web UI)
    --simple-sync-url https://app.plex.tv/desktop#!/server/607c8c938b50eef734456f8b9da94b5d02339ce5?key=%2Flibrary%2Fsections%2F1&typeKey=%2Flibrary%2Fsections%2F1%2Fall%3Ftype%3D1&save=1&limit=&sort=year%3Adesc 10
    
    • Download 5 oldest watched movies:
    --simple-sync-url http://example.com:32400/web/index.html#!/server/607c8c938b50eef734456f8b9da94b5d02339ce5?key=%2Flibrary%2Fsections%2F1&typeKey=%2Flibrary%2Fsections%2F1%2Fall%3Ftype%3D1&customFilter=1&save=1&sort=lastViewedAt&filters=unwatched%21%3D1 5 1
    

If you wouldn't provide a username and/or password the app will ask you to provide them in interactive mode, afterwards it will be stored in secure storage, unless option -i was set.

If you're using Mobile Sync you can split all your files by subdirectories in quite an easy way: when you create a new Sync Item in Plex interface it asks you for a title — it would be a folder name for all the items, related to this item. And there lies a trick, there is some special handling for this title:

  • You can set it to something like Movies#Best — in this case the part after # will be ignored and all the files would be placed within Movies folder, while you'll be able to differentiate Sync Items in the interface
  • You can use / or \\ to split the files by folders, e.g. you can add a new Item TV Shows/The Big Gang Theory and all the episodes will be stored inside directory TV Shows/The Big Gang Theory of your downloading path.

Metadata

Release files for plexiglas 0.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plexiglas 0.4.4
File Size Uploaded
plexiglas-0.4.4.tar.gz 19.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for plexiglas 0.4.4
File Interpreter ABI Platform
plexiglas-0.4.4-py3-none-any.whl Python 3 none any Details
plexiglas-0.4.4-py2-none-any.whl Python 2 none any Details

Total release size: 64.1 kB

Release files / plexiglas-0.4.4.tar.gz

Download URL plexiglas-0.4.4.tar.gz
Size 19.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5d3730dee152f522fdfa3617f8df376a6f67ffc2c7a01db70a905139bba1b6bd
BLAKE2b-256 checksum
How to use checksums
cd07ee4a692bf94b3ac67b96e2faa45346b756a390971e94c4ee2634ca6c0998
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

Release files / plexiglas-0.4.4-py3-none-any.whl

Download URL plexiglas-0.4.4-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
66ae65120d35b49e18429c48bb304af143238ea933d2b0e4d0615d143b662b55
BLAKE2b-256 checksum
How to use checksums
e2301d455073e06c5f861ba730eacccdda49004b0ca10538b6e6807f221a379b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

Release files / plexiglas-0.4.4-py2-none-any.whl

Download URL plexiglas-0.4.4-py2-none-any.whl
Size 22.4 kB
Tags Python 2
SHA-256 checksum
How to use checksums
9fc49e8599588dd601aa27f3e1fc954074dacacdddd97d03da5656fb6d96694c
BLAKE2b-256 checksum
How to use checksums
dba9868d44a135e6161e3500a1fa141c86492d3b00fd67f1b52692182b3b1274
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.15

Release history Release notifications | RSS feed

This release

0.4.4 This release

3 release files

0.4.3

3 release files

0.4.2

3 release files

0.4.1

3 release files

0.4.0

3 release files

0.3.10

3 release files

0.3.9

3 release files

0.3.8

3 release files

0.3.7

3 release files

0.3.6

3 release files

0.3.5

3 release files

0.3.4

3 release files

0.3.3

3 release files

0.3.2

3 release files

0.3.1

3 release files

0.3.0

3 release files

0.2.2

3 release files

0.2.1

3 release files

0.2.0

3 release files

0.1.12

3 release files

0.1.11

3 release files

0.1.10

3 release files

0.1.9

3 release files

0.1.8

3 release files

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page