Skip to content

Instantly share code, notes, and snippets.

@metaldudu
Created January 25, 2024 00:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metaldudu/81236b7b453d1e703aff644e30f07e90 to your computer and use it in GitHub Desktop.
Save metaldudu/81236b7b453d1e703aff644e30f07e90 to your computer and use it in GitHub Desktop.
check tvshows torrent update
#!/bin/bash
# 剧集种子批量下载
all_urls=(
"https://zoink.ch/torrent/death.and.other.details.s01e01.1080p.web.h264-successfulcrab[EZTVx.to].mkv.torrent"
"https://zoink.ch/torrent/True.Detective.S04E01.1080p.HEVC.x265-MeGusta[EZTVx.to].mkv.torrent"
)
for url in "${all_urls[@]}"; do
if [[ $url =~ (.*[sS][0-9]+[eE])([0-9]+)(.*) ]]; then
prefix=${BASH_REMATCH[1]}
season=${BASH_REMATCH[2]}
suffix=${BASH_REMATCH[3]}
#echo "前缀: $prefix"
#echo "集数: $season"
#echo "后缀: $suffix"
for episode in {01..10}; do
download_url="${prefix}${episode}${suffix}"
filename=$(echo "$download_url" | sed "s|https://zoink.ch/torrent/|$replacement|")
echo "${filename}"
# 检查本地文件是否存在
if [ -e "$filename" ]; then
echo "文件 $filename 已存在,跳过下载."
else
# 如果文件不存在,则下载
echo "正在下载种子: $download_url"
wget "$download_url"
fi
# 休息10秒钟
sleep 8
done
else
echo "URL格式不正确:$url"
fi
done
echo "------ 下载完成 ------"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment