Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Commit 66e17d2

Browse files
authored
mod: update Dropbox mount parameter guide (#64)
更新了dropbox的挂载参数的相关教程
2 parents a905cb4 + b347d35 commit 66e17d2

File tree

11 files changed

+122
-46
lines changed

11 files changed

+122
-46
lines changed
26.3 KB
Loading
42 KB
Loading
15.5 KB
Loading
45.3 KB
Loading
20.3 KB
Loading
18.5 KB
Loading
Binary file not shown.
Binary file not shown.
Binary file not shown.

docs/guide/drivers/dropbox.md

Lines changed: 61 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,67 @@ Dropbox Official:https://www.dropbox.com/
2525

2626
## **Get refresh token**
2727

28-
Go to:**https://alist.example.com/tool/dropbox/request.html**
29-
30-
- There are two ways, one is provided directly using OpenList, and the other is to create a new application by yourself
31-
- The method of getting as follows (Recommend the first type^{right}^Because the OpenList provided can no longer create new users)
32-
- When using the self-built `client ID` and `secret key` on the right, remember to authorize^{the_third_picture}^
33-
34-
<div class="image-preview">
35-
<img src="/img/drivers/dropbox/dropbox-1.png" alt="Use OpenList default to get token" title="Use OpenList default to get token"/>
36-
<img src="/img/drivers/dropbox/dropbox-2.png" alt="Create your own new application to obtain the client to get token" title="Create your own new application to obtain the client to get token"/>
37-
<img src="/img/drivers/dropbox/dropbox-2-2.png" alt="Create your own new application to obtain the client to get token" title="Create your own new application to obtain the client to get token"/>
38-
</div>
39-
40-
41-
42-
- If you use your own new applications, you need to fill in the `client id` and the `client secret key`
43-
44-
- The method is shown in the right side of the example above(Create an application link:**https://www.dropbox.com/developers/apps**)
45-
46-
- Redirect URLs:**https://alist.example.com/tool/dropbox/callback**
47-
48-
Reference link: [**Click to view**](https://github.com/alist-org/alist/commit/cfee536b96f38e5ba3f3575fab4e89f6c0e1bc5b#commitcomment-119688700)
49-
50-
28+
- The steps are as follows:
29+
- If you create your own `Client ID` and `Secret`, remember to authorize them.
30+
- First, [click here](https://www.dropbox.com/developers/apps?_tk=pilot_lp&_ad=topbar4&_camp=myapps) to enter the Dropbox app management page and click "Create App".
31+
![Enter the page](/img/drivers/dropbox/1.png)
32+
- After entering the app, configure the app type as shown below.
33+
![App type](/img/drivers/dropbox/2.png)
34+
- You can get the id and secret in the red box: the upper one is the id, the lower one is the secret.
35+
![Parameter location](/img/drivers/dropbox/6.png)
36+
- Configure the callback URL. If you are strict about permissions and do not want to use an external callback address, you can set a local address here, or use the one outside the red box.
37+
![Callback URL](/img/drivers/dropbox/3.png)
38+
- Finally, go to the permissions configuration page to set the app's permissions.
39+
![Permission configuration](/img/drivers/dropbox/4.png)
40+
- [Click here](https://api.oplist.org/) to enter the token acquisition tool. Select Dropbox, fill in your id and secret, and after authorization you can get the refresh token.
41+
- In the Openlist configuration page, enter the refresh token, id, and secret to use. Note that the refresh token is about 40-50 characters long.
42+
![Openlist configuration](/img/drivers/dropbox/5.png)
43+
- If you are highly privacy-conscious, Dropbox supports local callback. You can use the following script provided by GPT to quickly implement it, communicating only with Dropbox servers.
44+
- **Note: Since the callback address is local and you have not set up a real local callback server, please manually copy the authorization code from the browser address bar.**
45+
- **Please resolve Python environment issues yourself, or use the callback server provided above.**
46+
```python
47+
import requests
48+
import webbrowser
49+
50+
# Please replace with your own Dropbox App information
51+
CLIENT_ID = 'your_app_key'
52+
CLIENT_SECRET = 'your_app_secret'
53+
REDIRECT_URI = 'http://localhost:114514'
54+
55+
# Step 1: Get authorization code
56+
auth_url = (
57+
f"https://www.dropbox.com/oauth2/authorize"
58+
f"?client_id={CLIENT_ID}"
59+
f"&redirect_uri={REDIRECT_URI}"
60+
f"&response_type=code"
61+
f"&token_access_type=offline" # Required: key parameter to get refresh_token
62+
)
63+
64+
print("👉 Please visit the following link to authorize:\n")
65+
print(auth_url)
66+
webbrowser.open(auth_url)
67+
68+
auth_code = input("\n✅ After authorization, paste the code after ?code= in the redirected URL here:\n> ").strip()
69+
70+
# Step 2: Exchange for access_token + refresh_token
71+
token_url = "https://api.dropboxapi.com/oauth2/token"
72+
data = {
73+
'code': auth_code,
74+
'grant_type': 'authorization_code',
75+
'client_id': CLIENT_ID,
76+
'client_secret': CLIENT_SECRET,
77+
'redirect_uri': REDIRECT_URI
78+
}
79+
80+
response = requests.post(token_url, data=data)
81+
response.raise_for_status()
82+
83+
tokens = response.json()
84+
85+
# ✅ Only output the refresh token
86+
print("\n🎉 Success! Your Dropbox refresh_token is:\n")
87+
print(tokens.get("refresh_token"))
88+
```
5189

5290
## **Root folder file_id**
5391

0 commit comments

Comments
 (0)