Skip to content

Instantly share code, notes, and snippets.

@auselen
Last active October 12, 2015 19:44
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 auselen/8015803e086420d91162 to your computer and use it in GitHub Desktop.
Save auselen/8015803e086420d91162 to your computer and use it in GitHub Desktop.
altyazi.org download script
#!/bin/sh
# tested with BusyBox v1.22.1
if [ "$#" -ne 1 ]; then
echo Usage: $0 http://altyazi.org/sub/s/...html
exit 1
fi
HTML=`curl -s -c cookies.txt $1`
POSTC=`echo $HTML|sed -n 's/.*name="postc" value="\([^"]*\)".*/\1/p'`
ID=`echo $HTML|sed -n 's/.*name="id" value="\([^"]*\)".*/\1/p'`
HEADERS=`curl -s -v -b cookies.txt --data "postc=$POSTC&id=$ID" -o sub.zip http://altyazi.org/indir.php 2>&1`
FILE=`echo $HEADERS|sed -n 's/.*filename="\([^"]*\)".*/\1/p'`
if echo $FILE|grep \.rar; then
unrar x -y -inul sub.zip
else
unzip -q sub.zip
fi
rm sub.zip cookies.txt
mkvname=`basename *.mkv .mkv`
mv *.srt $mkvname.srt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment