Advertisement
Guest User

ScriptConfusion

a guest
Nov 10th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.81 KB | None | 0 0
  1. #!/bin/sh
  2. SearchArtist=$1
  3.  
  4. if [ "$SearchArtist" != "" ]; then
  5.     url=`wget -q -O - -U "Mozilla-lol" "http://www.google.com/search?q=$SearchArtist+wma+OR+mp3+size+%22last+modified%22+%22intitle%3Aindex+of%22+-inurl%3Ahtml+-inurl%3Ahtm+-inurl%3Aphp+-inurl" | perl -e '$mystring = <>; @matches = ($mystring =~ /<a\ href="(.*?)"/g); foreach $x (@matches) {$x =~ s/\/url\?q\=//; $x =~ s/&amp.*//; $x =~ s/\%2520/\%20/g; print $x, "\n"}' | grep -v "search?q" | grep http`
  6.     songlink=`echo "$url" | sed 's/\ /\n/g' | xargs wget -T 4 -t 1 -O - -i - | perl -e '$mystring = <>; @matches = ($mystring =~ /<a\ href="(.*?)"/gi); foreach $x (@matches) {print $x, "\n"}'`
  7.     echo "URLS"
  8.     echo $url | sed 's/\ /\n/g'
  9.     echo ""
  10.     echo $songlink
  11.     echo ""
  12. else
  13.     echo ""
  14.     echo "Please check your usage: ./makemusiclist <artistname>"
  15.     echo ""
  16. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement