Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
272 changes: 259 additions & 13 deletions pages/guide/drivers/google_drive.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,101 @@ categories:
- drivers
---

::: en

Official website: https://drive.google.com/

- Supports Team Drive (Fill in the Team Drive directory ID for the Root Folder ID)

:::
::: zh-CN

官网:https://drive.google.com/

- 支持团队盘(根目录ID填写团队盘的目录ID)

## 1. 必要条件
:::

## 1. Prerequisites { lang="en" }

## 1. 必要条件 { lang="zh-CN" }

::: en

1. The machine hosting OpenList must be able to connect to Google Drive.

2. You must enable the Google Drive API service. For details, please refer to [Enable Google Drive API](#21-enable-google-drive-api).

> Detailed steps can be found in [Google Workspace > Google Drive > Quickstart](https://developers.google.com/workspace/drive/api/quickstart/js)

:::
::: zh-CN

1. 搭建 OpenList 服务的机器必须能够连接到 Google 网盘。

2. 必须启用 Google 云盘 API 服务,具体启用方式请参考 [启用 Google Drive API](#21-启用-google-drive-api-的-api)。

> 详细步骤可参考 [Google Workspace > Google Drive > 快速入门指南](https://developers.google.com/workspace/drive/api/quickstart/js)

## 2. 准备接入
:::

## 2. Preparation { lang="en" }

## 2. 准备接入 { lang="zh-CN" }

### 2.1. Enable Google Drive API { lang="en" }

### 2.1. 启用 Google Drive API 的 API { lang="zh-CN" }

::: en

1. Find the `Enable the API` button on the [Guide Page](https://developers.google.com/workspace/drive/api/quickstart/js), click to enter the quick enable interface, click Next and Confirm to complete the activation.

### 2.1. 启用 Google Drive API 的 API
2. You can also visit the [Google Drive API Management Interface](https://console.cloud.google.com/apis/library/drive.googleapis.com), find the `Enable` button at the top, and click it to wait for the enablement to complete.

3. `Quotas and System Limits Management` (Optional): Switch to the `Quotas` tab and set appropriate quotas and limits according to your usage and needs.

:::
::: zh-CN

1. 在[指南页面](https://developers.google.com/workspace/drive/api/quickstart/js)中找到`启用API`按钮,点击进入快捷开启界面,点击下一步以及确认后,即可完成开启。

2. 也可以访问[谷歌云盘API功能管理界面](https://console.cloud.google.com/apis/library/drive.googleapis.com),在上方找到`启用`按钮,点击后等待启用完成。

3. `配额和系统限制管理`(可选):切换到`配额和系统限制`选项卡,根据你的使用情况和需求,设置合适的配额和限制。

### 2.2. 创建 OAuth 客户端(可选,如果使用OpenList/公益服务器/自建服务器,则不用创建)
:::

### 2.2. Create OAuth Client (Optional) { lang="en" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

中文大量被省略


### 2.2. 创建 OAuth 客户端(可选,如果使用OpenList/公益服务器/自建服务器,则不用创建) { lang="zh-CN" }

::: en

**If you are using OpenList, a public server, or a self-hosted server with built-in keys, you do not need to create this.**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public server并不能准确说明公益服务器的性质


1. In the [Credentials Interface](https://console.cloud.google.com/apis/credentials?hl=en), click the `Create Credentials` drop-down menu, select and click `OAuth client ID`.

![google-ouath-00](/img/drivers/google/google-ouath-00-en.png)

2. In the pop-up window, select `Web application` and fill in the application name.

3. In `Authorized redirect URIs`, fill in `https://api.oplist.org/googleui/callback`. If it is a self-built or public service, please fill in the corresponding domain name, such as `https://your-domain.com/googleui/callback`.

4. Click the `Create` button to complete the creation of the OAuth client. Note: Please copy and save the `Client ID` and `Client Secret`, which will be needed later.

![google-ouath-00](/img/drivers/google/google-ouath-01-en.png)

5. Add yourself to the test users. Find the `OAuth consent screen` menu on the left, enter it, find the `+ Add Users` button under `Test users`, click it, enter your Google account email address, and click Add.

![google-ouath-02](/img/drivers/google/google-ouath-02-en.png)

6. After testing, you can publish the application. Find the `OAuth consent screen` menu on the left, enter it, find the `Publish App` button under `Publishing status`, click it, and confirm the publication to complete the application publication.

![google-ouath-03](/img/drivers/google/google-ouath-03-en.png)

:::
::: zh-CN

1. 在[凭据界面](https://console.cloud.google.com/apis/credentials?hl=zh-cn)中,点击`创建凭据`下拉菜单,选择和点击`OAuth 客户端 ID`

Expand All @@ -55,7 +127,50 @@ categories:

![google-ouath-03](/img/drivers/google/google-ouath-03.png)

### 2.3. 获取`访问密钥`和`刷新密钥`
:::

### 2.3. Get `Access Token` and `Refresh Token` { lang="en" }

### 2.3. 获取`访问密钥`和`刷新密钥` { lang="zh-CN" }

::: en

1. Open [OpenList Google Auth Page](https://api.oplist.org/) **⚠️ If using a public server/self-hosted server, please visit the public server/self-hosted server address.**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

缺少定冠词


2. Select `GoogleDrive Login` in the drop-down box on the page.

![google-00-l](/img/drivers/google/google-00-l.png#light)
![google-00-d](/img/drivers/google/google-00-d.png#dark)

3. If you created an OAuth Client ID in the previous steps, please enter the `Client ID` and `Client Secret` you just created in the input box below.

![google-01-01-l](/img/drivers/google/google-01-01-l.png#light)
![google-01-01-d](/img/drivers/google/google-01-01-d.png#dark)

Otherwise, check ☑️ Use the API provided by OpenList. **⚠️ If using a public server/self-hosted server, this uses the built-in Client ID and Client Secret of the public/self-hosted server.**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不适合用this uses


![google-01-02-l](/img/drivers/google/google-01-02-l.png#light)
![google-01-02-d](/img/drivers/google/google-01-02-d.png#dark)

4. Click the `Get Authorization` button. The system will jump to the Google authorization page. Log in to your Google account and authorize OpenList to access your Google Drive.

![google-02](/img/drivers/google/google-02.png)

5. If the prompt `This app is not verified by Google` appears, please click `Advanced` and then click `Go to oplist.org (unsafe)` to continue. (If it is a public server/self-hosted server, the domain name here is subject to the actual public service domain name, please identify it carefully).

![google-03](/img/drivers/google/google-03.png)

6. Please pay attention to the permission information on the authorization page (in the red box below), and ensure that it **only** accesses your **Google Drive files**. If you find that the permission is not just to access **Google Drive** in the public service, please raise an issue at [openlistteam/docs/issues](https://github.com/openlistteam/docs/issues).

![google-04](/img/drivers/google/google-04.png)

7. After successful authorization, the system will return a `Refresh Token` and `Access Token`. Please copy and save the token for use in subsequent configurations.

![google-05-l](/img/drivers/google/google-05-l.png#light)
![google-05-d](/img/drivers/google/google-05-d.png#dark)

:::
::: zh-CN

1. 打开[OpenList Google 授权页面](https://api.oplist.org/) **⚠️如果使用公益服务器/自建服务器,请访问公益服务器/自建服务器**

Expand Down Expand Up @@ -91,17 +206,78 @@ categories:
![google-05-l](/img/drivers/google/google-05-l.png#light)
![google-05-d](/img/drivers/google/google-05-d.png#dark)

## 3. 在 OpenList 中添加谷歌云盘
:::

## 3. Add Google Drive in OpenList { lang="en" }

## 3. 在 OpenList 中添加谷歌云盘 { lang="zh-CN" }

### 3.1. Configuration { lang="en" }
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Inconsistent capitalization in section headings. "Configuration" should be "Configuration Instructions" or "Configuration Details" to better match the Chinese "配置说明" which means "Configuration Instructions/Explanation".

Alternatively, if keeping it simple as "Configuration", then it's acceptable, but there's a mismatch in detail level between the English and Chinese headings.

Suggested change
### 3.1. Configuration { lang="en" }
### 3.1. Configuration Instructions { lang="en" }

Copilot uses AI. Check for mistakes.

### 3.1. 配置说明 { lang="zh-CN" }

### 3.1. 配置说明
#### 3.1.1. Root Folder ID { lang="en" }

#### 3.1.1. **根文件夹 ID**
#### 3.1.1. **根文件夹 ID** { lang="zh-CN" }

::: en

Similar to Aliyun Drive, it is the last string of the official website URL, such as:
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using "Alibaba Cloud Drive" instead of "Aliyun Drive" for consistency with official English branding. "Aliyun" is the Chinese brand name, while "Alibaba Cloud" is the official English name.

Suggested change
Similar to Aliyun Drive, it is the last string of the official website URL, such as:
Similar to Alibaba Cloud Drive, it is the last string of the official website URL, such as:

Copilot uses AI. Check for mistakes.

![google](/img/drivers/google/googledrive-dir.png)

:::
::: zh-CN

与阿里云盘类似,官网 URL 的最后一个字符串,如:

![google](/img/drivers/google/googledrive-dir.png)

### 3.2. 开始添加
:::

### 3.2. Start Adding { lang="en" }

### 3.2. 开始添加 { lang="zh-CN" }

::: en

1. Open the OpenList management interface and click `Storage` in the left menu.

2. On the storage list page, click the `Add Storage` button in the upper right corner.

3. Select the driver as `Google Drive`.

![google-06-l](/img/drivers/google/google-06-l-en.png#light)
![google-06-d](/img/drivers/google/google-06-d-en.png#dark)

4. Enter the mount path, such as: `google-drive`.

5. Fill in the `Root folder ID` obtained above. If you use the root directory, please fill in `root`.

6. Fill in the `Refresh Token` obtained above (if not obtained, please refer to [Preparation](#_2-preparation)).

7. If you use the OAuth Client ID and Secret provided by `OpenList (or Public Server/Self-hosted Server)`, please configure according to `7.1` and `7.2`.

7.1. Check `Use online api`, indicating to use the online API provided by OpenList.
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent naming: The checkbox label uses "Use online api" (lowercase) but should be "Use online API" (uppercase) to match proper acronym formatting and the Chinese version "使用在线api".

Copilot uses AI. Check for mistakes.

7.2. Fill in the API URL address as `https://api.oplist.org/googleui/renewapi`. If it is `Public Server/Self-hosted Server`, please fill in the corresponding server address.

![google-07-d](/img/drivers/google/google-07-d.png#dark)
![google-07-l](/img/drivers/google/google-07-l.png#light)

8. If you use the OAuth Client ID and Secret created by yourself, please configure according to `8.1` and `8.2`.

8.1. Uncheck `Use online api`, indicating to use the self-built OAuth Client ID and Secret.

8.2. Fill in your `OAuth Client ID` in `Client ID` and your `OAuth Client Secret` in `Client Secret`.

![google-08-l](/img/drivers/google/google-08-l-en.png#light)
![google-08-d](/img/drivers/google/google-08-d-en.png#dark)

9. Click the `Add` button to complete the addition of Google Drive.

:::
::: zh-CN

1. 打开 OpenList 的管理界面,点击左侧菜单中的`存储`。

Expand Down Expand Up @@ -138,9 +314,28 @@ categories:

9. 点击`添加`按钮,完成谷歌云盘的添加。

## 4. 关于`Use online api`选项的说明
:::

## 4. About `Use online api` option { lang="en" }
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent naming in heading: "Use online api" should be "Use online API" to match proper acronym formatting.

Suggested change
## 4. About `Use online api` option { lang="en" }
## 4. About `Use online API` option { lang="en" }

Copilot uses AI. Check for mistakes.

## 4. 关于`Use online api`选项的说明 { lang="zh-CN" }

### 4.1. AccessToken refresh method with own keys { lang="en" }
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The English heading should be updated for clarity and grammatical correctness. Consider: "### 4.1. Access Token refresh method with own keys" → "### 4.1. Refreshing Access Token with Your Own Keys" for better readability and grammar.

Suggested change
### 4.1. AccessToken refresh method with own keys { lang="en" }
### 4.1. Refreshing Access Token with Your Own Keys { lang="en" }

Copilot uses AI. Check for mistakes.

### 4.1. 自身有密钥的情况下,AccessToken刷新的方式 { lang="zh-CN" }
Comment on lines +323 to +325
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent capitalization: "AccessToken" should have a space - "Access Token" - for readability. This also applies to lines 351, 359, and throughout the document where the term appears.

Suggested change
### 4.1. AccessToken refresh method with own keys { lang="en" }
### 4.1. 自身有密钥的情况下,AccessToken刷新的方式 { lang="zh-CN" }
### 4.1. Access Token refresh method with own keys { lang="en" }
### 4.1. 自身有密钥的情况下,Access Token刷新的方式 { lang="zh-CN" }

Copilot uses AI. Check for mistakes.

::: en

```mermaid
sequenceDiagram
participant OpenList
participant GoogleDrive
OpenList->>GoogleDrive: Provide refresh token + built-in client ID and secret
GoogleDrive->>OpenList: Return new access token + refresh token
```

### 4.1. 自身有密钥的情况下,AccessToken刷新的方式
:::
::: zh-CN

```mermaid
sequenceDiagram
Expand All @@ -151,7 +346,30 @@ sequenceDiagram

```

### 4.2.自身没有密钥的情况下,AccessToken刷新的方式
:::

### 4.2. AccessToken refresh method without own keys { lang="en" }
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue: "AccessToken" should be "Access Token" with a space.

Suggested change
### 4.2. AccessToken refresh method without own keys { lang="en" }
### 4.2. Access Token refresh method without own keys { lang="en" }

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to line 323, improve the heading grammar: "### 4.2. Access Token refresh method without own keys" → "### 4.2. Refreshing Access Token without Your Own Keys".

Suggested change
### 4.2. AccessToken refresh method without own keys { lang="en" }
### 4.2. Refreshing Access Token without Your Own Keys { lang="en" }

Copilot uses AI. Check for mistakes.

### 4.2.自身没有密钥的情况下,AccessToken刷新的方式 { lang="zh-CN" }
Comment on lines +351 to +353
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the space before the opening brace. This pattern repeats throughout the file for all language-attributed headings. Apply the fix consistently: {lang="en"} instead of { lang="en" } and {lang="zh-CN"} instead of { lang="zh-CN" }.

Suggested change
### 4.2. AccessToken refresh method without own keys { lang="en" }
### 4.2.自身没有密钥的情况下,AccessToken刷新的方式 { lang="zh-CN" }
### 4.2. AccessToken refresh method without own keys {lang="en"}
### 4.2.自身没有密钥的情况下,AccessToken刷新的方式 {lang="zh-CN"}

Copilot uses AI. Check for mistakes.

::: en

```mermaid
---
title: How to refresh AccessToken via OnlineAPI?
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the same mermaid title: "OnlineAPI" should be "Online API" with a space for consistency.

Suggested change
title: How to refresh AccessToken via OnlineAPI?
title: How to refresh AccessToken via Online API?

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mermaid diagram title: "How to refresh AccessToken via OnlineAPI?" should use spaces - "How to refresh Access Token via Online API?".

Suggested change
title: How to refresh AccessToken via OnlineAPI?
title: How to refresh Access Token via Online API?

Copilot uses AI. Check for mistakes.
---
sequenceDiagram
participant OpenList
participant OnlineAPI
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the mermaid diagram participant label, "OnlineAPI" should be "Online API" with a space for consistency with the rest of the documentation.

Copilot uses AI. Check for mistakes.
participant GoogleDrive
OpenList->>OnlineAPI: Provide refresh token
OnlineAPI->>GoogleDrive: Provide refresh token + built-in client ID and secret
GoogleDrive->>OnlineAPI: Return new access token + refresh token
OnlineAPI->>OpenList: Return new access token + refresh token
```

:::
::: zh-CN

```mermaid
---
Expand All @@ -167,7 +385,33 @@ sequenceDiagram
OnlineAPI->>OpenList: 返回新的访问令牌+刷新令牌
```

## 5. 默认使用的哪种下载方式?
:::

## 5. The default download method used { lang="en" }

## 5. 默认使用的哪种下载方式? { lang="zh-CN" }

::: en

```mermaid
---
title: Which download method is used by default?
---
flowchart TB
style c1 fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff
style a2 fill:#ff7575,stroke:#333,stroke-width:4px
subgraph ide1 [ ]
c1
end
c1[Local Proxy]:::someclass==Default===>a2[User Device]
classDef someclass fill:#f96
b1[Proxy URL]-.Alternative.->a2[User Device]
click b1 "../drivers/common.html#webdav-policy"
click c1 "../drivers/common.html#webdav-policy"
```

:::
::: zh-CN

```mermaid
---
Expand All @@ -185,3 +429,5 @@ flowchart TB
click b1 "../drivers/common.html#webdav-策略"
click c1 "../drivers/common.html#webdav-策略"
```

:::
Binary file added public/img/drivers/google/google-06-d-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/drivers/google/google-06-l-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/drivers/google/google-08-d-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/drivers/google/google-08-l-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/drivers/google/google-ouath-00-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/drivers/google/google-ouath-01-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/drivers/google/google-ouath-02-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/drivers/google/google-ouath-03-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.