This is a simple addon for Stremio that allows you to watch videos from Google Drive.
It searches your entire Google Drive and any shared drives you have access to for videos and presents them in Stremio.
If you combine it with some team drives, you have loads of content, all available to watch for free and without torrenting.
- Search your Google Drive and shared drives for videos
- Parses filenames for information accurately using regex and displays it in a appealing format.
- Easily configurable using the
CONFIG
object at the top of the code. (See Configuration)- Change the addon name
- Change the order of resolutions, qualities, visual tags, and filter them out if unwanted
- Change the sorting criteria (resolution, quality, size, visual tags)
- Prioritise specific languages and have them show up first in the results
- Only requires a single deployment with one file, making it easy to deploy and make changes.
This addon is designed to be deployed as a worker on Cloudflare Workers.
Here is a guide to deploying this addon, taken from my site: Viren070's guides. This will most likely be easier to follow on my site, however.
-
Go to the Google Cloud Console.
If this is your first time using Google Cloud, you will be prompted to agree to the terms of service:
-
Create a new project and select it:
How?
-
Click on
Select a project
in the top left: -
Click on
New Project
: -
Enter a project name and click on
Create
:- The project name can be anything you want, e.g.,
Stremio-Gdrive
. Leave theOrganization
field blank.
- The project name can be anything you want, e.g.,
-
Once the project has been created, you will get a notification:
- Click
Select Project
.
:::note You may also use the same dropdown from step i to select the project. :::
- Click
-
-
Setup our Google Auth Platform
-
Go to the Google Cloud Console.
-
In the search bar at the top, search for
Google Auth Platform
and click on the result: -
You should be met with a message telling you that
Google Auth Platform not configured yet
, click onGet Started
: -
Fill in the form:
App Information
:- Set
App Name
toStremio GDrive
. - Set
User Support Email
to your email. It should appear in the dropdown.
- Set
Audience
:- Set
User Type
toExternal
.
- Set
Contact Information
- Add any email address, you can use the same one you used earlier for
User Support Email
.
- Add any email address, you can use the same one you used earlier for
Finish
- Check the box to agree to the
Google API Services: User Data Policy
- Check the box to agree to the
-
Once you have filled in the form, click on
Create
-
-
Enable the Google Drive API.
-
Go to the Google Cloud Console.
-
In the search bar at the top, search for
Google Drive API
and click on the result: -
Click on
Enable
:
-
-
Create an OAuth client.
-
Go back to the
Google Auth Platform
page. -
Click on
Clients
in the sidebar and then click on+ Create Client
: -
Fill in the form:
Application Type
: Set this toWeb application
.Name
: You can set this to anything such asStremio GDrive
.Authorized redirect URIs
: Set this tohttps://guides.viren070.me/oauth/google/callback
-
Click on
Create
.
-
-
Publish the app.
-
Go to the Cloudflare Workers page and click
Log In
orSign Up
if you don't have an account. -
Once logged in, you should be taken to the Cloudflare Workers & Pages dashboard. Click on
Create
: -
Once on the create page, make sure you're on the
Workers
tab and clickCreate Worker
: -
You'll be asked to give a name to your worker. You can name it anything, this will be the URL you enter into Stremio to access your addon. Click
Deploy
once named. -
Once its done being deployed, you should be shown a success message. Click the
Edit code
button: -
You should be taken to the Cloudflare Worker editor:
-
Now, we need to obtain the code for the addon that we will use specific to our Google Drive. First, we need to obtain our
Client ID
andClient Secret
from the Google Cloud Console.-
Go to the Google Cloud Console.
-
In the search bar at the top, search for
Google Auth Platform
and click on the result: -
Click on
Clients
and click on the download icon for the client you created earlier: -
A pop-up will appear with your
Client ID
andClient Secret
. -
You can click the copy icons to copy the
Client ID
andClient Secret
to your clipboard for the next step.
-
-
Now, we can get the code for the Cloudflare Worker.
-
Go to the OAuth Tool
-
Fill in the form with the
Client ID
andClient Secret
from the previous step. -
Click
Authorise
-
Sign in with your Google account and allow the app to access your Google Drive.
You may encounter a warning page saying
Google hasn't verified this app
, click onAdvanced
and thenGo to... (unsafe)
.This warning is because the app is not verified by Google. This is normal for self-hosted apps.
-
You will be redirected back to the OAuth Tool with a success message. Click
Get Addon Code
. -
You should be shown another success message. Then, make sure you're on the
Viren070
tab and you should see a block of code. Copy this code. -
Go back to the Cloudflare Worker editor and after removing the existing code, paste the code you copied.
-
Your code should look something like this:
-
-
Click
Deploy
in the top right to save your changes and deploy the worker. -
Once deployed, you should see a green success message at the bottom. Click
Visit
next to the deploy button to go to the addon URL. -
You should be redirected to the /manifest.json. if not, append
/manifest.json
to the URL in the address bar. -
Copy the URL and add it to Stremio.
Done! You have now set up your own addon which will allow you to stream videos from your drives and team drives.
Although you may modify the code as you wish, I have supplied a CONFIG
object at the top of the code after CREDENTIALS
that allows you to easily
configure some aspects of the addon.
Note
Unless stated otherwise, all values are case sensitive
This table explains the configuration options:
Name | Type | Values | Description |
---|---|---|---|
resolution |
String[] |
"2160p" , "1080p" , "720p" , "480p" , "Unknown" |
This setting allows you to configure which resolutions are shown in your results. You may also change the order of this to change the order that the resolutions would show in the addon (if you sort by resolutions) You can remove certain resolutions to not have them show up in your results. The Unknown resolution occurs when the resolution could not be determined from the filename. You cannot add new resolutions to this list unless you also add the corresponding regex in the REGEX_PATTERNS object. |
qualities |
String[] |
"BluRay REMUX" , "BluRay" , "WEB-DL" , "WEBRip" , "HDRip" , "HC HD-Rip" , "DVDRip" , "HDTV" , "CAM" , "TS" , "TC" , "SCR" , "CAM" |
This setting allows you to configure which qualities are shown in your results. You may also change the order of this list to change the priority of them when sorting by quality. (e.g. if you put CAM/TS at the top of the list and sorted by quality, then CAM/TS results would appear higher than other qualities) Remove qualities from the list to remove them from your results. The Unknown quality occurs when one of the existing qualities could not be found in the filename. You cannot add new qualities to this list unless you also add the corresponding regex in the REGEX_PATTERNS object. |
visualTags |
String[] |
"HDR10+" , "HDR10" , "HDR" , "DV" , "IMAX" , "AI" |
This setting allows you to configure which visualTags are shown in your results. You can also change the order of this to change the priority of each visual tag when sorting by visualTag (e.g. If you were sorting by visualTag and moved IMAX to the front, and removed AI, then any results with the AI tag will be removed and any results with the IMAX tag will be pushed to the front)You cannot add new visual tags to this list unless you also add the corresponding regex in the REGEX_PATTERNS object. |
sortBy |
String[] |
"resolution" , "quality" , "size" , "visualTag" |
Change the order of this list to change the priority for which the results are sorted by.resolution - sort by the resolution of the file e.g. 1080p, 720p. The better the resolution (determined by the resolution's position in the resolution list) the higher the result.quality - sort by the quality of the file, e.g. BluRay, WEBRip. The better the quality (determined by the quality's position in the qualities list) the higher the result.size - sort by the size of file e.g. 12GB. The higher the size the higher they show in the results.visualTag - sort by the priority of the visual tags. Files with a visual tag are sorted higher and between files that both have visual tags, the order of the visual tag in the visualTags list will determine their order.Examples: If you want all 2160p results to show first with those results being sorted by size, then do resolution, then size If you want results to be sorted by size regardless of resolution, only have size in the list. If you want to see all HDR results first, and sort those results and the rest by size, then put visualTag and size in the list. |
considerHdrTagsAsEqual |
boolean |
true , false |
When sorting by visualTag, if this value is set to false, the HDR tags (HDR, HDR10, HDR10+) will be considered differently, and depending on their position in the visualTags list, they will be sorted accordingly. For example, if HDR10+ was placed first, then all HDR10+ files will appear first, regardless of if there are HDR files that rank higher based on other factors. With this value set to true, all HDR tags are considered equal and if you were sorting by visualTag , then size , a HDR file could appear above a HDR10+ file if the size of the HDR file was greater. |
addonName |
String |
any | Change the value contained in this string to change the name of the addon that appears in Stremio in the addon list and in the stream results. |
prioritiseLanguage |
String | null |
See the languages object in the REGEX_PATTERNS object for a full list.Set to null to disable prioritising specific language results. |
By setting a prioritised language, you are pushing any results that have that language to the top. However, parsed information about languages may be incorrect and filenames do not contain the language that is contained within the file sometimes. |
proxiedPlayback |
boolean |
true , false |
With proxiedPlayback enabled, the file will be streamed through the addon. If it is disabled, Stremio will stream directly from Google Drive. If this option is disabled, streaming will not work on Stremio Web or through external players on iOS. You are also exposing your access token in the addon responses. However, this option is experimental and may cause issues. I recommend leaving it enabled, and only if you encounter issues, try disabling this option. Note, that even with this enabled, anyone with your addon URL can still view your Google Drive files. |
driveQueryTerms. episodeFormat |
String |
"name" , "fullText" (see the Drive v3 API for more) |
This setting changes the object that we perform the queries upon for the episode formats (s01e03). I recommend leaving this to fullText. However, if you are getting incorrect matches, try switching to name |
driveQueryTerms. movieYear |
String |
"name" , "fullText" |
This setting changes the object that we perform queries upon for the release year of the movie. I recommend leaving this to name. However, if you are getting incorrect matches, try switching to fullText. |