一个漂亮强大的Google Drive列目录程序

一款 Google Drive 网盘列目录程序,不用服务器空间,不走服务器流量,文件直链下载。流量走 CloudFlare ,网速由 CloudFlare 决定。所以不用担心Google无法访问的困恼。

项目介绍

  • 演示地址: https://ossdev.node6.workers.dev
  • 项目地址: https://github.com/Achrou/goindex-theme-acrou
  • 可用作个人网盘,图传,文件外链,公共资源下载
  • 可挂载多盘自由切换
  • 提供密码访问验证,也可以自己使用 Cloudflare Access 访问验证
  • 无需服务器,不走服务器流量,可自定义域名。
  • 分页加载,I18n(多国语言)
  • Markdown/Html渲染
  • 视频在线播放(支持外挂字幕vtt)
  • 支持自定义视频播放器(API)
  • 音频在线播放
  • 拥有更快的速度

部署

方案一:利用现成接口快速部署

  1. 打开以下任意网址 https://goindex-quick-install.glitch.me https://goindex-install.herokuapp.com

  2. 授权并获取授权码,然后一键生成代码

  3. 将代码部署到 Cloudflare Workers

方案二:使用自己的API部署,安全,高峰期不容易炸

  1. 使用个人账号登录Google Drive并启用 Google Drive API
  2. 配置 OAuth同意屏幕(如果以前没有配置过API)
  3. 创建一个 OAuth client ID,名称自己填。
  4. 记下 客户端ID客户端密钥
  5. 下载 rclone,以获取 refresh_token 参数。注意:获取Google Drive返回的token需要全局梯子
  6. 解压,CDM 进入解压目录,运行rclone config
  1
  2D:\rclone>rclone config  #配置
  32019/09/28 13:40:25 NOTICE: Config file "C:\\Users\\moeelf\\.config\\rclone\\rclone.conf" not found - using defaults
  4No remotes found - make a new one
  5n) New remote
  6s) Set configuration password
  7q) Quit config
  8n/s/q> n  #新建远程
  9name> gd  #名称随意
 10Type of storage to configure.
 11Enter a string value. Press Enter for the default ("").
 12Choose a number from below, or type in your own value
 13 1 / 1Fichier
 14   \ "fichier"
 15 2 / Alias for an existing remote
 16   \ "alias"
 17 3 / Amazon Drive
 18   \ "amazon cloud drive"
 19 4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc)
 20   \ "s3"
 21 5 / Backblaze B2
 22   \ "b2"
 23 6 / Box
 24   \ "box"
 25 7 / Cache a remote
 26   \ "cache"
 27 8 / Dropbox
 28   \ "dropbox"
 29 9 / Encrypt/Decrypt a remote
 30   \ "crypt"
 3110 / FTP Connection
 32   \ "ftp"
 3311 / Google Cloud Storage (this is not Google Drive)
 34   \ "google cloud storage"
 3512 / Google Drive
 36   \ "drive"
 3713 / Google Photos
 38   \ "google photos"
 3914 / Hubic
 40   \ "hubic"
 4115 / JottaCloud
 42   \ "jottacloud"
 4316 / Koofr
 44   \ "koofr"
 4517 / Local Disk
 46   \ "local"
 4718 / Mega
 48   \ "mega"
 4919 / Microsoft Azure Blob Storage
 50   \ "azureblob"
 5120 / Microsoft OneDrive
 52   \ "onedrive"
 5321 / OpenDrive
 54   \ "opendrive"
 5522 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
 56   \ "swift"
 5723 / Pcloud
 58   \ "pcloud"
 5924 / Put.io
 60   \ "putio"
 6125 / QingCloud Object Storage
 62   \ "qingstor"
 6326 / SSH/SFTP Connection
 64   \ "sftp"
 6527 / Union merges the contents of several remotes
 66   \ "union"
 6728 / Webdav
 68   \ "webdav"
 6929 / Yandex Disk
 70   \ "yandex"
 7130 / http Connection
 72   \ "http"
 7331 / premiumize.me
 74   \ "premiumizeme"
 75Storage> 12  #选择Google Drive
 76** See help for drive backend at: https://rclone.org/drive/ **
 77 
 78Google Application Client Id
 79Setting your own is recommended.
 80See https://rclone.org/drive/#making-your-own-client-id for how to create your own.
 81If you leave this blank, it will use an internal key which is low performance.
 82Enter a string value. Press Enter for the default ("").
 83client_id> 371010059610-obu091on8hd4a272p0rtsdglrgu1gqek.apps.googleusercontent.com  #客户端ID
 84Google Application Client Secret
 85Setting your own is recommended.
 86Enter a string value. Press Enter for the default ("").
 87client_secret> aaaxPiQk2tWfDDF0SwsWdR  #客户端密钥
 88Scope that rclone should use when requesting access from drive.
 89Enter a string value. Press Enter for the default ("").
 90Choose a number from below, or type in your own value
 91 1 / Full access all files, excluding Application Data Folder.
 92   \ "drive"
 93 2 / Read-only access to file metadata and file contents.
 94   \ "drive.readonly"
 95   / Access to files created by rclone only.
 96 3 | These are visible in the drive website.
 97   | File authorization is revoked when the user deauthorizes the app.
 98   \ "drive.file"
 99   / Allows read and write access to the Application Data folder.
