All Projects → masonr → Plexidrive

masonr / Plexidrive

Licence: mit
Scripts to facilitate the use of cloud storage (such as Google Drive) as storage for Plex media server

Programming Languages

shell
77523 projects
bash
514 projects

Projects that are alternatives of or similar to Plexidrive

Plexus
A suite of tools to help manage your media collection.
Stars: ✭ 78 (-33.9%)
Mutual labels:  bash-script, rclone, plex, plex-media-server
Cloud Media Scripts
Upload and stream media from the cloud with or without encryption. Cache all new and recently streamed media locally to access quickly and reduce API calls
Stars: ✭ 84 (-28.81%)
Mutual labels:  google-drive, rclone, plex, plex-media-server
Homescripts
My Scripts for Plex / Emby with Google Drive and rclone
Stars: ✭ 652 (+452.54%)
Mutual labels:  google-drive, rclone, plex-media-server
Plexguide.com
Welcome to https://PlexGuide.com ~ Rapidly deploy multiple-hasty Docker Containers through Ansible with local or Unlimited Google HD Space!
Stars: ✭ 1,631 (+1282.2%)
Mutual labels:  google-drive, rclone, plex
Plex.py
Python interface for the Plex Media Server API
Stars: ✭ 22 (-81.36%)
Mutual labels:  plex, plex-media-server
Pgclone
Visit the PG Repos @ https://github.com/PGBlitz - PGClone (PG's Mount & RClone Execution)
Stars: ✭ 18 (-84.75%)
Mutual labels:  google, rclone
Porthole
A window into the status of multiple services related to Plex Media Server (Plex, Couchpotato, Sickrage, Deluge, Sabnzbd+, etc.).
Stars: ✭ 30 (-74.58%)
Mutual labels:  plex, plex-media-server
Googledriveuploadtool
A tool for Windows to upload and manage files in Google Drive. It resumes uploads in case of an error or failure. Perfect for uploading large files or if your connection is unstable.
Stars: ✭ 58 (-50.85%)
Mutual labels:  google, google-drive
Gdrivefs
An innovative FUSE wrapper for Google Drive.
Stars: ✭ 618 (+423.73%)
Mutual labels:  google, google-drive
Autorclone
AutoRclone: rclone copy/move/sync (automatically) with thousands of service accounts
Stars: ✭ 1,002 (+749.15%)
Mutual labels:  google-drive, rclone
Cloudbox
Ansible-based solution for rapidly deploying a Docker containerized cloud media server.
Stars: ✭ 1,763 (+1394.07%)
Mutual labels:  rclone, plex
Iptv.bundle
Plex plug-in that plays live streams (like IPTV) from a M3U playlist
Stars: ✭ 739 (+526.27%)
Mutual labels:  plex, plex-media-server
Rclone
"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Yandex Files
Stars: ✭ 30,541 (+25782.2%)
Mutual labels:  google-drive, rclone
Multipart Related
MIME multipart/related as defined in RFC 2387
Stars: ✭ 10 (-91.53%)
Mutual labels:  google, google-drive
Kube Rclone
kube-rclone is a rclone mount solution for Kubernetes
Stars: ✭ 87 (-26.27%)
Mutual labels:  rclone, plex
Plex Lastfm Scrobbler
Scrobble played audio items Last.FM from the Plex Media Server application.
Stars: ✭ 88 (-25.42%)
Mutual labels:  plex, plex-media-server
Heroku Google Drive
Remote Google Drive client on Heroku using Rclone and Aria2
Stars: ✭ 44 (-62.71%)
Mutual labels:  google-drive, rclone
Plex Nginx Reverseproxy
Configuration to serve Plex Media Center https://plex.tv using Nginx https://nginx.com
Stars: ✭ 523 (+343.22%)
Mutual labels:  plex, plex-media-server
Telly
An IPTV proxy
Stars: ✭ 557 (+372.03%)
Mutual labels:  plex, plex-media-server
Conv2mp4 Ps
This Powershell script will recursively search through a user-defined file path and convert all videos of user-specified file types to MP4 with H264 video and AAC audio using ffmpeg. The purpose of this script is to reduce transcoding CPU load on a media server like Plex or Emby and increase video compatibility across platforms.
Stars: ✭ 97 (-17.8%)
Mutual labels:  plex, plex-media-server

PLEXiDRIVE

Scripts to facilitate the use of cloud storage providers (i.e. Google Drive) as storage for Plex media using rclone

Purpose

The purpose of this project is to use Cloud Drives as a means of storage for Plex. These scripts can support any cloud drive services that are supported by rclone. The main use case of this project specifically targets using Google Drive unlimited accounts. Traditionally, using a Drive account with Plex runs into issues with exceeding Google's API call quota. This occurs during Plex scans of large media collections. To combat this, this project automates the uploading of media to a Drive account and automatically scans the individual directories where new media was placed. This means that only a small subset of the media library will be scanned as opposed to scanning the entire collection (requires automatic Plex scans to be switched off). The scripts also has the ability to upload media to multiple Google accounts for redundancy in a RAID 1-like manner. This can be useful if the Drive accounts have the potential to be banned or revoked (i.e. purchased on eBay, etc.).

Disclaimer

These scripts are use at your own risk, meaning I am not responsible for any issues or faults that may arise. I have tested these scripts on my own systems and verfied their functionality; however, due diligence is required by the end user. I am in no way affiliated with Google, Plex Inc., or rclone. I am not responsible if a ban is place on the user's Drive account due to abuse or excessive API calls.

Dependencies

  1. rclone
  2. Plex Media Server
  3. plexdrive (optional)

Installation

  1. Clone Git repo in home directory

    > ~$ git clone https://github.com/masonr/PLEXiDRIVE
    
  2. Edit permissions to allow plex user full access

    > ~$ sudo chmod -R 777 PLEXiDRIVE
    
  3. Install rclone and configure each Google Drive account

  4. Move rclone into a directory found in the PATH environment variable and edit permissions

    > ~$ sudo mv rclone /usr/local/bin/
    > ~$ sudo chown root:root /usr/local/bin/rclone
    > ~$ sudo chmod 755 /usr/local/bin/rclone
    
  5. Mount Google Drive(s) using rclone mount with options

    > ~$ sudo mkdir /mnt/gdrive-main
    > ~$ sudo rclone mount --allow-non-empty --allow-other gdrive-main:/ /mnt/gdrive-main &
    

    Edit path as needed and use rclone remote names configured in Step 3

    Alternatively, plexdrive should also be able to achieve mounting the remote drive without needing to change anything.

    Encrypted rclone mounts can also be used, but be sure to point your Plex libraries to the decrypted mounts and use the encrypted rclone mount names in the plexidrive config file.

  6. Determine the Plex media section numbers for the Movies and TV Show libraries

    • Libraries must first be set up on the Plex server (map the Movies library to the rclone mounted path; same for TV Shows)
    > ~/PLEXiDRIVE$ sudo su -c 'export LD_LIBRARY_PATH=/usr/lib/plexmediaserver; /usr/lib/plexmediaserver/Plex\ Media\ Scanner --list' plex
    	1: Movies
    	2: TV Shows
    

    See command and example output above

    • Copy the corresponding library section numbers to the plexidrive.conf (plex_movies_section_num & plex_tvshow_section_num)

Important Notes

  • Movies must be placed in the root of the Drive account in a folder called "Movies"
  • TV Shows must be placed in the root of the Drive account in a folder called "TV Shows"
  • TV Shows must be organized of the form: "(root)/Show Name/Season Number/files" (use an automation tool, such as SickRage or Sonarr for ease)
  • The script will not delete empty TV Show folders after successful uploading
  • Movies can be placed in individual folders or in the local Movies root directory
  • In order to avoid a ban on the Google Drive account with large Plex libraries, the automatic media scans within Plex server settings must be switched off
  • It's very important to use the exact notation as described for the config file parameters or the scripts may not work at all
  • The plex-scan script must be run as root user (sudo ./plex-scan.sh) as the script must have the effective user as plex

Usage

Uploading media

Simply run the script below after configuring the Plex server and setting up the plexidrive.conf file

> ~/PLEXiDRIVE$ ./plexidrive.sh

Scanning Plex library for new files

> ~/PLEXiDRIVE$ sudo su -c './plex-scan.sh' plex

Cron jobs

In order to automate the uploading of media and Plex scans, cron jobs can be used. Add a cron job to the root crontab for the Plex scan, and to the local user's account for the media uploads.

Example cron job to run PLEXiDRIVE every 4 hours:

0 */4 * * * /bin/bash /path/to/PLEXiDRIVE/plexidrive.sh && su -c '/bin/bash /path/to/PLEXiDRIVE/plex-scan.sh' plex

Configuration (plexidrive.conf)

GDrive Settings

  • num_of_gdrives: the number of Google Drive accounts to upload media files to
  • drive_names: the name(s) of the Google Drive accounts

Options

  • delete_after_upload: denotes if the local media files should be deleted after successful upload
  • file_types: the file types to scan for when detecting files to upload
  • rclone_config: (optional) full path to rclone config file

Plex Library Directories

  • plex_tvshow_path: the path of the rclone mounted drive and folder where TV Shows will be found
  • plex_movies_path: the path of the rclone mounted drive and folder where Movies will be found
  • plex_movies_section_num: the library section number corresponding to Movies, found in installation step 9
  • plex_tvshow_section_num: the library section number corresponding to TV Shows, found in installation step 9

Local Media Directories

  • local_tvshow_path: the path where local TV Show media will be found
  • local_movies_path: the path where local Movie media will be found

Enable/Disable Componenets

  • enable_show_uploads: enable or disable uploading of TV media
  • enable_movie_uploads: enable or disable uploading of Movie media

Example Config w/ One Google Drive

## GDrive Settings ##
num_of_gdrives=1
drive_names=('gdrive-main')

## Options ##
delete_after_upload=true # true/false
file_types="mkv|avi|mp4|m4v|mpg|wmv|flv"
rclone_config=""

## Plex Library Directories ##
plex_tvshow_path="/mnt/main/TV Shows" # no ending /
plex_movies_path="/mnt/main/Movies" # no ending /
plex_movies_section_num=1
plex_tvshow_section_num=2

## Local Media Directories ##
local_tvshow_path="/home/masonr/tv-shows/" # end with /
local_movies_path="/home/masonr/movies/" # end with /

## Enable/Disable Components ##
enable_show_uploads=true # true/false
enable_movie_uploads=true # true/false

Example Config w/ Two Google Drives

## GDrive Settings ##
num_of_gdrives=2
drive_names=('gdrive-main' 'gdrive-backup')

## Options ##
delete_after_upload=true # true/false
file_types="mkv|avi|mp4|m4v|mpg|wmv|flv|mpeg"
rclone_config="/home/masonr/.config/rclone/rclone.conf"

## Plex Library Directories ##
plex_tvshow_path="/mnt/main/TV Shows" # no ending /
plex_movies_path="/mnt/backup/Movies" # no ending /
plex_movies_section_num=1
plex_tvshow_section_num=2

## Local Media Directories ##
local_tvshow_path="/home/masonr/tv-shows/" # end with /
local_movies_path="/home/masonr/movies/" # end with /

## Enable/Disable Components ##
enable_show_uploads=true # true/false
enable_movie_uploads=true # true/false
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].