好像山雨欲来。
[ol]#!/bin/bash
# 设置GitHub用户名和仓库名
username="MetaCubeX"
repo="Clash.Meta"
tag="Prerelease-Alpha" # 指定的标签名
# 获取指定标签下的release信息
releases_json=$(curl -s "https://api.github.com/repos/$username/$repo/releases/tags/$tag")
# 解析JSON数据,提取下载链接
download_urls=$(echo "$releases_json" | grep -o "browser_download_url": "[^"]*" | sed 's/browser_download_url": "//')
# 循环下载每个文件
for download_url in $download_urls; do
# 提取文件名
file_name=$(basename "$download_url")
# 下载文件
curl -LO "$download_url"
echo "Downloaded: $file_name"
done
[/ol]复制代码