Giter VIP home page Giter VIP logo

goindex's Introduction

goindex
goindex-license GitHub Release Date GitHub last commit goindex-softwareheritage.org GitHub repo size

Google Drive Directory Index
Combining the power of Cloudflare Workers and Google Drive will allow you to index you files on the browser on Cloudflare Workers.

index.js is the content of the Workers script.

Versions

Worker Script (Dark Mode) : index.js

Worker Script (Multiple Google Accounts) : index-multiple-accounts.js

Demo - goindex.teamsdrives.workers.dev

Copy the index.js script to workers.dev and edit client_id, client_secret, refresh_token with yours

OR

GoIndex Auto Code Builder

https://goindex.glitch.me/

Simply visit this Modified (only for Dark Mode) version to automatically generate your index.js without having to manually edit anything.

goindex-list

goindex-thumbnail

goindex-awesome

Toggle View

goindex-toggle-view



Worker Script - index.js

Upload Files using CLI gdindex_upload.py

## Python Example
import requests

# "upload: true" in the script
to_upload = "https://i.imgur.com/8w2KDrG.gif"
baseURL = "https://gdindex-dark.teamsdrives.workers.dev/"
# "folder1/folder2/goindex.gif"
# Subdirectories of Folder in Google Drive
fileName = "folder1/folder2/goindex.gif"
# Default teamDriveID is "root"
teamDriveID = "0ANCHcQq-8cmvUk9PVA"

URL = baseURL + "/" + fileName + "?rootId=" + teamDriveID + "&url=" + to_upload
r = requests.put(URL)
print(r.text)

Demo - gdindex-dark.teamsdrives.workers.dev

3. donwa/goindex

Workers Script - index.js

Themes

Deployment

1.Install rclone software locally
2.Follow https://rclone.org/drive/ bind a drive
3.Execute the commandrclone config file to find the file rclone.conf path
4.Open rclone.conf,find the configuration root_folder_id and refresh_token
5.Download index.js in https://github.com/donwa/goindex and fill in root and refresh_token
6.Deploy the code to Cloudflare Workers

Free Teamdrives

Get free Google Shared Drives

Quick Deployment

1.Open https://goindex.glitch.me/
2.Auth and get the code
3.Deploy the code to Cloudflare Workers

To Get Search Bar Working

If you're using your root folder Set Roots like this

"roots": [ { "id": "root", "name": "{Name}", "user": "", "pass": "", "protect_file_link": false } ],

If you're using your Team Drive Set Roots like this!

"roots": [ { "id": "{Your Team Drive ID}", "name": "Nexa Torrents", "user": "", "pass": "", "protect_file_link": false } ],

Don't use your Team Drive Folder Id . Use Your Team Drive ID Ex:- If your Team Drive Link is https://drive.google.com/drive/u/0/folders/0AJOMLOnArqblUk9PVA . Your Team Drive Id is 0AJOMLOnArqblUk9PVA

Optional

Use this when you want to host everything

Get Google ClientID and SecretID

