Skip to content

Commit 21b5379

Browse files
author
Anonymous Committer
committed
refactor: remove environment-specific configurations and default to global API endpoint
1 parent 497ddd8 commit 21b5379

File tree

4 files changed

+3
-15
lines changed

4 files changed

+3
-15
lines changed

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ pip install justoneapi
3535
```python
3636
from justoneapi.client import JustOneAPIClient
3737

38-
# By default, the client uses the "cn" (Mainland China) environment.
3938
client = JustOneAPIClient(token="your_token")
40-
# If you are located outside Mainland China and experience slow responses,
41-
# you can switch to the "global" environment for better performance:
42-
# client = JustOneAPIClient(token="your_token", env="global")
4339

4440
# Example: Get Douyin Video detail
4541
result, data, message = client.douyin.get_video_detail_v2(video_id="7428906452091145483")

README.zh-CN.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ pip install justoneapi
3535
```python
3636
from justoneapi.client import JustOneAPIClient
3737

38-
# 默认使用 “cn”(中国大陆)环境
3938
client = JustOneAPIClient(token="your_token")
40-
# 若您位于中国大陆以外地区,访问速度较慢,可切换至 “global” 环境以获得更佳性能:
41-
# client = JustOneAPIClient(token="your_token", env="global")
4239

4340
# 示例:获取抖音视频详情
4441
result, data, message = client.douyin.get_video_detail_v2(video_id="7428906452091145483")

justoneapi/client.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,12 @@
1313

1414

1515
class JustOneAPIClient:
16-
def __init__(self, token: str, env: str = "cn"):
16+
def __init__(self, token: str):
1717
if not token:
1818
raise ValueError("Token is required. Please contact us to obtain one.")
1919
self.token = token
20-
if env == "cn":
21-
self.base_url = config.BASE_URL_CN
22-
elif env == "global":
23-
self.base_url = config.BASE_URL_GLOBAL
24-
else:
25-
raise ValueError("env must be 'cn' or 'global'.")
20+
self.base_url = config.BASE_URL_GLOBAL
21+
2622
self.user = UserAPI(self.token, self.base_url)
2723
self.taobao = TaobaoAPI(self.token, self.base_url)
2824
self.xiaohongshu = XiaohongshuAPI(self.token, self.base_url)

justoneapi/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
BASE_URL_CN = "http://localhost:8008"
21
BASE_URL_GLOBAL = "https://api.justoneapi.com"

0 commit comments

Comments
 (0)