From eb1334638387598a60a5f74bdb18ac3cc54855c3 Mon Sep 17 00:00:00 2001 From: legatvs Date: Sat, 25 Jul 2009 00:05:12 +0300 Subject: [PATCH] perltidy. --- lib/clive/Config.pm | 8 +++++--- lib/clive/Curl.pm | 2 +- lib/clive/Exec.pm | 2 +- lib/clive/Host/Ehrensenf.pm | 10 +++++----- lib/clive/Host/Golem.pm | 8 ++++---- lib/clive/HostFactory.pm | 37 ++++++++++++++++++++----------------- t/15ehrensenf.t | 3 ++- 7 files changed, 38 insertions(+), 32 deletions(-) diff --git a/lib/clive/Config.pm b/lib/clive/Config.pm index a6a75d1..f48c86d 100644 --- a/lib/clive/Config.pm +++ b/lib/clive/Config.pm @@ -102,10 +102,12 @@ sub init { my @google = qw(mp4); my @dmotion = qw(spak-mini vp6-hq vp6-hd vp6 h264); my @vimeo = qw(hd); - my @spiegel # vp6_388=flv (regular) + my @spiegel # vp6_388=flv (regular) = qw(vp6_64 vp6_576 vp6_928 h264_1400 small iphone podcast); - my @golem = qw(high ipod); # medium=flv (regular) - my @formats = ( qw(flv best), @youtube, @google, @dmotion, @vimeo, @spiegel, @golem ); + my @golem = qw(high ipod); # medium=flv (regular) + my @formats = ( + qw(flv best), @youtube, @google, @dmotion, @vimeo, @spiegel, @golem + ); #unless (@formats ~~ $config{format}) { # Perl 5.10.0+ unless ( grep( /^$config{format}$/, @formats ) ) { diff --git a/lib/clive/Curl.pm b/lib/clive/Curl.pm index b38fb05..db7d404 100644 --- a/lib/clive/Curl.pm +++ b/lib/clive/Curl.pm @@ -175,7 +175,7 @@ sub queryFileLength { # Otherwise use "flv" for the above exceptions. $suffix = "flv"; } - $suffix =~ tr{x-}//d; # e.g. x-flv -> flv. + $suffix =~ tr{x-}//d; # e.g. x-flv -> flv. $$props->file_suffix($suffix); $log->out("done.\n"); return (0); diff --git a/lib/clive/Exec.pm b/lib/clive/Exec.pm index 5c1be73..1fb5dda 100644 --- a/lib/clive/Exec.pm +++ b/lib/clive/Exec.pm @@ -45,7 +45,7 @@ sub init { if ( !$config->{exec} && $config->{exec_run} ) { clive::Log->instance->err( CLIVE_OPTARG, - "--exec-run depends on --exec"); + "--exec-run depends on --exec" ); exit(CLIVE_OPTARG); } } diff --git a/lib/clive/Host/Ehrensenf.pm b/lib/clive/Host/Ehrensenf.pm index 0506834..a386b0c 100644 --- a/lib/clive/Host/Ehrensenf.pm +++ b/lib/clive/Host/Ehrensenf.pm @@ -1,7 +1,7 @@ # -*- coding: ascii -*- ########################################################################### # clive, command line video extraction utility. -# Copyright 2009 Toni Gundogdu. +# Copyright 2007, 2008, 2009 Toni Gundogdu. # # This file is part of clive. # @@ -24,18 +24,18 @@ use warnings; use strict; sub new { - return bless({}, shift); + return bless( {}, shift ); } sub parsePage { - my ($self, $content, $props) = @_; + my ( $self, $content, $props ) = @_; $$props->video_host("ehrensenf"); - my %re = (data => qr|

(.*?)

|); + my %re = ( data => qr|

(.*?)

| ); my $tmp; - if (clive::Util::matchRegExps(\%re, \$tmp, $content) == 0) { + if ( clive::Util::matchRegExps( \%re, \$tmp, $content ) == 0 ) { if ( $tmp->{data} =~ /(\d\d).(\d\d).(\d\d\d\d)/ ) { my $id = "$3-$2-$1"; diff --git a/lib/clive/Host/Golem.pm b/lib/clive/Host/Golem.pm index f66bddb..b8de44f 100644 --- a/lib/clive/Host/Golem.pm +++ b/lib/clive/Host/Golem.pm @@ -53,7 +53,7 @@ sub parsePage { if ( _fetchConfig( $self, $url, $tmp->{id} ) == 0 ) { $$props->page_title( undef, $self->{page_title} ) - if ($self->{page_title}); + if ( $self->{page_title} ); $$props->video_id( $tmp->{id} ); $$props->video_link( $self->{video_link} ); @@ -76,7 +76,7 @@ sub _fetchConfig { my $config = clive::Config->instance->config; my $title = $1 - if ($content =~ /(.*?)<\/title>/); + if ( $content =~ /<title>(.*?)<\/title>/ ); my $fmt; if ( $config->{format} eq "best" ) { @@ -92,11 +92,11 @@ sub _fetchConfig { } $fmt =~ s/hd/high/; - $fmt =~ s/sd//; # medium + $fmt =~ s/sd//; # medium } else { $fmt = $config->{format}; - $fmt =~ s/flv//; # medium (default) + $fmt =~ s/flv//; # medium (default) } $xurl .= "?q=$fmt" diff --git a/lib/clive/HostFactory.pm b/lib/clive/HostFactory.pm index 1d93884..a0a89f7 100644 --- a/lib/clive/HostFactory.pm +++ b/lib/clive/HostFactory.pm @@ -26,20 +26,22 @@ use strict; use clive::Error qw(CLIVE_OK); my @_hosts = ( - [ "Youtube", qr|youtube.com|i, "flv|3gp|mp4|hq|hd" ], - [ "Youtube", qr|last.fm|i, "see above" ], - [ "Google", qr|video.google.|i, "flv|mp4" ], - [ "Sevenload", qr|sevenload.com|i, "flv" ], - [ "Break", qr|break.com|i, "flv" ], - [ "Liveleak", qr|liveleak.com|i, "flv" ], - [ "Evisor", qr|evisor.tv|i, "flv" ], - [ "Dailymotion", qr|dailymotion.com|i, "flv|spak-mini|vp6-hq|vp6-hd|vp6|h264" ], - [ "Cctv", qr|tv.cctv.com|i, "flv" ], - [ "Redtube", qr|redtube.com|i, "flv" ], - [ "Vimeo", qr|vimeo.com|i, "flv|hd" ], - [ "Spiegel", qr|spiegel.de|i, "flv|vp6_928|vp6_576|vp6_64|h264_1400" ], - [ "Golem", qr|golem.de|i, "flv|ipod|high" ], - [ "Ehrensenf", qr|ehrensenf.de|i, "flv" ], + [ "Youtube", qr|youtube.com|i, "flv|3gp|mp4|hq|hd" ], + [ "Youtube", qr|last.fm|i, "see above" ], + [ "Google", qr|video.google.|i, "flv|mp4" ], + [ "Sevenload", qr|sevenload.com|i, "flv" ], + [ "Break", qr|break.com|i, "flv" ], + [ "Liveleak", qr|liveleak.com|i, "flv" ], + [ "Evisor", qr|evisor.tv|i, "flv" ], + [ "Dailymotion", qr|dailymotion.com|i, + "flv|spak-mini|vp6-hq|vp6-hd|vp6|h264" + ], + [ "Cctv", qr|tv.cctv.com|i, "flv" ], + [ "Redtube", qr|redtube.com|i, "flv" ], + [ "Vimeo", qr|vimeo.com|i, "flv|hd" ], + [ "Spiegel", qr|spiegel.de|i, "flv|vp6_928|vp6_576|vp6_64|h264_1400" ], + [ "Golem", qr|golem.de|i, "flv|ipod|high" ], + [ "Ehrensenf", qr|ehrensenf.de|i, "flv" ], ); sub new { @@ -59,10 +61,11 @@ sub dumpHosts { my $self = shift; foreach (@_hosts) { my ( $host, $re, $fmts ) = @{$_}; - printf("%s\t%s\n", $1, $fmts) - if ( $re =~ /xsm:(.*?)\)/ && $re !~ /last\.fm/); + printf( "%s\t%s\n", $1, $fmts ) + if ( $re =~ /xsm:(.*?)\)/ && $re !~ /last\.fm/ ); } - print "\nNote: Some videos may have limited number of formats available.\n"; + print + "\nNote: Some videos may have limited number of formats available.\n"; exit(CLIVE_OK); } diff --git a/t/15ehrensenf.t b/t/15ehrensenf.t index b319f1f..9c8a374 100644 --- a/t/15ehrensenf.t +++ b/t/15ehrensenf.t @@ -13,4 +13,5 @@ else { use Test::clive; Test::clive::host( - qq|http://www.ehrensenf.de/shows/ehrensenf/getarnte-bienen-schaukelmotorrad-devitohorror| ); + qq|http://www.ehrensenf.de/shows/ehrensenf/getarnte-bienen-schaukelmotorrad-devitohorror| +); -- 2.11.4.GIT