Update RefreshCDN.py
This commit is contained in:
1 parent
ef3597ca47
commit
3fd9f8b85c
1 file changed
+11
-3
+11
-3
@@ -15,8 +15,11 @@ def dogecloud_api(api_path, data={}, json_mode=False):
|
|||||||
|
|
||||||
:return dict: 返回的数据。
|
:return dict: 返回的数据。
|
||||||
"""
|
"""
|
||||||
access_key = '4fa23701981899fb' # 替换为自己的 AccessKey
|
access_key = os.environ.get('DOGECLOUD_ACCESS_KEY') # 从环境变量获取 AccessKey
|
||||||
secret_key = 'feea91f5781378c4e7f16da1632fc7fd' # 替换为自己的 SecretKey
|
secret_key = os.environ.get('DOGECLOUD_SECRET_KEY') # 从环境变量获取 SecretKey
|
||||||
|
|
||||||
|
if not access_key or not secret_key:
|
||||||
|
raise ValueError("Access Key or Secret Key is not set in environment variables.")
|
||||||
|
|
||||||
body = ''
|
body = ''
|
||||||
mime = ''
|
mime = ''
|
||||||
@@ -38,7 +41,12 @@ def dogecloud_api(api_path, data={}, json_mode=False):
|
|||||||
})
|
})
|
||||||
return response.json()
|
return response.json()
|
||||||
|
|
||||||
url_list = ['https://usj.cc/'] # 替换为你的博客域名
|
# 从环境变量中获取 URL 列表,使用逗号分隔
|
||||||
|
url_list_env = os.environ.get('CDN_URL_LIST')
|
||||||
|
if not url_list_env:
|
||||||
|
raise ValueError("CDN_URL_LIST is not set in environment variables.")
|
||||||
|
|
||||||
|
url_list = url_list_env.split(',')
|
||||||
|
|
||||||
api = dogecloud_api('/cdn/refresh/add.json', {
|
api = dogecloud_api('/cdn/refresh/add.json', {
|
||||||
'rtype': 'path',
|
'rtype': 'path',
|
||||||
|
|||||||
Reference in new issue
Block a user