DIYbanter

DIYbanter (https://www.diybanter.com/)
-   Metalworking (https://www.diybanter.com/metalworking/)
-   -   Welding supply co. fire video- dallas, this morning (https://www.diybanter.com/metalworking/208200-welding-supply-co-fire-video-dallas-morning.html)

[email protected] July 25th 07 05:29 PM

Welding supply co. fire video- dallas, this morning
 

http://cbs11tv.com/topstories/local_...206104605.html

(flying) metal content.

Dave


RoyJ July 25th 07 05:50 PM

Welding supply co. fire video- dallas, this morning
 
Wow!

I can't imagine they would have that many tanks of flamable fuel so I
wonder what all the fireballs are from? I suppose an O2 tank would do that.

wrote:

http://cbs11tv.com/topstories/local_...206104605.html

(flying) metal content.

Dave


Lloyd E. Sponenburgh July 25th 07 06:03 PM

Welding supply co. fire video- dallas, this morning
 

"RoyJ" wrote in message
hlink.net...
Wow!

I can't imagine they would have that many tanks of flamable fuel so I
wonder what all the fireballs are from? I suppose an O2 tank would do
that.


Why would they not? From the size of their tank storage compound, it's
pretty evident that they're a large supplier in that area.

LLoyd


Jon Elson[_2_] July 25th 07 07:04 PM

Welding supply co. fire video- dallas, this morning
 


RoyJ wrote:
Wow!

I can't imagine they would have that many tanks of flamable fuel so I
wonder what all the fireballs are from? I suppose an O2 tank would do that.



don't you see that regular array, looks like a honeycomb of silver round
things?
Those are the tops of BIG Acetylene tanks!

Jon


dav1936531 July 25th 07 07:05 PM

Welding supply co. fire video- dallas, this morning
 
On Wed, 25 Jul 2007 09:29:12 -0700, wrote:


http://cbs11tv.com/topstories/local_...206104605.html

(flying) metal content.
Dave


Terrorist attack or accident?
Dave

Jon Elson[_2_] July 25th 07 07:07 PM

Welding supply co. fire video- dallas, this morning
 


dav1936531 wrote:
On Wed, 25 Jul 2007 09:29:12 -0700, wrote:


http://cbs11tv.com/topstories/local_...206104605.html

(flying) metal content.
Dave



Terrorist attack or accident?
Dave


We had the PraxAir fire in St. Louis a few years ago, pretty much the
same thing. They had the whole fire on surveillance video. It started
with one Propylene (MAPP substitute) tank venting in the hot sun.
Apparently there were a batch of tanks with defective relief valves.
Once it got started, with all those bottles sitting in the hot summer
sun, it just took off.

Jon


SteveB July 25th 07 07:15 PM

Welding supply co. fire video- dallas, this morning
 

wrote in message
oups.com...

http://cbs11tv.com/topstories/local_...206104605.html

(flying) metal content.

Dave


Thanks, Dave. I guess that has enough metal content to satisfy the
netnannies. Pretty good camera work there, too. I like that one tank
burning on the elevated roadway some distance away. You can also see lots
of tanks on the ground that have popped off their pressure release seals and
are just big flamethrowers.

Welding is serious business.

Steve



charlie July 25th 07 07:26 PM

Welding supply co. fire video- dallas, this morning
 

"dav1936531" wrote in message
...
On Wed, 25 Jul 2007 09:29:12 -0700, wrote:


http://cbs11tv.com/topstories/local_...206104605.html

(flying) metal content.
Dave


Terrorist attack or accident?
Dave


started by a truck fire. workers thought they could handle it. couldn't.



[email protected] July 25th 07 08:18 PM

Welding supply co. fire video- dallas, this morning
 
On Jul 25, 2:26 pm, "charlie"
wrote:
"dav1936531" wrote in message

...

On Wed, 25 Jul 2007 09:29:12 -0700, wrote:


http://cbs11tv.com/topstories/local_...206104605.html


(flying) metal content.
Dave


Terrorist attack or accident?
Dave


started by a truck fire. workers thought they could handle it. couldn't.



I wonder if the truck was loaded with cylinders? That would put things
'out of control' very quickly!

Dave


RoyJ July 25th 07 08:47 PM

Welding supply co. fire video- dallas, this morning
 
What I saw was huge arrays of high pressure tanks. I'm not aware of any
flamible materials in those tanks. The news reports talk about
compressed NG like they use in forklifts.

Jon Elson wrote:


RoyJ wrote:

Wow!

I can't imagine they would have that many tanks of flamable fuel so I
wonder what all the fireballs are from? I suppose an O2 tank would do
that.




don't you see that regular array, looks like a honeycomb of silver round
things?
Those are the tops of BIG Acetylene tanks!

Jon


Brent July 25th 07 09:01 PM

Welding supply co. fire video- dallas, this morning
 
On Jul 25, 2:07 pm, Jon Elson wrote:
dav1936531 wrote:
On Wed, 25 Jul 2007 09:29:12 -0700, wrote:


http://cbs11tv.com/topstories/local_...206104605.html


(flying) metal content.
Dave


Terrorist attack or accident?
Dave


We had the PraxAir fire in St. Louis a few years ago, pretty much the
same thing. They had the whole fire on surveillance video. It started
with one Propylene (MAPP substitute) tank venting in the hot sun.
Apparently there were a batch of tanks with defective relief valves.
Once it got started, with all those bottles sitting in the hot summer
sun, it just took off.

Jon


even a SMALL supplier like the liquid air i use has enough flammable
tanks in its cage to blow its building and most of its block off the
map

the original reports i saw were NG but the pics Looked like they were
either roofing NG tanks or they were welding tanks and if they were
welding takns then the "first" firefigheters i'd send anywhere NEAR
the scene woudl be waterbombers and i doubt i'd even let them fly over
the site until the tanks were done sparking off



Ignoramus31024 July 25th 07 09:11 PM

Welding supply co. fire video- dallas, this morning
 
Here's a good video:

http://www.cnn.com/2007/US/07/25/dal...ml#cnnSTCVideo


Ignoramus31024 July 25th 07 09:48 PM

Welding supply co. fire video- dallas, this morning
 
On Wed, 25 Jul 2007 14:40:52 -0700, SteveB wrote:

"Ignoramus31024" wrote in message
...
Here's a good video:

http://www.cnn.com/2007/US/07/25/dal...ml#cnnSTCVideo


The best one is the second one, the 35 minute one. At 2:30 and 5:43 into
the sequence, there's cylinders being thrown hundreds of yards towards the
freeway. One comes close to a car. I love the guy in the black pickup at
6:20 who pulls right up there to watch. Wonder if he got any dings. Then
at 7:00, you can see fires from the farthest hurled pieces. Man, that's
like being around a gunfight. Best thing to do is get the hell out of
there.

One of the most incredible videos I have ever seen. I think this will make
the World's Best Video shows of the future.


Steve, what second video? I saw only one video, about 5 minutes.

i

Jim Stewart July 25th 07 10:00 PM

Welding supply co. fire video- dallas, this morning
 
SteveB wrote:
"Ignoramus31024" wrote in message
...
Here's a good video:

http://www.cnn.com/2007/US/07/25/dal...ml#cnnSTCVideo


The best one is the second one, the 35 minute one. At 2:30 and 5:43 into
the sequence, there's cylinders being thrown hundreds of yards towards the
freeway. One comes close to a car. I love the guy in the black pickup at
6:20 who pulls right up there to watch. Wonder if he got any dings. Then
at 7:00, you can see fires from the farthest hurled pieces. Man, that's
like being around a gunfight. Best thing to do is get the hell out of
there.

One of the most incredible videos I have ever seen. I think this will make
the World's Best Video shows of the future.


How about this...

http://youtube.com/watch?v=Xf3WKTwHpIU

And my personal favorite...

http://youtube.com/watch?v=0kfB0RgQbok

Joe Pfeiffer July 25th 07 10:05 PM

Welding supply co. fire video- dallas, this morning
 
writes:

On Jul 25, 2:26 pm, "charlie"
wrote:
"dav1936531" wrote in message

...

On Wed, 25 Jul 2007 09:29:12 -0700, wrote:


http://cbs11tv.com/topstories/local_...206104605.html

(flying) metal content.
Dave


Terrorist attack or accident?
Dave


started by a truck fire. workers thought they could handle it. couldn't.



I wonder if the truck was loaded with cylinders? That would put things
'out of control' very quickly!


Yes. Apparently they were filling a bunch of acetylene cyliners
simultaneously when a "connection" (maybe a regulator?) failed, a tank
overfilled and exploded.

From the description of it I read, the workers thought they might be
able to handle it very, very briefly. And if they'd had 911 on
speed-dial, and been dialing before the driver hit the ground, it
wouldn't have mattered.

Ignoramus31024 July 25th 07 10:07 PM

Welding supply co. fire video- dallas, this morning
 
On Wed, 25 Jul 2007 14:00:28 -0700, Jim Stewart wrote:
SteveB wrote:
"Ignoramus31024" wrote in message
...
Here's a good video:

http://www.cnn.com/2007/US/07/25/dal...ml#cnnSTCVideo


The best one is the second one, the 35 minute one. At 2:30 and 5:43 into
the sequence, there's cylinders being thrown hundreds of yards towards the
freeway. One comes close to a car. I love the guy in the black pickup at
6:20 who pulls right up there to watch. Wonder if he got any dings. Then
at 7:00, you can see fires from the farthest hurled pieces. Man, that's
like being around a gunfight. Best thing to do is get the hell out of
there.

One of the most incredible videos I have ever seen. I think this will make
the World's Best Video shows of the future.


How about this...

http://youtube.com/watch?v=Xf3WKTwHpIU

And my personal favorite...

http://youtube.com/watch?v=0kfB0RgQbok


Very impressive. Here's my perl script that I use to download YouTube
videos as .AVI files, for local viewing.

i
################################################## ####################
#!/usr/bin/perl

# This is a script to download AVIs for YouTube videos, maybe for
# watching later on laptop or just adding them to your video library.
#
# It works by giving it IDs or URLs of YouTube videos (it figures out
# IDs from URLs as URLs are easier to copy/paste into command line).
#
# Example:
#
# $ YouTube http://youtube.com/watch?v=Svbcwx6FZPA sXzmXy226po i7DcvMrNXCk
#
# would load videos Svbcwx6FZPA sXzmXy226po i7DcvMrNXCk
#
# Copyright(C) Igor Chudov, 2007. All Rights Reserved.
# Licensed to you under GNU Public License v.2.
# See www.gnu.org.
#

use strict;
use warnings;

use LWP::UserAgent;
use HTTP::Cookies;
use HTTP::Request::Common;
use HTTP::Status qw(status_message);
use HTTP::Date qw(time2str str2time);
use WWW::Mechanize::GZip;
use Getopt::Long;

use vars qw( $ua $cookies );

$ua = new WWW::Mechanize::GZip( agent = "Mozilla" );
#LWP::UserAgent-new( agent = "Mozilla" );

$cookies = new HTTP::Cookies( file = "~/.cookies.txt", autosave = 1 );

sub printable {
my $str = shift;
$str =~ tr/\x80-\xFF//d;
return $str;
}

sub make_tree {
my ($html) = @_;
my $tree = HTML::TreeBuilder-new;
$tree-parse( $html );
return $tree;
}



sub get_request {
my ($req) = (@_);
$cookies-add_cookie_header($req);
my $res = $ua-request($req);
if ($res-is_success) {
$cookies-extract_cookies($res);
return $res;
} else {
print STDERR "Failed to execute HTTP request: ", printable( $res-status_line ),

print STDERR printable( $res-as_string );
}

return undef;

}



sub get_webpage {
my ($url) = @_;
my $req = HTTP::Request-new(GET = $url);

for( my $i = 0; $i 4; $i++ ) {
my $result = get_request( $req );

if( !$result ) {
print STDERR "Failed to get url '$url' ($i).\n";
next;
}

return $result;
}
return undef;
}

$| = 1;

my $success = {};

my $login = undef;
my $password = undef;

GetOptions(
"login=s", \$login,
"password=s", \$password,
);

if( $login ) {
if( $password ) {
#
# Logon with login and password
#
my $page = $ua-get( 'http://youtube.com/login?next=/index' );

#print $ua-form_name( "loginForm" )-dump . ".\n";
#exit 1;

my $resp = $ua-submit_form( form_name = "loginForm",
fields = {
current_form = "loginForm",
"next" = '/index',
username = $login,
password = $password,
action_login = "Log In",
},
);
print "Login=$login, password=$password.\n";
print "Result: " . $resp-content . ".\n";
} else {
die "Password required";
}
}

#exit 1;

foreach my $id (@ARGV) {
if( $id =~ /http/ ) {
if( $id =~ /\bv=([\w\-\+]+)/ ) {
$id = $1;
} else {
print STDERR "Cannot find ID 'v' in URL '$id'.\n";
next;
}
}


print "YouTube $id: ";

$success-{$id} = 0;

# Logic: youtube page has a link to full screen like this
#
# /watch_fullscreen?video_id=Svbcwx6FZPA&l=29&t=OEgsT oPDskIcPD66jq5hGIGjcDUoqyG0&sk=eJobROyFhIp3BVhijFQ GqAC&fs=1&title=
#
# We need to compute this:
#
# http://www.youtube.com/get_video?vid...Ip3BVhijFQGqAC

print "Querying. ";
my $url = "http://youtube.com/watch?v=$id";
my $resp = get_webpage( $url );
if( $resp-content =~ /\/watch_fullscreen\?video_id=.*?\&t=([\w\-\+]+).*?\&sk=([\w\-\+]+)/ ) {
my $t = $1;
my $sk = $2;
#print "t=$t, sk=$sk.\n";

my $title = "$id.avi";
if( $resp-content =~ /titleYouTube\s+-\s+(.*?)\/title/ ) {
$title = "$1";
$title =~ s/(\/|\\| |\+|\`|\'|\;|\!|\(|\)|\-)/_/g;
$title =~ s/_+/_/g;
$title .= ".$id.avi";
}

my $url = "http://www.youtube.com/get_video?video_id=$id&t=$t&sk=$sk";
print printable( "Loading $title... " );
my $video = get_webpage( $url );
if( $video && $video-is_success ) {
unless( open( VIDEO, "$title" ) ) {
print STDERR printable( "Cannot open $title for writing.\n");
next;
}
print "Saving " . length( $video-content ) . " bytes. ";
print VIDEO $video-content;
close( VIDEO );
print " OK!\n";
$success-{$id} = 1;
} else {
print STDERR "FAILED to load $id from $url.\n";
}
} else {
print STDERR "BAD YouTube format at $url\n\n\n";
if( $resp-content =~ /(\"\/watch_fullscreen.*?\")/ ) {
print printable( "URL = '$1'.\n" );
} else {
my $st = $resp-as_string;
if( $st =~ /content that is inappropriate/ ) {
print STDERR printable( "Inappropriate Video '$id'.\n" );
} else {
print STDERR printable( "Status: $st.\n" );
if( $resp-content =~ /body/i ) {
print "==== BODY" . $resp-content . "\n\n-------------------\n\n";
} else {
my $content = $resp-content;
$content =~ s/[\0-\x1F]/*/g;
$content =~ s/[\x7F-\xFF]/*/g;
$content = substr( $content, 0, 50 );
print printable( "==== BAD CONTENT\n\n$content\n\n" );
}
}
next;
}
}
}

my $repeat = "$0 ";
my $bad = undef;
foreach my $k (sort keys %$success ) {
#print "Summary: $k == " . ($success-{$k} ? "OK" : "BAD") . "\n";
next if $success-{$k};
$bad = 1;
$repeat .= " $k";
print "FAILED: $k\n";
}

if( $bad ) {
print printable( "\n\nREDO: $repeat\n" );
}

SteveB July 25th 07 10:40 PM

Welding supply co. fire video- dallas, this morning
 

"Ignoramus31024" wrote in message
...
Here's a good video:

http://www.cnn.com/2007/US/07/25/dal...ml#cnnSTCVideo


The best one is the second one, the 35 minute one. At 2:30 and 5:43 into
the sequence, there's cylinders being thrown hundreds of yards towards the
freeway. One comes close to a car. I love the guy in the black pickup at
6:20 who pulls right up there to watch. Wonder if he got any dings. Then
at 7:00, you can see fires from the farthest hurled pieces. Man, that's
like being around a gunfight. Best thing to do is get the hell out of
there.

One of the most incredible videos I have ever seen. I think this will make
the World's Best Video shows of the future.

Steve



Joe Pfeiffer July 26th 07 12:06 AM

Welding supply co. fire video- dallas, this morning
 
Ignoramus31024 writes:

Very impressive. Here's my perl script that I use to download YouTube
videos as .AVI files, for local viewing.


Thanks! I was just looking for a script like this the other day.

Ignoramus31024 July 26th 07 12:13 AM

Welding supply co. fire video- dallas, this morning
 
On Wed, 25 Jul 2007 17:06:17 -0600, Joe Pfeiffer wrote:
Ignoramus31024 writes:

Very impressive. Here's my perl script that I use to download YouTube
videos as .AVI files, for local viewing.


Thanks! I was just looking for a script like this the other day.


Glad you like it. I assembled a small collection f fun videos on my
local drive, using this script. It requires a few perl modules, like
WWW:Mechanize::Gzip, etc.

i

[email protected] July 26th 07 01:08 AM

Welding supply co. fire video- dallas, this morning
 
On Jul 25, 10:29 am, wrote:
http://cbs11tv.com/topstories/local_...206104605.html

(flying) metal content.

Dave


AP muffs it again!
Reported locally as "liquified natural gas":
http://www.9news.com/news/world/arti...?storyid=74256

At which point I wondered whether Dallas was still there! Then they
started talking about tanks being stacked, and I figured it had to be
propane or something else. One of the big security concerns for
decades has been LNG tanks and facilities and the amount of energy
contained within. Equivalent to small nukes in some cases. A welding
supply going up is bad enough, but not quite in the same league.

Stan


John July 26th 07 01:24 AM

Welding supply co. fire video- dallas, this morning
 


wrote:

On Jul 25, 10:29 am, wrote:

http://cbs11tv.com/topstories/local_...206104605.html

(flying) metal content.

Dave



AP muffs it again!
Reported locally as "liquified natural gas":
http://www.9news.com/news/world/arti...?storyid=74256

At which point I wondered whether Dallas was still there! Then they
started talking about tanks being stacked, and I figured it had to be
propane or something else. One of the big security concerns for
decades has been LNG tanks and facilities and the amount of energy
contained within. Equivalent to small nukes in some cases. A welding
supply going up is bad enough, but not quite in the same league.

Stan



I guess the bottled gas business is booming in Texas.


John


Dev Null July 26th 07 01:25 AM

perl script
 
Ignoramus31024 wrote in
:

..

http://youtube.com/watch?v=0kfB0RgQbok


Very impressive. Here's my perl script that I use to download
YouTube videos as .AVI files, for local viewing.


Can you post some info or links on how to use this?

Will this work with windows or is it Linux only?

Ignoramus31024 July 26th 07 02:14 AM

perl script
 
On Thu, 26 Jul 2007 00:25:23 GMT, Dev Null wrote:
Ignoramus31024 wrote in
:

.

http://youtube.com/watch?v=0kfB0RgQbok


Very impressive. Here's my perl script that I use to download
YouTube videos as .AVI files, for local viewing.


Can you post some info or links on how to use this?

Will this work with windows or is it Linux only?


It should work with windows, you can get ActivePerl. I never tried
that, though, but I could try it on windows if anyone expresses interest.
There is nothing linux specific in this script.

You need to run it from command line.

i

Pete C. July 26th 07 05:48 AM

Welding supply co. fire video- dallas, this morning
 
Joe Pfeiffer wrote:

writes:

On Jul 25, 2:26 pm, "charlie"
wrote:
"dav1936531" wrote in message

...

On Wed, 25 Jul 2007 09:29:12 -0700, wrote:

http://cbs11tv.com/topstories/local_...206104605.html

(flying) metal content.
Dave

Terrorist attack or accident?
Dave

started by a truck fire. workers thought they could handle it. couldn't.



I wonder if the truck was loaded with cylinders? That would put things
'out of control' very quickly!


Yes. Apparently they were filling a bunch of acetylene cyliners
simultaneously when a "connection" (maybe a regulator?) failed, a tank
overfilled and exploded.

From the description of it I read, the workers thought they might be
able to handle it very, very briefly. And if they'd had 911 on
speed-dial, and been dialing before the driver hit the ground, it
wouldn't have mattered.


The report I heard after the dust had settled a bit was that one of the
fill whips at the acetylene filling station failed. With acetylene being
as stable as it is, I expect it was game over at that point.

Pete C.

cavelamb himself July 26th 07 05:54 AM

perl script
 
Ignoramus31024 wrote:

On Thu, 26 Jul 2007 00:25:23 GMT, Dev Null wrote:

Ignoramus31024 wrote in
om:

.

http://youtube.com/watch?v=0kfB0RgQbok

Very impressive. Here's my perl script that I use to download
YouTube videos as .AVI files, for local viewing.


Can you post some info or links on how to use this?

Will this work with windows or is it Linux only?



It should work with windows, you can get ActivePerl. I never tried
that, though, but I could try it on windows if anyone expresses interest.
There is nothing linux specific in this script.

You need to run it from command line.

i


Intrest, iggy.
Lots of interest.

I tried a downloaded YouTube saver but it didn't work very well.
Make a bunch of Windows Weenies real happy???


Richard

Ignoramus16379 July 26th 07 03:21 PM

perl script
 
On Thu, 26 Jul 2007 04:54:07 GMT, cavelamb himself wrote:
Ignoramus31024 wrote:

On Thu, 26 Jul 2007 00:25:23 GMT, Dev Null wrote:

Ignoramus31024 wrote in
news:gaadnS86RasRJjrbnZ2dnUVZ_szinZ2d@giganews. com:

.

http://youtube.com/watch?v=0kfB0RgQbok

Very impressive. Here's my perl script that I use to download
YouTube videos as .AVI files, for local viewing.


Can you post some info or links on how to use this?

Will this work with windows or is it Linux only?



It should work with windows, you can get ActivePerl. I never tried
that, though, but I could try it on windows if anyone expresses interest.
There is nothing linux specific in this script.

You need to run it from command line.

i


Intrest, iggy.
Lots of interest.

I tried a downloaded YouTube saver but it didn't work very well.
Make a bunch of Windows Weenies real happy???



It works. If you are not familiar with perl, you may spend some extra
time, but there is some value in learning.

Download ActivePerl and install it into, say, c:/Perl588. (do not
install it under Program Files, it is not command line friendly)

Then, use their ppm.bat command to install WWW::Mechanize module.

ppm.bat WWW::Mechanize

Then, create a directory c:/temp/extra_modules/WWW/Mechanize.

Download a file

http://search.cpan.org/src/PEGI/WWW-...hanize/GZip.pm

right into that directory.

Save my YouTube script somewhere, say c:/temp/YouTube.pl

The, execute a command (kind of long, but you can make a .BAT file fot
it later)

PERL5LIB=c:/temp/extra_modules c:/Perl588/bin/perl c:/temp/YouTube.pl http://youtube.com/watch?v=BVxHrMRQyvw

This would download a video of me running a Cummins L423D diesel engine that I restored.

http://youtube.com/watch?v=BVxHrMRQyvw

i

Lloyd E. Sponenburgh July 26th 07 03:37 PM

perl script
 

"Ignoramus16379" wrote in message
It should work with windows, you can get ActivePerl. I never tried
that, though, but I could try it on windows if anyone expresses
interest.
There is nothing linux specific in this script.


Perl is a pearl, but strange to the non-IX user.

LLoyd


Joe Pfeiffer July 26th 07 04:28 PM

perl script
 
"Lloyd E. Sponenburgh" writes:

"Ignoramus16379" wrote in
message It should work with windows, you can get ActivePerl. I
never tried
that, though, but I could try it on windows if anyone expresses
interest.
There is nothing linux specific in this script.


Perl is a pearl, but strange to the non-IX user.


It's pretty strange to an old *ix user, too.

Wes[_2_] July 26th 07 08:26 PM

perl script
 
Ignoramus16379 wrote:


Save my YouTube script somewhere, say c:/temp/YouTube.pl


Where do I find that script? My internet connection is a bit hosed last few
days so I likely missed the start of this thread. I'd like to try it using
cygwin.

Wes

Ignoramus16379 July 26th 07 08:33 PM

perl script
 
On Thu, 26 Jul 2007 15:26:27 -0400, Wes wrote:
Ignoramus16379 wrote:


Save my YouTube script somewhere, say c:/temp/YouTube.pl


Where do I find that script? My internet connection is a bit hosed last few
days so I likely missed the start of this thread. I'd like to try it using
cygwin.


I posted it in that thread, but here it goes again:

#!/usr/bin/perl

# This is a script to download AVIs for YouTube videos, maybe for
# watching later on laptop or just adding them to your video library.
#
# It works by giving it IDs or URLs of YouTube videos (it figures out
# IDs from URLs as URLs are easier to copy/paste into command line).
#
# Example:
#
# $ YouTube http://youtube.com/watch?v=Svbcwx6FZPA sXzmXy226po i7DcvMrNXCk
#
# would load videos Svbcwx6FZPA sXzmXy226po i7DcvMrNXCk
#
# Copyright(C) Igor Chudov, 2007. All Rights Reserved.
# Licensed to you under GNU Public License v.2.
# See www.gnu.org.
#

use strict;
use warnings;

use LWP::UserAgent;
use HTTP::Cookies;
use HTTP::Request::Common;
use HTTP::Status qw(status_message);
use HTTP::Date qw(time2str str2time);
use WWW::Mechanize::GZip;
use Getopt::Long;

use vars qw( $ua $cookies );

$ua = new WWW::Mechanize::GZip( agent = "Mozilla" );
#LWP::UserAgent-new( agent = "Mozilla" );

$cookies = new HTTP::Cookies( file = "~/.cookies.txt", autosave = 1 );

sub printable {
my $str = shift;
$str =~ tr/\x80-\xFF//d;
return $str;
}

sub make_tree {
my ($html) = @_;
my $tree = HTML::TreeBuilder-new;
$tree-parse( $html );
return $tree;
}



sub get_request {
my ($req) = (@_);
$cookies-add_cookie_header($req);
my $res = $ua-request($req);
if ($res-is_success) {
$cookies-extract_cookies($res);
return $res;
} else {
print STDERR "Failed to execute HTTP request: ", printable( $res-status_line ),

print STDERR printable( $res-as_string );
}

return undef;

}



sub get_webpage {
my ($url) = @_;
my $req = HTTP::Request-new(GET = $url);

for( my $i = 0; $i 4; $i++ ) {
my $result = get_request( $req );

if( !$result ) {
print STDERR "Failed to get url '$url' ($i).\n";
next;
}

return $result;
}
return undef;
}

$| = 1;

my $success = {};

my $login = undef;
my $password = undef;

GetOptions(
"login=s", \$login,
"password=s", \$password,
);

if( $login ) {
if( $password ) {
#
# Logon with login and password
#
my $page = $ua-get( 'http://youtube.com/login?next=/index' );

#print $ua-form_name( "loginForm" )-dump . ".\n";
#exit 1;

my $resp = $ua-submit_form( form_name = "loginForm",
fields = {
current_form = "loginForm",
"next" = '/index',
username = $login,
password = $password,
action_login = "Log In",
},
);
print "Login=$login, password=$password.\n";
print "Result: " . $resp-content . ".\n";
} else {
die "Password required";
}
}

#exit 1;

foreach my $id (@ARGV) {
if( $id =~ /http/ ) {
if( $id =~ /\bv=([\w\-\+]+)/ ) {
$id = $1;
} else {
print STDERR "Cannot find ID 'v' in URL '$id'.\n";
next;
}
}


print "YouTube $id: ";

$success-{$id} = 0;

# Logic: youtube page has a link to full screen like this
#
# /watch_fullscreen?video_id=Svbcwx6FZPA&l=29&t=OEgsT oPDskIcPD66jq5hGIGjcDUoqyG0&sk=eJobROyFhIp3BVhijFQ GqAC&fs=1&title=
#
# We need to compute this:
#
# http://www.youtube.com/get_video?vid...Ip3BVhijFQGqAC

print "Querying. ";
my $url = "http://youtube.com/watch?v=$id";
my $resp = get_webpage( $url );
if( $resp-content =~ /\/watch_fullscreen\?video_id=.*?\&t=([\w\-\+]+).*?\&sk=([\w\-\+]+)/ ) {
my $t = $1;
my $sk = $2;
#print "t=$t, sk=$sk.\n";

my $title = "$id.avi";
if( $resp-content =~ /titleYouTube\s+-\s+(.*?)\/title/ ) {
$title = "$1";
$title =~ s/(\/|\\| |\+|\`|\'|\;|\!|\(|\)|\-)/_/g;
$title =~ s/_+/_/g;
$title .= ".$id.avi";
}

my $url = "http://www.youtube.com/get_video?video_id=$id&t=$t&sk=$sk";
print printable( "Loading $title... " );
my $video = get_webpage( $url );
if( $video && $video-is_success ) {
unless( open( VIDEO, "$title" ) ) {
print STDERR printable( "Cannot open $title for writing.\n");
next;
}
print "Saving " . length( $video-content ) . " bytes. ";
print VIDEO $video-content;
close( VIDEO );
print " OK!\n";
$success-{$id} = 1;
} else {
print STDERR "FAILED to load $id from $url.\n";
}
} else {
print STDERR "BAD YouTube format at $url\n\n\n";
if( $resp-content =~ /(\"\/watch_fullscreen.*?\")/ ) {
print printable( "URL = '$1'.\n" );
} else {
my $st = $resp-as_string;
if( $st =~ /content that is inappropriate/ ) {
print STDERR printable( "Inappropriate Video '$id'.\n" );
} else {
print STDERR printable( "Status: $st.\n" );
if( $resp-content =~ /body/i ) {
print "==== BODY" . $resp-content . "\n\n-------------------\n\n";
} else {
my $content = $resp-content;
$content =~ s/[\0-\x1F]/*/g;
$content =~ s/[\x7F-\xFF]/*/g;
$content = substr( $content, 0, 50 );
print printable( "==== BAD CONTENT\n\n$content\n\n" );
}
}
next;
}
}
}

my $repeat = "$0 ";
my $bad = undef;
foreach my $k (sort keys %$success ) {
#print "Summary: $k == " . ($success-{$k} ? "OK" : "BAD") . "\n";
next if $success-{$k};
$bad = 1;
$repeat .= " $k";
print "FAILED: $k\n";
}

if( $bad ) {
print printable( "\n\nREDO: $repeat\n" );
}


Maxwell Lol July 26th 07 10:08 PM

perl script
 
Dev Null writes:

Ignoramus31024 wrote in
:

.

http://youtube.com/watch?v=0kfB0RgQbok


Very impressive. Here's my perl script that I use to download
YouTube videos as .AVI files, for local viewing.


Can you post some info or links on how to use this?

Will this work with windows or is it Linux only?


You can also get VideoDownloader extension for FireFox. You have to
save the file as a *.flv file, and get a special flash player called
FLVPlayer. This works under windows.

Martin H. Eastburn July 26th 07 10:28 PM

perl script
 
I got a Camel book - first edition. Perl is neat and different.
Somewhere between all the 'shells' and C. Who knows what the latest
versions have within.

Martin

Martin H. Eastburn
@ home at Lions' Lair with our computer lionslair at consolidated dot net
TSRA, Life; NRA LOH & Endowment Member, Golden Eagle, Patriot's Medal.
NRA Second Amendment Task Force Charter Founder
IHMSA and NRA Metallic Silhouette maker & member.
http://lufkinced.com/


Joe Pfeiffer wrote:
"Lloyd E. Sponenburgh" writes:

"Ignoramus16379" wrote in
message It should work with windows, you can get ActivePerl. I
never tried
that, though, but I could try it on windows if anyone expresses
interest.
There is nothing linux specific in this script.

Perl is a pearl, but strange to the non-IX user.


It's pretty strange to an old *ix user, too.


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Leon Fisk July 27th 07 06:52 PM

perl script
 
On 26 Jul 2007 17:08:13 -0400, Maxwell Lol
wrote:

Dev Null writes:

Ignoramus31024 wrote in
:

.

http://youtube.com/watch?v=0kfB0RgQbok

Very impressive. Here's my perl script that I use to download
YouTube videos as .AVI files, for local viewing.


Can you post some info or links on how to use this?

Will this work with windows or is it Linux only?


You can also get VideoDownloader extension for FireFox. You have to
save the file as a *.flv file, and get a special flash player called
FLVPlayer. This works under windows.


If you can live with a command proggy, FFmpeg can play flv
files too. See:

http://arrozcru.no-ip.org/ffmpeg_builds/

and for a forum/help, a bit more info:

http://arrozcru.no-ip.org/ffmpeg_for...wforum.php?f=3

It can also extract, convert...

--
Leon Fisk
Grand Rapids MI/Zone 5b
Remove no.spam for email

Ignoramus21381 July 27th 07 07:01 PM

perl script
 
On Fri, 27 Jul 2007 13:52:02 -0400, Leon Fisk wrote:
On 26 Jul 2007 17:08:13 -0400, Maxwell Lol
wrote:

Dev Null writes:

Ignoramus31024 wrote in
:

.

http://youtube.com/watch?v=0kfB0RgQbok

Very impressive. Here's my perl script that I use to download
YouTube videos as .AVI files, for local viewing.


Can you post some info or links on how to use this?

Will this work with windows or is it Linux only?


You can also get VideoDownloader extension for FireFox. You have to
save the file as a *.flv file, and get a special flash player called
FLVPlayer. This works under windows.


If you can live with a command proggy, FFmpeg can play flv
files too. See:

http://arrozcru.no-ip.org/ffmpeg_builds/

and for a forum/help, a bit more info:

http://arrozcru.no-ip.org/ffmpeg_for...wforum.php?f=3

It can also extract, convert...


mplayer is, in my opinion, an even better player, and can play more or
less anything.

i

Leon Fisk July 27th 07 08:57 PM

perl script
 
On Fri, 27 Jul 2007 13:01:04 -0500, Ignoramus21381
wrote:

On Fri, 27 Jul 2007 13:52:02 -0400, Leon Fisk wrote:
On 26 Jul 2007 17:08:13 -0400, Maxwell Lol
wrote:

Dev Null writes:

Ignoramus31024 wrote in
:

.

http://youtube.com/watch?v=0kfB0RgQbok

Very impressive. Here's my perl script that I use to download
YouTube videos as .AVI files, for local viewing.


Can you post some info or links on how to use this?

Will this work with windows or is it Linux only?

You can also get VideoDownloader extension for FireFox. You have to
save the file as a *.flv file, and get a special flash player called
FLVPlayer. This works under windows.


If you can live with a command proggy, FFmpeg can play flv
files too. See:

http://arrozcru.no-ip.org/ffmpeg_builds/

and for a forum/help, a bit more info:

http://arrozcru.no-ip.org/ffmpeg_for...wforum.php?f=3

It can also extract, convert...


mplayer is, in my opinion, an even better player, and can play more or
less anything.

i


If I recall correctly the two apps are closely related and
share code.



All times are GMT +1. The time now is 05:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2014 DIYbanter