angoikon angoikon
Bookmark

How to connect your Google Drive with your Plex Server

Posted April 15th, 2019    3148   2   howto how to Google drive Googledrive plex plex server Plex Media Server gdrive

Introduction

We have now enabled the option to directly connect your Google Drive (either your Personal or Team drive) with your seedbox Plex Server.
That means that you can now stream content not only from your "~/files/Plex" folder that resides inside your seedbucket but you can also directly stream content from your Google Drive that will be connected to your Plex server!

The installation process is as simple as you would expect from any app installed from within your Seedboxes.cc client area. We handle all the internal configuration automatically. Our installer will create a folder named "Plex" in the root of your google drive. It will also create a local folder in your seedbox at "~/files/Plex".

Any media placed either in your local folder of the gdrive folder, will be detected from your plex server. This allows at a later stage to offload content from your seedbox to your google drive plex folder in a seamless way, without your plex server to re-index these titles.

Installation

If you have already installed Plex Media Server through your “Installable Apps” , you need to first uninstall it in order to connect your Google Drive. Don't worry, you won't lose your media files!
file

After finishing the uninstall, click the “Installable Apps” and choose to install the Plex Media Server app
file

At the installation steps, tick the box to enable connecting the Google Drive, and follow the necessary instructions that are thoroughly explained below
file

Installation instructions

1) Google API Console

Follow the link provided and log into the Google API Console. It doesn't matter what Google account you use - it can be different from the Google account whose Google Drive you want to access to.
Keep the previous window open as you will need it afterwards to paste the necessary fields

Note: If this is your first time in the API Console, you need to accept the Terms of service, agree and continue
file

2) Select/create project

Click at the dropdown menu Select a project and either select a project or click at the top right corner to create a new one and give it a name - it can be anything you like
file
file
file

3) Enable API

Go to ENABLE APIS AND SERVICES, search for Drive and enable the Google Drive API
file
file
file

4) Credentials

Click Credentials in the left-side panel, then the first tab Credentials , and finally at the dropdown menu choose OAuth client ID.
file

Note: If you haven't already created credentials for another app in the past, it will prompt you first to set the OAuth consent screen product name - you can name it however you want. Also the dropdown menu will be in the right side of the panel.
file
file

5) Application type

At the Application type choose Other and give it a name of your liking
file

6) Client ID / Secret

Copy and paste both client ID and secret to the previous window with the the Plex installation instructions
file
file
After input of both fields, more instructions will appear

7) Authorize app

Click at the link to navigate to your Google account that has the drive that you will be connecting to your Plex Server.
Click Allow and the new window copy and paste the result back in the corresponding field, just as you did in the previous step.
file
file

8) Create Plex.tv account

If you don't have a plex.tv account, follow the link and we are going to register the plex server under your plex.tv account.
If you already have one, proceed to the next step

9) Claim plex code

Follow the link to claim the necessary plex code. Copy the code and paste it back to the input field. Don't manually copy the code, just click at the Copy to cliboard button.
file

Note : There is a 4-minute window of time in order use this claim code to install a new server, so make sure you paste it and proceed with the installation as soon as possible!

10) Finish installation

After pasting the Plex code at the necessary field, click Install at the bottom right corner to complete the installation.
file

Advanced Usage

It is possible to setup an automated offload of the content in your seedbox's "Plex" folder to your Google Drive's "Plex" folder, thus releasing the disk space utilized from your seedbox. You can setup this way all your apps (Sonarr, Radarr, Sickrage) to download the content into your seedbox's Plex folder, and 2 times per day this downloaded content will be moved to Google Drive and deleted from your seedbox.

Our implementation also supports this move to be done live, while streaming, without interupting your streaming experience during the transfer from your seedbox to your google drive (assuming the media will end up from the seedbox's Plex folder to the same location in the Google Drive's "Plex" folder).

In order to do that, either open a support ticket, or login to your seedbox's ssh command line and copy-paste the following commands:

mkdir -p ~/.local/bin

wget -O ~/.local/bin/offload_plex.sh https://raw.githubusercontent.com/Rapiddot/seedboxes.cc-VPN/master/scripts/offload_plex.sh

crontab -l | sed '/.*offload_plex.sh.*/d' | { cat; echo "`shuf -i 0-59 -n 1` `shuf -i 1-6 -n 1`,`shuf -i 12-16 -n 1` * * * bash /home/user/.local/bin/offload_plex.sh"; } | crontab -

4 Comments

Little_Echo
Little_Echo

Remember to turn off Settings->Libary->" Empty trash automatically after every scan" OFF as that will delete all of your libary metadata that is on gdrive in case of a outage

nudisteric
nudisteric

If I implement the automated offload to my GDrive, does it ignore partially downloaded files? Does it only copy completed files?

tony
tony
Staff

@nudisteric It will copy anything, but you should only place completed files in your plex folder, as they will be deleted from the local folder once transfered

sequence
sequence

"2 times per day this downloaded content will be moved to Google Drive and deleted from your seedbox"
on what hours it will be moving?
and second question, what if I seedin stuff from Plex directory? i need to stop it before movin?
and third, after auto-offload, I will be streamed directly from Gdrive - so user can use transoding if needed?
and last one - it can be active - Scan my library automatically and Run a partial scan when changes are detected? or i should turn it off?

Best regards