GoIndex - 一个无需服务器的Google Drive目录索引方案

简介:GoIndex是一款部署在Cloudflare Workers的Google Drive目录索引小程序。无需服务器,可以直接列出谷歌网盘的所有文件并且可以直接下载其中的文件。


  • 部署在 CloudFlare Workers的小程序。
  • 可以将 Google Drive 文件以目录形式列出,并直连下载。
  • 流量走 CloudFlare ,网速由 CloudFlare 决定。

1、使用个人账号登录Google Drive并启用Google Drive API。传送门
3、创建一个 OAuth client ID(传送门),名称自己填。
5、下载rclone(传送门),以获取refresh_token参数。注意:获取Google Drive返回的token需要全局姿势,建议使用sstap。(这里以windows版的rclone为例)
6、解压,CDM 进入解压目录,运行“rclone config”。(如需查看配置文件位置,执行“rclone config file”即可)

D:\rclone>rclone config  #配置
2019/09/28 13:40:25 NOTICE: Config file "C:\\Users\\ttydy\\.config\\rclone\\rclone.conf" not found - using defaults
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n  #新建远程
name> gd  #名称随意
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
 1 / 1Fichier
   \ "fichier"
 2 / Alias for an existing remote
   \ "alias"
 3 / Amazon Drive
   \ "amazon cloud drive"
 4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc)
   \ "s3"
 5 / Backblaze B2
   \ "b2"
 6 / Box
   \ "box"
 7 / Cache a remote
   \ "cache"
 8 / Dropbox
   \ "dropbox"
 9 / Encrypt/Decrypt a remote
   \ "crypt"
10 / FTP Connection
   \ "ftp"
11 / Google Cloud Storage (this is not Google Drive)
   \ "google cloud storage"
12 / Google Drive
   \ "drive"
13 / Google Photos
   \ "google photos"
14 / Hubic
   \ "hubic"
15 / JottaCloud
   \ "jottacloud"
16 / Koofr
   \ "koofr"
17 / Local Disk
   \ "local"
18 / Mega
   \ "mega"
19 / Microsoft Azure Blob Storage
   \ "azureblob"
20 / Microsoft OneDrive
   \ "onedrive"
21 / OpenDrive
   \ "opendrive"
22 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
   \ "swift"
23 / Pcloud
   \ "pcloud"
24 / Put.io
   \ "putio"
25 / QingCloud Object Storage
   \ "qingstor"
26 / SSH/SFTP Connection
   \ "sftp"
27 / Union merges the contents of several remotes
   \ "union"
28 / Webdav
   \ "webdav"
29 / Yandex Disk
   \ "yandex"
30 / http Connection
   \ "http"
31 / premiumize.me
   \ "premiumizeme"
Storage> 12  #选择Google Drive
** See help for drive backend at: https://rclone.org/drive/ **

Google Application Client Id
Setting your own is recommended.
See https://rclone.org/drive/#making-your-own-client-id for how to create your own.
If you leave this blank, it will use an internal key which is low performance.
Enter a string value. Press Enter for the default ("").
client_id> 371010059610-obu091on8hd4a272p0rtsdglrgu1gqek.apps.googleusercontent.com  #客户端ID
Google Application Client Secret
Setting your own is recommended.
Enter a string value. Press Enter for the default ("").
client_secret> aaaxPiQk2tWfDDF0SwsWdR  #客户端密钥
Scope that rclone should use when requesting access from drive.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
 1 / Full access all files, excluding Application Data Folder.
   \ "drive"
 2 / Read-only access to file metadata and file contents.
   \ "drive.readonly"
   / Access to files created by rclone only.
 3 | These are visible in the drive website.
   | File authorization is revoked when the user deauthorizes the app.
   \ "drive.file"
   / Allows read and write access to the Application Data folder.
 4 | This is not visible in the drive website.
   \ "drive.appfolder"
   / Allows read-only access to file metadata but
 5 | does not allow any access to read or download file content.
   \ "drive.metadata.readonly"
scope> 1  #选择所有权限
ID of the root folder
Leave blank normally.
Fill in to access "Computers" folders. (see docs).
Enter a string value. Press Enter for the default ("").
root_folder_id>  #回车
Service Account Credentials JSON file path
Leave blank normally.
Needed only if you want use SA instead of interactive login.
Enter a string value. Press Enter for the default ("").
Edit advanced config? (y/n)
y) Yes
n) No
y/n> n  #选择No
Remote config
Use auto config?
 * Say Y if not sure
 * Say N if you are working on a remote or headless machine
y) Yes
n) No
y/n> y  #选择Yes
If your browser doesn't open automatically go to the following link:
Log in and authorize rclone for access
Waiting for code...
Got code
Configure this as a team drive?
y) Yes
n) No
y/n> n  #选择No
type = drive
client_id = 111110059610-obu091on8hd4a272p0rtsdglrgu1gqek.apps.googleusercontent.com
client_secret = aaaacxPiQk2tWfDDF0SwsWdR
scope = drive
token = {"access_token":"ya29.Il-RB9LgOdjRYsgoxNzwDNHvDpqtkVuSmJNWfar3snSg3TI8UzjjLc0kxmTgPTcIUNnwzTNVh0eR4AY3zQVIB9C0yPRxiA32Yc3D_n4dJLZWGfwZOVc6im5Av22DNaaaaa","token_type":"Bearer","refresh_token":"1/R5PCB5h1eMGhEq6uYYPy79aaaaa3ZIv0JGYO52Wu0AU","expiry":"2019-09-28T14:41:18.8994441+08:00"}
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y  #选择Yes this is OK
Current remotes:

Name                 Type
====                 ====
gd                   drive

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q  #保存并退出




10、点击Create a Worker新建一个Worker


12、完成后修改左上角的域名,再点击Save and Deploy即可。


3、复制代码 到 CloudFlare 部署。

最后修改:2019 年 09 月 29 日 08 : 14 PM