Log into the Google API Console [https://console.developers.google.com/] with your Google account. It doesn’t matter which Google account you use. (It need not be the same account as the Google Drive you want to access)

Select a project or create a new project.

Under “ENABLE APIS AND SERVICES” search for “Drive”, and enable the “Google Drive API”.

Click “Credentials” in the left-side panel (not “Create credentials”, which opens the wizard).

It will prompt you to set the OAuth consent screen product name, if you haven’t set one already.

OAuth Consent Screen > User Type > External > Application Name

Click “Credentials” in the left-side panel, then “Create credentials”, then “OAuth client ID”.

Choose an application type of “other”, and click “Create”. (the default name is fine)

It will show you a client ID and client secret. Use these values in rclone config to add a new remote or edit an existing remote

Setup rclone

Install rclone software locally
Follow https://rclone.org/drive/ bind a drive

Use the client_id & client_secret while setup

Execute the command rclone config file to find the file rclone.conf path

open rclone's config file, here we will find following Configurations (we will need these in next steps)

  • client_id
  • client_secret
  • refresh_token
  • ROOT_FOLDER (will be like 0AG1OSyxjvYcLUk9PVA)

Setup Cloudfare Workers

Go to [https://workers.cloudflare.com/]

signup using email and password enter a subdomain [____.workers.dev] ---> Set up

Choose Workers Plan (FREE)

  • FREE - 10000 request/day
  • $5/month - 10M requests/month

Verify Email Goto Workers ---> "Create a Worker"

Now copy the Content of the index.js to the script section

Edit this object in the script with the details you generated above

var authConfig = {
    "siteName": "GoIndex", // Sitename
    "root_pass": "",  // root password, leave it blank if you don't want
    "version" : "1.0.6", // Program Version
    "hash" : "master", // master OR your HASH, do not leave blank (changes each time you make a commit)
    "theme" : "classic", // material  classic 
    "client_id": "****************************.apps.googleusercontent.com", // client_id from rclone config
    "client_secret": "*******************", // client_secret from rclone config
    "refresh_token": "******************************************", // authorized refresh token from rclone config
    "root": "0AG1OSyxjvYcLUk9PVA" // ROOT_FOLDER from rclone config,
};

Important Note :

  • if you have binded Teamdrive with rclone then make sure you specify the TeamDrive's root folder. Example - ["root": "0AG1OSyxjvYcLUk9PVA"]
  • but if you want to use "My Drive" then simply write "root". Example - ["root": "root"]
  • Each time you make a commit to a file its HASH changes, so to access the new file you have to specify the hash OR keep it default "hash" : "master"

Host src file in your own github repo

why ?

you can change the icon of the folders and files and much more

replace the below line in head with yours

<USERNAME>
<REPOSITORY>
<VERSION or HASH>
</PATH/TO/FILE>
src="//cdn.jsdelivr.net/combine/gh/jquery/jquery/dist/jquery.min.js,gh/<USERNAME>/<REPOSITORY>@<VERSION or HASH>/PATH/TO/FILE.js"

Example :

src="//cdn.jsdelivr.net/combine/gh/jquery/jquery/dist/jquery.min.js,gh/alx-xlx/goindex@${authConfig.hash}/themes/${authConfig.theme}/app.js"

Change Icons

SOON https://www.w3.org/Icons/ https://www.w3.org/icons/ https://www.base64-image.de/

About

Cloudflare Workers allow you to write JavaScript which runs on all of Cloudflare's 150+ global data centers.

Credits - Original Authors

goindex-theme-acrou - Achrou

GDIndex - maple3142

goindex - donwa

goindex

goindex's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

goindex's Issues

Password for website

Is there any way to make you have to use a password to access the site where the indexed drive are located?

Quick Fix: Remove leaking of the Google Drive ID

I found out that you can see the Google Drive IDs of the files/folders when you make a request to list a folder.
Changing files(id, name, mimeType, to files(name, mimeType, on line 565 (folder listing) and 680 (search) fixes it as these are not used at all.
The website still runs absolutely fine. Just without the ID.

Would it be possible to change this in your Auto Builder?

Sorting Issue

The Files are not sort in specific order.
When Number is used like in My cases they sorting is like A-Z. Cant we add 1-9 way.

Downloading a folder

Hello and thank you for the code.

I'm wondering if I can add the download option to a whole folder instead of just the files.

Is there a way to do that? and how?

Thank you again.

1080p and above videos aren't playing!

I mean, videos are playing but its just a blank screen!!
and if possible please add a subtitle file manually option...so I can enjoy movies with subtitle if they don't have one.

cota api

it doesn't use the api's quota correctly, when I generate a new "refresh_token" from another account it works, but it doesn't last long and ends, any solution to this problem?
can you make this script work iqual rclone? because somehow the rclone controls the quotas better

Rclone crypt support

Hello,
is there any way to support the decryption of files with goindex? Would be super useful.

Portuguese Brazilian Language

Here is the Portuguese translation file. Please add.

{
  "_name": "Português Brasileiro",
  "languages": "Línguas",
  "index": "Início",
  "folder": "Pasta",
  "notify": {
    "title": "Notificação"
  },
  "copy": {
    "success": "Cópia bem sucedida",
    "error": "Falha em copiar"
  },
  "list": {
    "view": {
      "gridMode": "Exibição em grade",
      "listMode": "Exibição em lista"
    },
    "auth": "Diretório criptografado, digite a senha",
    "title": {
      "file": "Arquivo",
      "moditime": "Hora modificada",
      "size": "Tamanho",
      "operation": "Ações"
    },
    "loading": "Carregando...",
    "opt": {
      "copy": "Copiar link",
      "newTab": "Abrir em uma nova aba",
      "download": "Baixar"
    },
    "total": "Total",
    "item": "item"
  },
  "search": {
    "placeholder": "Pesquisar recursos..."
  },
  "page": {
    "video": {
      "play": "Reproduzir",
      "download": "Baixar",
      "link": "Link para baixar"
    },
    "text": {
      "loading": "Carregando..."
    }
  },
  "setting": {
    "clear": {
      "text": "Limpar cache",
      "success": "Limpeza de cache bem-sucedida"
    }
  },
  "checkVersion": {
    "tips": "Nova versão detectada, <a href='${url}'>Vá para o GitHub</a>"
  }
}

Add pagination

please add item limit for faster loading, in light mode
ex. 50 items per page
100 files = 2 pages

donwa classic mode broken password dialogue

for your donwa worker js in classic mode, i have the "root_pass": ""
but at the site, its still asking for a password. If you put empty password in the dialogue, it will direct me to home browser page

im using edge chromium browser

at chrome, is you enter nothing in the dialogue/prompt it will just stuck

Download Issue

whenever I try to download I keep getting the error message

{
"error": {
"errors": [
{
"domain": "global",
"reason": "downloadQuotaExceeded",
"message": "The download quota for this file has been exceeded."
}
],
"code": 403,
"message": "The download quota for this file has been exceeded."
}
}

Improve

It's working great on pc web browser but when I tried on mobile it doesn't show all functions.

Search feature in donwa/material

As i don't want multiple drive option and want to use different video player, can you please add search feature to this.

The problem is i want the file id in my app.js from the worker.js. Only in donwa it is possible. All other index don't return file id to app.js.

P.S: I am using the file id to directly play video from the drive instead of using the inbuilt HTML5 player.

I tried on other index but i was unable to get it working as don't know the code too well.

File doesnt displayed sometime

Hello, i have an issue here. Where sometime, when i enter a folder, it goes blank, or the subfolders and files doesnt displayed. I need to refresh the page in order to display it. How to solve this problem? Thank you

Can you help with this error i am getting in cloudflare

Uncaught (in promise) TypeError: Cannot read property '0' of undefined
at googleDrive._findDirId (worker.js:854)
at async googleDrive.findPathId (worker.js:824)
at async googleDrive.list (worker.js:547)
at async apiRequest (worker.js:344)

Can we make it Read Only?

HI..
can we make it read only?
i mean users can view all the content like file names and their sizes but they cant download anything, they cant watch videos or play audio files.

Just a Directory listing??

Showing empty

Thanks for this. I tried but showing blank. I rechcked drive id.
IMG_20200529_220732

Folder thumbnail?

Hello, i wondering if it's possible to add thumbnail on folder with images / video?

Subtitle (closed caption) support

Please, if possible, add Closed Caption (Subtitle) support. Example: A video called example.mp4 and have a file called example.vtt - the player can recognize the subtitle name as the same of the video, so, always when a file directory has a video and a .vtt file, will show the subtitle, if don't have it, won't show nothing.

Remove Ads

Can you remove the video ads ? It annoying.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.