Ramzi
June 20th, 2007, 03:36 AM
Well i was watching some clips from http://joox.net and i wanted to download all the videos in a category so i wrote this little bash script to do it for me :) Now i understand it is ugly, i wrote it at 04:00 AM after a few sleepless nights so don't blame me =) Well here it is:
#!/bin/bash
echo -n "Enter category number, the number behind http://joox.net/cat/ : "
read n
wget http://joox.net/cat/$n
grep "<a href\=\"\.\/cat\/[[:digit:]][[:digit:]][[:digit:]]\/id\/" $n > numbers
rm $n
cat numbers | cut -d/ -f5 | cut -d\" -f1 > list
cat numbers | cut -d/ -f5 | tr -d \" > rename
rm numbers
cat list | awk '{for(i=1;i<=NF;i++) print "http://video.stage6.com/" $i "/.divx"}' > download
rm list
wget -N -nd -erobots=off -w5 -i download
rm download
You just enter the number of the category you want downloaded and that's it, it downloads all the videos in the directory where the script is and creates a file named rename that just contains the names of the downloaded files with the names of the videos so you can rename them. If anyone has a better idea for renaming them please tell me.
#!/bin/bash
echo -n "Enter category number, the number behind http://joox.net/cat/ : "
read n
wget http://joox.net/cat/$n
grep "<a href\=\"\.\/cat\/[[:digit:]][[:digit:]][[:digit:]]\/id\/" $n > numbers
rm $n
cat numbers | cut -d/ -f5 | cut -d\" -f1 > list
cat numbers | cut -d/ -f5 | tr -d \" > rename
rm numbers
cat list | awk '{for(i=1;i<=NF;i++) print "http://video.stage6.com/" $i "/.divx"}' > download
rm list
wget -N -nd -erobots=off -w5 -i download
rm download
You just enter the number of the category you want downloaded and that's it, it downloads all the videos in the directory where the script is and creates a file named rename that just contains the names of the downloaded files with the names of the videos so you can rename them. If anyone has a better idea for renaming them please tell me.