angoikon angoikon
Bookmark

How to connect your Google Drive with your Plex Server

Introduction

By following this guide, you will not only be able to stream content from your "~/files/Plex" folder that resides inside your seedbox, but you will also be able to directly stream content from your Google Drive that will be connected to your Plex server!
Moreover, we give you the option to encrypt that Google Drive Plex folder so all new content you add will be encrypted. Your Plex server of course will have no problem streaming those files.

The installation process is done through our Seedbucket application (hint: we have disabled the previous installation method which was done from your Seedboxes.cc client area through 1-click installable apps). We handle all the internal configuration automatically. Our installer will create a folder named "Plex" in the root of your Google drive or under your pre-created Google encrypted folder, should you choose to use encryption. It will also create a local folder in your seedbox at "~/files/Plex".

Any media placed either in your local folder or 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

You need to first install the seedbucket application from your client area, in order to install the Plex server app. You can find our guide for installing and using the Seedbucket app here

IMPORTANT: In order to unlock the option to install Plex with your GDrive, first you need to connect it with your Seedbucket. If you also want to use encryption too, then you also need to create an encrypted folder first.

Once you have completed the above steps, go to your Settings from the top right corner, and then click the Apps tab. There you will find the option to install your plex server app via the Add Plex media server button and connect your Google drive with your Plex

file

If you have already installed Plex Media Server (via the old way - through the 1-click “Installable Apps” at your client area), without having Plex integration with Google Drive, you need to uninstall it first by clicking the delete button. After the process finishes, proceed re-installing Plex by following the directions above.
file

Plex integration with Google drive

Storage drive selection

Please note that you need to connect your Google Drive with your Seedbucket first and then follow the instructions below.

Click the button to enable Google drive integration and hit the Next button
file

From the dropdown menu, choose your Google drive or Google Team drive you wish to use Plex with and press Next .

Optional: If you have already pre-created encrypted folders to your Gdrive, you can select the encrypted folder you wish Plex to be installed to. This means that every file you place under that folder and its subfolders will gain encryption. Plex will of course have no problem streaming those files. If you don't want to use encryption, don't select any folder.
file

Enable Google drive API

file
Follow the link provided and log into the Google API Console.
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

Select a project in the dropdown menu on the top left Select a project or create a new one via the Create button on the top right corner
file

Note: If you have already created projects in the past and you create a new project for the Google drive integration, don't forget to select the project after it is created, as it doesn't get automatically selected!

Click the link + ENABLE APIS AND SERVICES as shown in the screenshot
file

Type the word Drive at the input field, choose Google Drive API and click ENABLE
file

file

Create application type

file
First click Credentials at the left side panel and then the Credentials in APIs & Services. If you haven't created a project in the past, click OAuth consent screen at the left side panel, type an application name and save
file

file

file

file

Note: If this is a Google team drive, there will be an extra option whether you want internal (restricted) or external (public) type of access. Choose External
file

The consent screen afterwards will include that option, just type an application name and save
file

You will be redirected to Credentials. Click the dropdown menu, choose the OAuth client ID and select type Other
file

Name the application type and press Create
file

Google Drive Credentials

The OAuth client will have been successfully created and a new window will appear with both the client ID and client secret. Hit the copy buttons as shown in the screenshot, return to your seedbucket page and paste them to the corresponding fields. Hit the Proceed to authorize button.
file
file

Authorize app

A new window will open that will request you consent for access. Authorize the app and click Allow in all modals that will appear
file
file

Switch back to the seedbucket Plex installation window and paste the code. Click Authorize the app to proceed
file

Claim plex code

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, follow the link to claim the necessary plex code. Copy the code and paste it back to the input field.

NOTE: If you copy the claim code by clicking on the Copy to cliboard button make sure that the claim code gets copied when you paste it back in the input field as sometimes the button does not work. In that case manually copy the claim code and paste it back to the input field. Also, 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 in that timeframe and proceed with the installation
file

That was it! You have successfully integrated Plex with your Google Drive!
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 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.

TIP: You can enable the "Ignore Deleted Episodes" setting in Sonarr and "Unmonitor Deleted Movies" in Radarr. This way all files that are moved to Google Drive will be marked as unmonitored and won't be downloaded again. You will have to enable the "Advanced Settings" toggle to see those settings.

Our implementation also supports this move to be done live, while streaming, without interrupting 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 so we can do that for you, or login to your seedbox's command line through SSH and copy-paste the following three 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 -

NOTE: Currently this script works for unencrypted Google drive Plex integration. If you want the script to work with an encrypted folder inside Google drive that you already set and installed Plex to, please send us a support ticket

9 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

d4rkwind
d4rkwind

The cron runs - “At minute 12 past hour 2 and 12.”

DaleTech
DaleTech

Regarding the advanced usage, once implemented is there anyway to run the cron job manually from SSH?

EDIT:
NVM worked it out.

mrmmm
mrmmm

I understand that my watched status will be saved if I uninstall and reinstall Plex to get the GDrive integration. But what about all other settings? Libraries, sharing, users, etc. Will all of that be retained? Or will I have to set everything up again?

aviztv
aviztv

Is there an option to encrypt the data in google drive, using for example: rclone

angoikon
angoikon
Staff

Please open a support ticket regarding the data encryption, if you haven't already done so