View Single Post
  #16   Report Post  
Posted to rec.crafts.metalworking
Ignoramus31024 Ignoramus31024 is offline
external usenet poster
 
Posts: 10
Default 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:ate 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" );
}