Skip to content

Commit

Permalink
[fix] 修复pushUrl未配置相关Secrets报错
Browse files Browse the repository at this point in the history
之前的修复版本未考虑充分,这次从yml中进行空值判断
  • Loading branch information
ghlerrix committed Sep 2, 2023
1 parent 21f92b5 commit 9aea913
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pushUrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

def parse_stiemap(site):
site = f'{site}/sitemap.xml'
print('解析站点地图中,请稍后……')
try:
result = requests.get(site)
big = re.findall('<loc>(.*?)</loc>', result.content.decode('utf-8'), re.S)
Expand Down Expand Up @@ -86,9 +85,11 @@ def push_to_baidu(site, urls, token):
urls = random.sample(urls, QUOTA)
# 推送bing
if args.bing_api_key:
print('正在推送至必应,请稍后……')
push_to_bing(args.url, urls, args.bing_api_key)
# 推送百度
if args.baidu_token:
print('正在推送至百度,请稍后……')
push_to_baidu(args.url, urls, args.baidu_token)
else:
print('请前往 Github Action Secrets 配置 URL')
Expand Down

0 comments on commit 9aea913

Please sign in to comment.