Register
It is currently Tue Oct 21, 2014 12:22 pm

youtube.com video ripper


All times are UTC - 6 hours


Post new topic Reply to topic  [ 44 posts ]  Go to page 1, 2  Next
Author Message
 PostPosted: Tue Jul 11, 2006 1:43 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
youtube.com video ripper

Code:
#!/bin/bash
# by Crouse
# Program name ytr = YouTube.com Ripper

baseurl="http://youtube.com/get_video.php?"

mkdir -p ~/YouTube ;
read -p "What is the youtube.com url you want to rip ? " urltorip ;
read -p "What would you like to name the video (no spaces in the name) ? " nameofvideo ;
cd ~/YouTube ;
wget ${urltorip} -O urlsource.txt ;
grep "player2.swf" urlsource.txt > url.info ;
rm urlsource.txt

cut -d? -f2 url.info > url;
rm url.info

cut -d\" -f1 url > videoid;
rm url

videourl=`cat videoid`
rm videoid

fullurl=${baseurl}${videourl}
echo ${fullurl}
wget ${fullurl}

echo "Now converting the file to mpeg ... this can take awhile, please be patient" ;
ffmpeg -i *.flv -ab 56 -ar 22050 -b 500 -s 320x240 ${nameofvideo}.mpg
rm *.flv
rm -f gmon.out
exit


Last edited by crouse on Tue Jul 11, 2006 8:56 pm, edited 1 time in total.

Top
 Profile WWW  
 PostPosted: Tue Jul 11, 2006 3:37 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
Newer / better version.........

Code:
#!/bin/bash
# by Crouse
# Program name ytr = YouTube.com Ripper
baseurl="http://youtube.com/get_video.php?"
mkdir -p ~/YouTube ;
mkdir -p ~/YouTube/tmp ;
cd ~/YouTube/tmp ;
read -p "What is the youtube.com url you want to rip ? " urltorip ;
read -p "What would you like to name the video (no spaces in the name) ? " nameofvideo ;
wget ${urltorip} -O urlsource.txt ;
grep "player2.swf" urlsource.txt > url.info ;
cut -d? -f2 url.info > url;
cut -d\" -f1 url > videoid;
videourl=`cat videoid`
fullurl=${baseurl}${videourl}
echo ${fullurl}
rm *
wget ${fullurl}
mv * *.flv
echo "Now converting the file to mpeg ... this can take awhile, please be patient" ;
ffmpeg -i *.flv -ab 56 -ar 22050 -b 500 -s 320x240 ${nameofvideo}.mpg
mv *.mpg ../
rm -Rf ~/YouTube/tmp
exit


Last edited by crouse on Tue Jul 11, 2006 8:56 pm, edited 1 time in total.

Top
 Profile WWW  
 PostPosted: Tue Jul 11, 2006 4:09 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
Code:
#!/bin/bash
# by Crouse
# Program name ytr = YouTube.com Ripper
baseurl="http://youtube.com/get_video.php?"
mkdir -p ~/YouTube ;
mkdir -p ~/YouTube/tmp ;
cd ~/YouTube/tmp ;
read -p "What is the youtube.com url you want to rip ? " urltorip ;
read -p "What would you like to name the video (no spaces in the name) ? " nameofvideo ;
wget ${urltorip} -O urlsource.txt ;
grep "player2.swf" urlsource.txt > url.info ;
cut -d? -f2 url.info > url;
cut -d\" -f1 url > videoid;
videourl=`cat videoid`
fullurl=${baseurl}${videourl}
echo ${fullurl}
rm *
wget "${fullurl}" -O temp.flv
# mv * temp.flv
echo "Now converting the file to mpeg ... this can take awhile, please be patient" ;
ffmpeg -i temp.flv -ab 56 -ar 22050 -b 500 -s 320x240 ${nameofvideo}.mpg
# mv *.mpg ../
mv ${nameofvideo}.mpg ../
rm -Rf ~/YouTube/tmp
exit


Quote:
17:05 < crouse> http://www.youtube.com/watch?v=rdzQ35kh3Gw
17:05 < crouse> weird
17:06 < crouse> lol
17:06 <@jbsnake> hmm
17:06 < crouse> just grabbed one at random
17:09 <@jbsnake> i get a 404 on that one
17:09 < crouse> hmmmm
17:13 <@jbsnake> you need quotes man
17:13 < crouse> maybe it's just the url then...
17:13 <@jbsnake> nah
17:13 < crouse> well.... heading home....
17:13 <@jbsnake> you need quotes
17:13 < crouse> ahhhhhhh
17:13 < crouse> where ?
17:13 <@jbsnake> wget "http://youtube.com/get_video.php?video_id=VZ7EDg30670&l=39&t=OEgsToPDskLxiezO0ZpVFOP_IsF1ZKFR"
17:13 <@jbsnake> that works
17:13 <@jbsnake> without the quotes doesn't
17:13 < crouse> ahhhh
17:13 <@jbsnake> so... on the last wget line
17:14 < crouse> wget "${fullurl}"
17:14 <@jbsnake> or really... any wget line... just to be safe
17:14 <@jbsnake> ya
17:14 < crouse> k
17:14 <@jbsnake> try that
17:14 <@jbsnake> and... couldn't you do
17:14 <@jbsnake> wget "${fullurl}" -O flash.flv
17:15 <@jbsnake> or some such so you can save the name some way so you don't have to use the *
17:15 < crouse> ahhhhhhhhhh even BETTER ;)
17:15 < crouse> yeah




Last edited by crouse on Tue Jul 11, 2006 8:56 pm, edited 1 time in total.

Top
 Profile WWW  
 PostPosted: Tue Jul 11, 2006 8:53 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
Code:
crouse@linux-5dr8:~/Scripts> sh ytr.sh
What is the youtube.com url you want to rip ? http://youtube.com/watch?v=7agPOt1XZz8
What would you like to name the video (no spaces in the name) ? test1
--21:47:51--  http://youtube.com/watch?v=7agPOt1XZz8
           => `urlsource.txt'
Resolving youtube.com... 208.65.153.245, 208.65.153.240, 208.65.153.242, ...
Connecting to youtube.com|208.65.153.245|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

    [   <=>                                                             ] 58,796       103.34K/s

21:47:52 (103.08 KB/s) - `urlsource.txt' saved [58796]

http://youtube.com/get_video.php?video_id=7agPOt1XZz8&l=236&t=OEgsToPDskKXxh5iBY7DxxYPXWcki4Ks
--21:47:53--  http://youtube.com/get_video.php?video_id=7agPOt1XZz8&l=236&t=OEgsToPDskKXxh5iBY7DxxYPXWcki4Ks
           => `temp.flv'
Resolving youtube.com... 208.65.153.245, 208.65.153.240, 208.65.153.242, ...
Connecting to youtube.com|208.65.153.245|:80... connected.
HTTP request sent, awaiting response... 303 See Other
Location: http://sjl-v93.sjl.youtube.com/get_video?video_id=7agPOt1XZz8 [following]
--21:47:53--  http://sjl-v93.sjl.youtube.com/get_video?video_id=7agPOt1XZz8
           => `temp.flv'
Resolving sjl-v93.sjl.youtube.com... 64.15.120.100
Connecting to sjl-v93.sjl.youtube.com|64.15.120.100|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9,132,067 (8.7M) [video/flv]

33% [=====================>                                   


Top
 Profile WWW  
 PostPosted: Wed Jul 12, 2006 7:27 am   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
i have a small suggestion for this script... maybe a way to kill some of the headache its causing... remove the following lines..
Code:
grep "player2.swf" urlsource.txt > url.info ;
cut -d? -f2 url.info > url;
cut -d\" -f1 url > videoid;
videourl=`cat videoid`
fullurl=${baseurl}${videourl}

replace with this line (you may want to copy and paste)...
Code:
fullurl=${baseurl}`grep player2.swf urlsource.txt | cut -d? -f2 | cut -d\" -f1`


Top
 Profile  
 PostPosted: Wed Jul 12, 2006 10:22 am   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
actually the issue was mostly with this line.....

Code:
mv ${nameofvideo}.mpg ../
but that's sorted, so it seems to work just fine now....

FWIW, I like the cleanness of your code, but I like mine for ease of understanding.... if the url stuff changes at a later date, I feel mine would be easier (for me at least) to understand..... but since I have this archived here forever.... I will use your code as it makes the program even smaller and cleaner looking ;)


