Skip to content

Instantly share code, notes, and snippets.

@lsongdev
Last active October 12, 2015 09:58
Show Gist options
  • Select an option

  • Save lsongdev/d61c5dec2359a9a324b9 to your computer and use it in GitHub Desktop.

Select an option

Save lsongdev/d61c5dec2359a9a324b9 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# curl -s https://gist.githubusercontent.com/song940/d61c5dec2359a9a324b9/raw/mp4ba.sh | bash
URL="http://www.mp4ba.com"
for i in `seq 71`; do
INDEX_CONTENT=$(curl -s "$URL/index.php?page=$i")
HASH=$(echo $INDEX_CONTENT | grep -o "hash=\w*")
for hash in `echo $HASH`; do
PAGE_CONTENT=$(curl -s "$URL/show.php?$hash")
NAME=$(echo $PAGE_CONTENT | awk 'BEGIN{IGNORECASE=1;FS="<title>|</title>";RS=EOF} {print $2}' | sed -e "s/ - 高清Mp4吧-免费高清电影资源下载 - Powered by Mp4Ba.Com//")
SIZE=$(echo $PAGE_CONTENT | grep -o "文件总大小:\d*\.\d*[G|M]B" | sed -e "s/文件总大小://")
HASH=$(echo $PAGE_CONTENT | grep -o "hash=\w*" | sed -e "s/hash=//")
CATEGIRY=$(echo $PAGE_CONTENT | grep -o "sort_id=\d*\">\S*</a>" | tail -n1 | sed -e "s/sort_id=.*\">//" | sed "s/<\/a>//")
echo "$NAME $SIZE $HASH $CATEGIRY"
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment