Stremio addon for fetching videos from your google drive.

Overview

stremio-gdrive

image image

Instructions:

There are two ways to go about:

  • Method 1 is hard and long but might give you better performance and you need to make your own google cloud project thingy.
  • Method 2 relies on rclones google cloud project saving you the burden of having to create your own project i.e. you get to skip the next 17 steps.

Method 1 starts from here

  1. Go to https://console.cloud.google.com/projectcreate
  2. Name the project whatever you want and click create.
  3. Next to "Google Cloud Platform," click the Down arrow image and select your project.
  4. At the top-left corner, click the hamburger menu icon: image Click APIs & Services > Credentials.
  5. Click Configure Consent Screen. The "OAuth consent screen" screen appears.
  6. Set user type to external and click create.
  7. Fill in the required details, you can give your own email as dev and support email. Click save and continue.
  8. For the scopes page leave it as it is and click save and continue.
  9. Now add yourself (your email id) as the test user by pressing add users. Click save and continue.
  10. Now on your left, under API & Services, you will see Dashboard. Click on it and then click on Enable APIs and Services.
  11. Search for Google Drive and click on the result that says Google Drive API and then click on Enable.
  12. Now do step 4 again.
  13. Click Create Credentials > OAuth client ID.
  14. Choose application type as Desktop, name it whatever you want and click create.
  15. The newly created credential appears under "OAuth 2.0 Client IDs." Click the download button to the right of the newly-created OAuth 2.0 Client ID. We will get a client_secret.json file, we will need this for the next section.
  16. Now once again, at the top-left corner, click the hamburger menu icon: image Click APIs & Services > OAuth Consent Screen.
  17. Under Publishing Status you will see a button called PUBLISH APP, click on that and choose confrim.

Method 2 starts from here

  1. Use the colab notebook to easily obtain the token and the required code for the cloudflare proxy:

Open In Colab

  1. Run the cell of the respective method number you chose. Just press the circular play button beside the rectangular box.

  2. Login with your google account. Copy the js code and copy the token string for later when we deploy the heroku backend, the token should look something like this:

{"token": "jhgdfgdhgfh", "refresh_token": "1//sdhgbfdhghd", "token_uri": "https://oauth2.googleapis.com/token", "client_id": "hsdgfjhgfsd.apps.googleusercontent.com", "client_secret": "gfsdfsdgf", "scopes": ["https://www.googleapis.com/auth/drive"]}

  1. Go to https://dash.cloudflare.com/ log in or sign up.
  2. Open the Workers option.
  3. Create your sub-domain or continue if already done.
  4. Select the Free Plan. Click on Create a Worker. You can rename the workers at top of the page.
  5. In the Script{} box you will see some code, delete all that and paste the js code that you obtained in step 18 there.

Deploying to heroku:

Deploy to Heroku

  1. Hit the deploy button.
  2. Paste the token string in the token field.
  3. Copy your cloudflare worker url and paste it in the cf proxy url field.
  4. Hit deploy.

Adding addon to Stremio:

  1. Get the url of the heroku app you deployed. Add /manifest.json to the end. For example if my herokuapp url is https://stremiogdrive.herokuapp.com/ add /manifest.json to the end to get: https://stremiogdrive.herokuapp.com/manifest.json. Copy this url.
  2. Go to https://staging.strem.io/ and log into your stremio account. Press the puzzle icon on the top right.
  3. On your left you will see a search box with the text "Search Addons", paste the url you got in step 1 in the search box. A prompt will open up, press install.

How the addon works

The addon uses the drive api to search for video files in your drive (both your teamdrives and mydrive) kinda like using the google drive web search bar.

So after setting up the addon go and search for something on stremio. When you open a search result, stremio will ask the addon if it has the video for the search result. The addon searches for the video in your google drive and if it gets any result it will give it to stremio and stremio will display the results.

For example if I want to watch a movie, say its called Pirates of the Goolag, then:

  • I will open stremio and search for Pirates of the Goolag. If its on imdb then it should appear on the stremio search results (stremio fetches search results from imdb).
  • Open the search result for Pirates of the Goolag and stremio will ask the addon if it has a video stream for Pirates of the Goolag.
  • The addon searches in your Google Drive for Pirates of the Goolag and if its anywhere on your google drive, doesnt matter where as long as the video file has the name and year of the movie (for eg: Pirates of the Goolag 2016.mkv or Pirates.of.the.Goolag.2016.UHD.BluRay.x265.mkv), the addon will return the search results for Pirates of the Goolag.
  • Stremio will then display it as a video stream and all you have to do is tap on it and enjoy.

The addon searches for:

  • Movies by searching for Videos with their filename as the name of the movie and when it was released. Eg video filename: Pirates of the Goolag 2016.mkv

  • Series episodes by searching for Videos with their filename as the name of the series and which episode it was by a specifier. Supported specifiers are:

    • S01 E01
    • S1 E1
    • Season 1 Episode 1
    • 1x01

Issues / Limitations / Explanations

  • Apps hosted on heroku sleeps after 30 mins of inactivity. So after 30 mins of inactivity the addon needs about 30 secs to start back up and then some time to fetch the results. If you use something like Kaffeine you can overcome this as Kaffeine pings your app every 30 mins. Downside is that you will spend extra dyno hours. Free dynos have about 550 hours of runtime per month which is about 22 days.
  • Google api is not very fast so if you have a ton of results it might take 10 - 15 secs to load.
  • Cloudflare workers is used as a proxy to stream files from google drive since it is really fast.
  • I am an amateur and I did this to the best of my ability. If you find flaws feel free to post an issue.