Top
 Profile WWW  
 PostPosted: Wed Jul 12, 2006 10:36 am   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
Code:
#!bin/bash
# by Crouse - Program name ytr = YouTube.com Ripper
clear; baseurl="http://youtube.com/get_video.php?";
mkdir -p ~/YouTube ; mkdir -p ~/YouTube/tmp ; cd ~/YouTube/tmp ; echo " ";
read -p "What is the youtube.com url you want to rip ? " urltorip ;
read -p "What would you like to name the video (no spaces in the name) ? " nameofvideo ;
wget ${urltorip} -O urlsource.txt ; fullurl=${baseurl}`grep player2.swf urlsource.txt | cut -d? -f2 | cut -d\" -f1` ;
rm * ; wget "${fullurl}" -O temp.flv ; ffmpeg -i temp.flv -ab 56 -ar 22050 -b 500 -s 320x240 ${nameofvideo}.mpg ;
mv ${nameofvideo}.mpg ../ ; rm -Rf ~/YouTube/tmp ; exit


should be 9 lines ;)


Top
 Profile WWW  
 PostPosted: Wed Jul 12, 2006 10:45 am   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
Code:
#!/bin/bash
clear;baseurl="http://youtube.com/get_video.php?";mkdir -p ~/YouTube;mkdir -p ~/YouTube/tmp;cd ~/YouTube/tmp;echo " ";
read -p "Enter youtube.com url: " urltorip;read -p "Name the video (no spaces in the name) ? " nameofvideo;
wget ${urltorip} -O urlsource.txt;fullurl=${baseurl}`grep player2.swf urlsource.txt | cut -d? -f2 | cut -d\" -f1`;
wget "${fullurl}" -O temp.flv;ffmpeg -i temp.flv -ab 56 -ar 22050 -b 500 -s 320x240 ${nameofvideo}.mpg;mv ${nameofvideo}.mpg ../;
rm -Rf ~/YouTube/tmp;exit


Down to 6 lines


Last edited by crouse on Wed Jul 12, 2006 6:14 pm, edited 1 time in total.

Top
 Profile WWW  
 PostPosted: Wed Jul 12, 2006 1:32 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
Code:
#!/bin/bash
bu="http://youtube.com/get_video.php?";mkdir -p ~/YouTube;cd ~/YouTube;read -p "YouTube url? " ur;read -p "Name? " nv
wget ${ur} -O /tmp/y1;uf=${bu}`grep player2.swf /tmp/y1 | cut -d? -f2 | cut -d\" -f1`;wget "${uf}" -O /tmp/y.flv
ffmpeg -i /tmp/y.flv -ab 56 -ar 22050 -b 500 -s 320x240 ${nv}.mpg;rm /tmp/y.flv; rm /tmp/y1;rm gmon.out; exit


4 Lines !!!! :)


Last edited by crouse on Wed Jul 12, 2006 6:14 pm, edited 1 time in total.

Top
 Profile WWW  
 PostPosted: Fri Jul 21, 2006 9:25 am   
User avatar

Joined: Fri Jul 21, 2006 9:11 am
Posts: 3
Location: /mnt/earth/ru/spb
crouse wrote:
Code:
#!/bin/bash
bu="http://youtube.com/get_video.php?";mkdir -p ~/YouTube;cd ~/YouTube;read -p "YouTube url? " ur;read -p "Name? " nv
wget ${ur} -O /tmp/y1;uf=${bu}`grep player2.swf /tmp/y1 | cut -d? -f2 | cut -d" -f1`;wget "${uf}" -O /tmp/y.flv
ffmpeg -i /tmp/y.flv -ab 56 -ar 22050 -b 500 -s 320x240 ${nv}.mpg;rm /tmp/y.flv; rm /tmp/y1;rm gmon.out; exit


4 Lines !!!! :)
3 lines =))
Code:
#!/bin/bash

BASEURL="http://youtube.com/get_video.php?" ; read -p "YouTube URL? " ORIGURL ; read -p "Desired path/filename? " OUTFILE

wget -c -S -O ${OUTFILE}.flv ${BASEURL}`curl -s ${ORIGURL} | grep player2.swf | cut -f2 -d? | cut -f1 -d"` && ffmpeg -i ${OUTFILE}.flv -ab 56 -ar 22050 -b 500 -s 320x240 ${OUTFILE}.mpg && exit 0
:D


Top
 Profile ICQ  
 PostPosted: Sun Jul 30, 2006 6:50 pm   

Joined: Sun Jul 30, 2006 6:45 pm
Posts: 4
:? Who still uses read? What if I want to call this from a script, say, in Firefox (which I do)?

Let's try this:

Code:
#!/bin/bash
wget -c -S -O $2.flv http://youtube.com/get_video.php\?`curl -s $1 | grep player2.swf | cut -f2 -d? | cut -f1 -d\"` && ffmpeg -i $2.flv -ab 56 -ar 22050 -b 500 -s 320x240 $2.mpg && exit 0


2 lines. :)

Called thus: ./youtube.sh {YouTube URL} {filename}

Or, even better, Triffid_Hunter wrote this one:

Code:
#!/usr/bin/perl -w
use LWP::Simple;LWP::Simple::get(shift) =~ /<title>YouTube - (.*?)<\/title>.*player2.swf\?(video_id=([0-9a-z]+).+?)\"/is && exec "wget -c -S -O $3.flv \"http://youtube.com/get_video.php?$2\" && ffmpeg -i $3.flv -ab 56 -ar 22050 -b 500 -s 320x240 \"".(@ARGV?shift:"$1.mpg")."\" && echo && echo YouTube:$3 saved as \\\"$1.mpg\\\""


2 lines. :)

Even though it's (ugly) Perl and thus technically not a "bash script," it is really nifty as it shows a good combination of dirt and trickery in order to save the file as the TITLE of the video.

Called thus: ./youtube.pl {YouTube URL}

Enjoy.


Top
 Profile  
 PostPosted: Mon Jul 31, 2006 12:01 am   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
Very interesting..... (well.....not the perl to me anyway), but the first script was. As for using read, I use it all the time actually, as it allows me to write bash scripts for the bash-challanged ;) IE: my son ....so he can save the video's he wanted ;)


Top
 Profile WWW  
 PostPosted: Thu Aug 03, 2006 7:40 am   
User avatar

Joined: Fri Jul 21, 2006 9:11 am
Posts: 3
Location: /mnt/earth/ru/spb
wily wrote:
:? Who still uses read? What if I want to call this from a script, say, in Firefox (which I do)?

Let's try this:

Code:
#!/bin/bash
wget -c -S -O $2.flv http://youtube.com/get_video.php\?`curl -s $1 | grep player2.swf | cut -f2 -d? | cut -f1 -d"` && ffmpeg -i $2.flv -ab 56 -ar 22050 -b 500 -s 320x240 $2.mpg && exit 0


2 lines. :)

Called thus: ./youtube.sh {YouTube URL} {filename}
<...>
Enjoy.
Without read, you have to cycle through more of checking `if/else' or `case' routines to bring $* parameters to the appropriate number of two.
Plus "youtube.sh {YouTube URL} {filename}" help line would be desired here as well.
So in the end it's going to get more that 2 lines =)

p.s. Sorry for my ugly English, I'm not a native... :(


Top
 Profile ICQ  
 PostPosted: Wed Aug 09, 2006 7:02 am   

Joined: Sun Jul 30, 2006 6:45 pm
Posts: 4
crouse wrote:
Very interesting..... (well.....not the perl to me anyway),

Perl rocks. Convert. That script works so damn beautifully, and I assure you there is very little in Perl that cannot be achieved in one line. :) With the addition of CPAN and one of the greatest communities I've ever seen, Perl is definitely worth a deeper look.
crouse wrote:
but the first script was. As for using read, I use it all the time actually, as it allows me to write bash scripts for the bash-challanged ;) IE: my son ....so he can save the video's he wanted ;)

