-
-
Save caarlos0/1541635 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### | |
feedurl='' #url do feed do teu tracker | |
series=("American.Horror.Story" "The.X.Factor") #aqui uma array com as series | |
dir='' #diretorio onde o teu cliente de torrent esta escutando | |
## | |
mkdir -p /tmp/torresmos/ | |
cd /tmp/torresmos | |
wget $feedurl -O feed.xml -o /dev/null; | |
grep \<link\> feed.xml > tmp.xml | |
mv tmp.xml feed.xml | |
sed -i '1,2d' feed.xml;sed -i 's/<link>//g' feed.xml;sed -i 's/<\/link>//g' feed.xml; | |
for i in $series | |
do | |
grep $series[$i] feed.xml > tmp.xml | |
done | |
mv tmp.xml feed.xml | |
for i in $(cat feed.xml) | |
do | |
eos=${#i}-46 | |
outputfile=${i:0:$eos} | |
#here will be gambiarras, unica maneira que achei de resolver | |
echo $outputfile > name.tmp | |
sed -i 's/://g' name.tmp | |
sed -i 's/\///g' name.tmp | |
file=$(cat name.tmp) | |
wget $i -O $dir$file -o /dev/null | |
done | |
rm -rf /tmp/torresmos/ | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment