Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (5) </ 1 2 3 4 [5] >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Script for downloading Youtube videos< Next Oldest | Next Newest >
curaga Offline





Group: Members
Posts: 2163
Joined: Feb. 2007
Posted: July 15 2007,07:04 QUOTE

I just used this to get Jeff Buckley's Hallelujah. Still works fine, though this was not on DSL..

--------------
There's no such thing as life. Those mean little jocks invented it ;)
-
Windows is not a virus. A virus does something!
Back to top
Profile PM 
curaga Offline





Group: Members
Posts: 2163
Joined: Feb. 2007
Posted: Sep. 18 2007,18:37 QUOTE

Okay, Youtube changed their video downloading possibilities, in an attempt to prevent downloading their videos. So here's a new ver that can still download :D

Quote
#!/bin/bash
# Script for downloading Youtube videos. Base was from nixcraft.org
# Edited by Curaga for my liking (Added ability for nearly unlimited URLs, help,
# comments, and ability to get urls from args)

case $1 in
-h | *help )
echo "Usage: ${0##*/} url1 url2.. or just ${0##*/} and type the urls"
exit 0 ;;
esac

ripurl="http://youtube.com/get_video.php?"
tmp=`mktemp`
touch $tmp.flv
mkdir -p ~/YouTube;cd ~/YouTube
url="not empty in da beginning"

until [ -z "$url" ]; do
if [ -n "$1" ] && [[ $1 = http://* ]]; then url=$1
elif [ -n "$1" ]; then echo "Not a valid url. http:// required."; exit 1; fi

if [ -z "$1" ]; then read -p "YouTube URL? Press enter to exit. " url; fi
if [ -z "$url" ]; then
rm $tmp
clear; echo -e "\n    Finished."
exit 0; fi

echo
echo ------------------------------------------------------------------------
echo -e "                  Now getting the page for analysis.\n"
wget -nv "$url" -O $tmp

uf=$ripurl`grep watch_fullscreen $tmp | sed "s;.*\(video_id.\+\)&title.*;\1;"`

nv=`grep 'h1 id="video_title"' $tmp | cut -d ">" -f 2 | cut -d "<" -f 1`

echo -e "\n\n  Title: $nv\n\n"

wget "$uf" -O $tmp.flv
echo "" > $tmp
newname=`echo $nv | sed 's;/;\/;g'`
mv "$tmp.flv" "$newname.flv"
echo -e "\n\n $HOME/Youtube/$newname.flv ready.\n"

shift
done


--------------
There's no such thing as life. Those mean little jocks invented it ;)
-
Windows is not a virus. A virus does something!
Back to top
Profile PM 
21 replies since June 26 2007,16:13 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (5) </ 1 2 3 4 [5] >/
reply to topic new topic new poll
Quick Reply: Script for downloading Youtube videos

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code