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 prior to the implentation 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, before proceeding with the installation. If you encrypt Plex folder after installation, then you will end up with content that Plex won't be able to decode and -therefore- stream.
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
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.
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
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. You MUST select the folder, even if it is only a single encrypted folder you have in your collection.
If you don't want to use encryption, don't select any folder and proceed with the installation
Enable Google drive API
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
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
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, which you find at the Dashboard left menu
Type the word Drive at the input field, choose Google Drive API and click ENABLE
Create application type
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, choose External user, type an application name and save
Note: There might be an extra option whether you want internal (restricted) or external (public) type of access. Choose External
The consent screen afterwards will include that option, just type an application name and save
You will be redirected to Credentials. If not, just click the Credentials at the left panel. Afterwards, click the + CREATE CREDENTIALS and at the dropdown menu, choose the OAuth client ID and select type TVs and Limited input devices
Name the application type and press Create
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.
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
Switch back to the seedbucket Plex installation window and paste the code. Click Authorize the app to proceed
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
That was it! You have successfully integrated Plex with your Google Drive!
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: The script transfers every subfolder under your local seedbox "Plex" folder towards your Google "Plex" folder (whether it is encrypted or not), so feel free to create your own custom folders. Just don't forget to add them to your Plex libraries afterwards.
16 Comments