For the sake of security please don't share your herokuapp url or your cloudflare workers proxy url. They can be used to get files from your drive.

TikTok - TikTok Bot to download video or audio from TikTok

TikTok - TikTok Bot to download video or audio from TikTok

JMTHON 51 Mar 04, 2022
Newsemble is an API that provides easy access to the current news for programmatic analysis

Newsemble is an API that provides easy access to the current news for programmatic analysis. It has been built using Python, BeautifulSoup and MongoDB.

Rishabh 43 Dec 16, 2022
Utility for downloading works from AO3 (Archive Of Our Own)

froyo A small graphical application for batch downloading works from Archive Of Our Own (AO3). Curate a fic repo of your own today :) Features Batch d

flux 24 Dec 09, 2022
You Can download any video/image in all social medias very easy and High Speed.

All-Downloader You Can download any video/image in all social medias very easy and High Speed. also you can easily download videos from web browsers s

Razor Kenway 14 Dec 16, 2022
Easy automated ebook downloader using openbooks as the backend

Easy automated ebook downloader using openbooks as the backend

27 Nov 06, 2022
Fully Automated YouTube Channel ▶️with Added Extra Features.

Fully Automated Youtube Channel ▒█▀▀█ █▀▀█ ▀▀█▀▀ ▀▀█▀▀ █░░█ █▀▀▄ █▀▀ █▀▀█ ▒█▀▀▄ █░░█ ░░█░░ ░▒█░░ █░░█ █▀▀▄ █▀▀ █▄▄▀ ▒█▄▄█ ▀▀▀▀ ░░▀░░ ░▒█░░ ░▀▀▀ ▀▀▀░

sam-sepiol 249 Jan 02, 2023
The tool allows to download a list of tiktok sounds

dependencies: pip install requests how to use LAUCH THE PROGRAM file (option f)

carpal 3 Jan 21, 2022
Let's you download entire YT-playlists.

Youtube MP3 Playlist Downloader Let's you download entire youtube playlists as mp3 files. This application is basically a script that makes it easier

11 Dec 18, 2022
一个在新番更新后第一时间在dmhy等BT下载站自动下载的小工具.

Anime Track 一个在新番更新后第一时间自动下载的小工具. 可以根据自定义的关键字在dmhy等BT下载站在搜索结果更新时将磁力链发送至aria2实现自动下载. 基本功能包含: 将BT下载站的某个关键字的搜索结果的所有磁力链添加至ARIA2 自动更新aria2 trackers 将已添加的磁力

Sunky 24 Oct 12, 2022
Implementation of Cross-category Video Highlight Detection via Set-based Learning (ICCV 2021).

Cross-category Video Highlight Detection via Set-based Learning Introduction This project is an implementation of ``Cross-category Video Highlight Det

Minghao (Alan) Xu 49 Dec 17, 2022
YTPY Youtube Downloader Made by: Ferreira, Amarau and Rodric

YTPY Youtube Downloader Made by: Ferreira, Amarau and Rodric How to Install on Linux: sudo apt install python3 python3-pip git pip install pytube git

7 Nov 24, 2022
Python library to download bulk of images from Bing.com

Python library to download bulk of images form Bing.com. This package uses async url, which makes it very fast while downloading.

Guru Prasad Singh 105 Dec 14, 2022
The lyrics module of the repository apple-playlist-downloader

This is the lyrics module of the repository apple-playlist-downloader. With this code you can download the .lrc file (time synced lyrics) from yours t

Antoine Bollengier 6 Oct 07, 2022
Download every approved Obsidian.md community Plugin and Theme

obsidian-repos-downloader Contents What? Why? Setup Requirements Download Run Getting Started Usage - all the arguments Output Directories Flatter Str

Clare Macrae 16 Dec 13, 2022
Download all posts and comments in a subreddit

subreddit downloader This subreddit downloader downloads all posts and comments in a subreddit For a tutorial to use this program please follow this m

Guneet 6 Dec 16, 2022
A program which takes an Anime name or URL and downloads the specified range of episodes.

super-anime-downloader A console application written in Python3.x (GUI will be added soon) which takes a Anime Name/URL as input and downloads the ran

Sayyid Ali Sajjad Rizavi 26 Jul 18, 2022
Python Youtube Video-Playlist Downloader

Youtube-Video-Playlist-Downloader-PyQt5 You can download videos and playlists on YouTube with this script. Script has GUI. Enjoy. Setup git clone http

Yunus Emre Öztürk 2 Jun 06, 2022
Python/Selenium script to scrape data about university courses

university-courses Python/Selenium script to scrape data about university courses. Script first extracts URLs of each courses homepage, then trawls ea

Sam Brown 1 Feb 02, 2022
A simple python script and it's used for mp4 type video downloading from youtube.

This is a simple python script and it's used for mp4 type video downloading from youtube. also, it's used inbuilt python module pytube. Furthermore, I know we have so many apps and online websites to

Yousaf K Hamza 1 Jan 10, 2022