100 4 | This is not visible in the drive website.
101   \ "drive.appfolder"
102   / Allows read-only access to file metadata but
103 5 | does not allow any access to read or download file content.
104   \ "drive.metadata.readonly"
105scope> 1  #选择所有权限
106ID of the root folder
107Leave blank normally.
108Fill in to access "Computers" folders. (see docs).
109Enter a string value. Press Enter for the default ("").
110root_folder_id>  #回车
111Service Account Credentials JSON file path
112Leave blank normally.
113Needed only if you want use SA instead of interactive login.
114Enter a string value. Press Enter for the default ("").
115service_account_file>
116Edit advanced config? (y/n)
117y) Yes
118n) No
119y/n> n  #选择No
120Remote config
121Use auto config?
122 * Say Y if not sure
123 * Say N if you are working on a remote or headless machine
124y) Yes
125n) No
126y/n> y  #选择Yes
127If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
128Log in and authorize rclone for access
129Waiting for code...
130Got code
131Configure this as a team drive?
132y) Yes
133n) No
134y/n> n  #选择No
135--------------------
136[gd]
137type = drive
138client_id = 111110059610-obu091on8hd4a272p0rtsdgjllk987jh.apps.googleusercontent.com
139client_secret = aaaacxPiQk2tWfDDFfdroiERs
140scope = drive
141token = {"access_token":"op29.Il-RB9LgOdjRYsgoxNzwDNHvDpqtkVuSmJNWfar3snSg3TI8UzjjLc0kxmTgPTcIUNnwzDRE4ggtU8RxiA32Yc3D_n4dJLZWGfwZOVc6im5Av22DNaaaaa","token_type":"Bearer","refresh_token":"1/9TYT5PCB5h1eMGhEq6uYYPy79aaaaa3ZIv0JGYO52Wu0AU","expiry":"2019-09-28T14:41:18.8994441+08:00"}
142--------------------
143y) Yes this is OK
144e) Edit this remote
145d) Delete this remote
146y/e/d> y  #选择Yes this is OK
147Current remotes:
148 
149Name                 Type
150====                 ====
151gd                   drive
152 
153e) Edit existing remote
154n) New remote
155d) Delete remote
156r) Rename remote
157c) Copy remote
158s) Set configuration password
159q) Quit config
160e/n/d/r/c/s/q> q  #保存并退出
161

7、下载修改 index.js ,将从第4步获得的 client_id,client_secret,以及上一步获取的 refresh_token 按指定位置填入。其他选项看说明自行修改。

8、将修改后代码复制 到 CloudFlare Workers 部署。

版权

评论