下载青云志电视剧bt种子

Aug 17, 2016



#!/bin/bash
wget -O search_result.dat http://www.mp4ba.com/search.php\?keyword\=云志
res=$(cat ./search_result.dat | grep -e "EP\d\d\.2016" -e "show\.php" )
ret=()
for s in $res
do
    if [[ $s =~ "EP" ]]; then
        nums=`echo "$s" | tr -d -c '0-9'`
        num=${nums:0:2}
        ret=("${ret[@]}" "$num")
    elif [[ $s =~ "show.php" ]]; then
        num=${s:6:${#s}-7}
        ret=("${ret[@]}" "$num")
    fi
done

for((i=0;i<${#ret[@]};i+=2))
do
    wget -O "${ret[((i+1))]}.dat" http://www.mp4ba.com/${ret[i]}
    torrentDownloadLink=$(cat ./${ret[((i+1))]}.dat | grep "down\.php")
    t1=${torrentDownloadLink/#*href=\"}
    t2=${t1/%\"*}
    if [[ ! -e "qyz_${ret[((i+1))]}.torrent" ]]; then
        wget -O "qyz_${ret[((i+1))]}.torrent" http://www.mp4ba.com/$t2
    fi
done
rm *.dat