That's cool, let's call this a power user script. 8)

And as for the next post, why do you need instructions? Real geeks look at the code. And, technically it's one line without the #!/bin/bash, which should be default anyhow. ;)


Top
 Profile  
 PostPosted: Wed Aug 09, 2006 8:11 am   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
Well..... ANY script in bash can be ONE line too ;) Just add lots of ";" to the mix, and it can be as long as you want ......

I can write some perl, some python, still deciding on if i want to do anything more, as you can tell, i prefer bash.... it's just more "readable" than perl or python to me.


Top
 Profile WWW  
 PostPosted: Fri Aug 11, 2006 3:19 pm   

Joined: Sun Jul 30, 2006 6:45 pm
Posts: 4
crouse wrote:
i prefer bash.... it's just more "readable" than perl or python to me.


Just as crime writers with simple plots are more "readable" than Twain or Dostoyevsky?

Hehe seriously man, horses for courses, bash scripts are great and fun for things like this, although hardly a match for Perl in the real world. :)

</zeolotry>


Top
 Profile  
 PostPosted: Sat Aug 12, 2006 2:26 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
I wouldn't say that..... ;)

I mean.. you HAVE checked out how many shell scripts are in a standard linux distrobution haven't you ;)

fwiw, i AM learning perl now.... i just still prefer bash.


Top
 Profile WWW  
 PostPosted: Thu Aug 17, 2006 4:39 pm   

Joined: Sun Jul 30, 2006 6:45 pm
Posts: 4
crouse wrote:
I wouldn't say that..... ;)

I mean.. you HAVE checked out how many shell scripts are in a standard linux distrobution haven't you ;)


Well if anyone running Gentoo can be bothered:

Code:
grep -R \#\!/bin/bash / | wc -l


If only I had the patience to unmount all my network mounts! :)


crouse wrote:
fwiw, i AM learning perl now.... i just still prefer bash.


Cool, don't forget http://perlmonks.org/ and of course, http://perl.org/ -- especially http://cpan.perl.org/.

perldoc is your friend! Have fun!

--
wily


Top
 Profile  
 PostPosted: Fri Aug 18, 2006 6:57 am   

Joined: Fri Aug 18, 2006 6:40 am
Posts: 1
Hey crouse great script! However it doesn't work with all links. For instance if I use this youtube link http://www.youtube.com/watch?v=8ff3F0cysQU I get this error:

Quote:
Input #0, flv, from '/tmp/y.flv':
Duration: N/A, bitrate: N/A
Stream #0.0: Audio: mp3, 22050 Hz, mono
Stream #0.1: Video: flv, yuv420p, 320x240, 1000.00 fps
Output #0, mpeg, to 'top_10_unsportmanlike_plays.mpg':
Stream #0.0: Video: mpeg1video, yuv420p, 320x240, 15.00 fps, q=2-31, 500 kb/s
Stream #0.1: Audio: mp2, 22050 Hz, mono, 56 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Stream #0.0 -> #0.1
[mpeg1video @ 0x8336308]MPEG1/2 does not support 15/1 fps
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height

rm: cannot remove `gmon.out': No such file or directory


I was planning on making a nice little front end with zenity, but I thought I would get the bugs out first. Any idea how to detect what type of video before encoding?

Also I did not need the "rm gmon.out".


Top
 Profile  
 PostPosted: Mon Sep 04, 2006 12:32 pm   

Joined: Mon Sep 04, 2006 12:30 pm
Posts: 1
jessejoedotcom wrote:
Hey crouse great script! However it doesn't work
...
[mpeg1video @ 0x8336308]MPEG1/2 does not support 15/1 fps
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height

rm: cannot remove `gmon.out': No such file or directory


I was planning on making a nice little front end with zenity, but I thought I would get the bugs out first. Any idea how to detect what type of video before encoding?

I used this workaround to get to dvd writable mpg:
ffmpeg -i how_not_to_ride.flv -aspect 4:3 -ab 56 -ar 22050 -b 500 -s 320x240 -y how_not_to_ride.avi
ffmpeg -i how_not_to_ride.avi -y -target ntsc-dvd -sameq -aspect 4:3 how_not_to_ride.mpg

Cheers,

MjM


Top
 Profile WWW  
 PostPosted: Thu Nov 16, 2006 5:28 am   

Joined: Thu Nov 16, 2006 5:10 am
Posts: 2
mmrtnt wrote:
jessejoedotcom wrote:
Hey crouse great script! However it doesn't work
...
[mpeg1video @ 0x8336308]MPEG1/2 does not support 15/1 fps
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height

rm: cannot remove `gmon.out': No such file or directory


I was planning on making a nice little front end with zenity, but I thought I would get the bugs out first. Any idea how to detect what type of video before encoding?

I used this workaround to get to dvd writable mpg:
ffmpeg -i how_not_to_ride.flv -aspect 4:3 -ab 56 -ar 22050 -b 500 -s 320x240 -y how_not_to_ride.avi
ffmpeg -i how_not_to_ride.avi -y -target ntsc-dvd -sameq -aspect 4:3 how_not_to_ride.mpg

Cheers,

MjM


good workaround, I use it as a function:

Code:
function dvd {
ffmpeg -i how_not_to_ride.flv -aspect 4:3  -ab 56 -ar 22050 -b 500  -s 320x240 -y how_not_to_ride.avi
ffmpeg -i how_not_to_ride.avi -y -target ntsc-dvd -sameq -aspect 4:3 how_not_to_ride.mpg
}


Top
 Profile  
 PostPosted: Tue Aug 21, 2007 3:44 pm   

Joined: Tue Aug 21, 2007 3:40 pm
Posts: 3
i have tried to use the bash script on the following url without success.

http://www.youtube.com/watch?v=0Sn7GmHHR14

this is the output

meme@mindcrime:~$ ./youtube.sh http://www.youtube.com/watch?v=0Sn7GmHHR14 lisa
./youtube.sh: line 2: curl: command not found
--16:19:05-- http://youtube.com/get_video.php?
=> `lisa.flv'
Resolving youtube.com... 208.65.153.238, 208.65.153.251, 208.65.153.253
Connecting to youtube.com|208.65.153.238|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 404 Not Found
Date: Tue, 21 Aug 2007 21:19:04 GMT
Server: Apache
Cache-Control: no-cache
Connection: close
Content-Type: text/html; charset=utf-8
16:19:05 ERROR 404: Not Found.

thank you.


Top
 Profile  
 PostPosted: Thu Aug 23, 2007 8:40 am   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
Quote:
./youtube.sh: line 2: curl: command not found


Install curl

HTH's ;)


Top
 Profile WWW  
 PostPosted: Thu Aug 23, 2007 10:07 pm   

Joined: Thu Aug 23, 2007 10:02 pm
Posts: 3
is the script broken? I believe I'm doing everything correct, and have curl installed.

script:
Code:
#!/bin/bash
wget -c -S -O $2.flv http://youtube.com/get_video.php\?`curl -s $1 | grep player2.swf | cut -f2 -d? | cut -f1 -d\"` && ffmpeg -i $2.flv -ab 56 -ar 22050 -b 500 -s 320x240 $2.mpg && exit 0


output:
Code:
root@jaredtop:/tmp# ./youtube.sh http://www.youtube.com/watch?v=0Sn7GmHHR14 lisa
--00:15:56--  http://youtube.com/get_video.php?v=1';
           => `lisa.flv'
Resolving youtube.com... 208.65.153.238, 208.65.153.251, 208.65.153.253
Connecting to youtube.com|208.65.153.238|:80... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 404 Not Found
  Date: Fri, 24 Aug 2007 04:15:54 GMT
  Server: Apache
  Cache-Control: no-cache
  Connection: close
  Content-Type: text/html; charset=utf-8
00:15:56 ERROR 404: Not Found.

root@jaredtop:/tmp#





Top
 Profile  
 PostPosted: Sat Aug 25, 2007 1:24 pm   

Joined: Tue Aug 21, 2007 3:40 pm
Posts: 3
it worked for me with curl and ffmpeg installed. the video output of a resized video looked horrible though from the example i gave. i believe that might have to do with the quality of the source. i am not 100% sure though that is my guess.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 44 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP