File tree Expand file tree Collapse file tree 4 files changed +3
-15
lines changed
Expand file tree Collapse file tree 4 files changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,7 @@ pip install justoneapi
3535``` python
3636from justoneapi.client import JustOneAPIClient
3737
38- # By default, the client uses the "cn" (Mainland China) environment.
3938client = 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
4541result, data, message = client.douyin.get_video_detail_v2(video_id = " 7428906452091145483" )
Original file line number Diff line number Diff line change @@ -35,10 +35,7 @@ pip install justoneapi
3535``` python
3636from justoneapi.client import JustOneAPIClient
3737
38- # 默认使用 “cn”(中国大陆)环境
3938client = JustOneAPIClient(token = " your_token" )
40- # 若您位于中国大陆以外地区,访问速度较慢,可切换至 “global” 环境以获得更佳性能:
41- # client = JustOneAPIClient(token="your_token", env="global")
4239
4340# 示例:获取抖音视频详情
4441result, data, message = client.douyin.get_video_detail_v2(video_id = " 7428906452091145483" )
Original file line number Diff line number Diff line change 1313
1414
1515class 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 )
Original file line number Diff line number Diff line change 1- BASE_URL_CN = "http://localhost:8008"
21BASE_URL_GLOBAL = "https://api.justoneapi.com"
You can’t perform that action at this time.
0 commit comments