Giter Site home page Giter Site logo

gdindex's Introduction

GDIndex

preview

繁體中文 简体中文

GDIndex is similar to GOIndex. It allows you to deploy a "Google Drive Index" on CloudFlare Workers along with many extra features

By the way, instead of modify from GOIndex, this is a total rewrite

Demo

Difference between GOIndex and GDIndex

  • Frontend is based on Vue.js
  • Image viewer doesn't require opening new page
  • Video player support subtitles(Currently only srt is supported)
  • Online PDF, EPUB reader
  • No directory-level password protection(.password)
  • Support Http Basic Auth
  • Support multiple drives(personal, team) without changing server's code
  • Support exporting file urls
  • Support Aria2 download

Usage

  1. Install rclone
  2. Setup your Google Drive: https://rclone.org/drive/
  3. Run rclone config file to find your rclone.conf location
  4. Find refresh_token in your rclone.conf, and root_folder_id too(optionally).
  5. Copy the content of worker/dist/worker.js to CloudFlare Workers.
  6. Fill refresh_token, root_folder_id and other options on the top of the script.
  7. Deploy!

Enabling file url export

  1. Add following config to your worker.js:
    export_url: true
    
  2. Redeploy

Enabling download with Aria2

  1. Add config download_aria2: true to your worker.js:
    default_root_id: '...',
    client_id: '...',
    client_secret: '...',
    refresh_token: '...',
    ...
    download_aria2: true
    
  2. Redeploy, now you should see "Download with Aria2" and "Aria2 RPC Settings" beyond file list
  3. Fill your aria2 connection info in "Aria2 RPC Settings"
  4. Go to where you want to download and click "Download with aria2", which will add downloads for you!

Solving HTTPS connection issue

While deployed on CloudFlare, the content(html and file info) will be served with HTTPS. However, you may connect your aria2 via HTTP. Fetching HTTP content within HTTPS page is not allowed by browsers. To bypass it, you can:

  • use HTTPS connection aria2 by signing certificate
  • allow 'Insecure content' in browser

The latter is recommended. For Chrome, you can allow it by doing:

  1. Click the HTTPS lock on the left of URL
  2. Select "Site settings"
  3. Set "Insecure content" to "Allow"

Enabling file copy on forbidden

Google Drive limited each users' file sharing bandwidth(about 750GB per day). If you try pulling a shared file from who exceed this limit, you will receive a 403 - forbidden error. Copying file to your may solve this problem, but it hurts because you can only copy a file once a time.

That's why "Copy on forbidden" comes in.

  1. Create a folder, which will be used to store your copied files, crawl its id from network requests(normally you can get it from Developer Tools)
  2. Add following config to your worker.js:
  ...
  copy_on_forbidden: true,
  copy_parent_id: 'YOUR_COPY_FOLDER_ID' // replace YOUR_COPY_FOLDER_ID to your copy folder's ID
  1. Just do normal download, if this file exceed limits, worker will make a copy and return copied one to you. This process is transparent so you won't need to deal other things.

Note: Be sure to delete all you copied files after a while, as more files get copied, it will consumer more space on you drive. Besides, this feature will NOT detect existing copies, multiple downloads will leads multiple copies.

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.