Projects
Multimedia
clive
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
clive.changes
Changed
@@ -1,4 +1,24 @@ ------------------------------------------------------------------- +Sun Jul 7 2012 - dnh@opensuse.org + +- update to 2.3.3 + +------------------------------------------------------------------- +Thu Aug 11 2011 - dnh@opensuse.org + +- update to 2.3.1.1 + +------------------------------------------------------------------- +Sat May 14 2011 - dnh@opensuse.org + +- update to 2.3.0.3 + +------------------------------------------------------------------- +Sun Mar 6 2011 - dnh@opensuse.org + +- update to 2.2.23 + +------------------------------------------------------------------- Thu Jan 20 06:20:19 UTC 2011 - pascal.bleser@opensuse.org - update to 2.2.22:
View file
clive.spec
Changed
@@ -1,51 +1,26 @@ # vim: set sw=4 ts=4 et nu: Name: clive -Version: 2.2.22 -Release: 0.pm.1 +Version: 2.3.3 +Release: 1.pm.1 Summary: Non-Interactive Video Extraction Utility # http://prdownloads.sourceforge.net/clive/clive-%{version}.tar.gz -Source: clive-%{version}.tar.bz2 -# pbleser: don't use explain, as it requires a newer perl(version) -Patch1: clive-backport.patch +Source: clive-%{version}.tar.gz Source99: clive-rpmlintrc URL: http://clive.sourceforge.net/ Group: Productivity/Networking/Other License: ISC/OpenBSD BuildRoot: %{_tmppath}/build-%{name}-%{version} BuildRequires: perl -BuildRequires: perl(IO::Pager) -BuildRequires: perl(BerkeleyDB) -BuildRequires: perl(Expect) -BuildRequires: perl(Config::Tiny) -BuildRequires: perl(WWW::Curl) -BuildRequires: perl(Term::ProgressBar) -BuildRequires: perl(Clipboard) BuildRequires: perl(Getopt::ArgvFile) -BuildRequires: perl(Class::Singleton) -BuildRequires: perl(version) >= 0.77 +BuildRequires: perl(Test::Pod) >= 1.00 +BuildRequires: perl-version >= 0.77 +BuildRequires: perl(JSON::XS) >= 2.3 +Requires: ffmpeg quvi Requires: perl = %{perl_version} -Requires: ffmpeg -Requires: perl(IO::Pager) -Requires: perl(BerkeleyDB) -Requires: perl(Expect) -Requires: perl(Config::Tiny) -Requires: perl(WWW::Curl) -Requires: perl(Term::ProgressBar) -Requires: perl(Clipboard) +Requires: perl-version >= 0.77 +Requires: perl(JSON::XS) >= 2.3 Requires: perl(Getopt::ArgvFile) -Requires: perl(Class::Singleton) -%if 0%{?suse_version} >= 1120 -BuildRequires: perl(HTML::Parser) -Requires: perl(HTML::Parser) -BuildRequires: perl(URI) -Requires: perl(URI) -%else -BuildRequires: perl-HTML-Parser -Requires: perl-HTML-Parser -BuildRequires: perl-URI -Requires: perl-URI -%endif BuildArch: noarch %description @@ -58,28 +33,24 @@ %prep %setup -q -%if 0%{?suse_version} < 1130 -%patch1 -%endif %__sed -i '/^auto_install/d' Makefile.PL %build +export PERL5LIB="%{perl_vendorarch}:%perl_vendorlib:$(perl -V:vendorlib_stem)" %__perl Makefile.PL PREFIX="%{_prefix}" %__make %{?jobs:-j%{jobs}} %install %perl_make_install %perl_process_packlist - %__rm -rf "%{buildroot}%{perl_vendorarch}/auto/clive" - -%__rm -f "%{buildroot}/var/adm/perl-modules/%{name}" +%__rm -f "%{buildroot}%{perl_vendorarch}/auto/.packlist" %check %if 0%{?opensuse_bs:1} export NO_INTERNET=1 %endif -%__make test +%__make PERL5LIB="%{perl_vendorarch}:$PERL5LIB" test %clean %{?buildroot:%__rm -rf "%{buildroot}"} @@ -89,6 +60,9 @@ %doc ChangeLog COPYING README %doc examples %{_bindir}/clive -%{perl_vendorlib}/clive %doc %{_mandir}/man1/clive.1%{ext_man} +%if 0%{?suse_version} < 1140 +/var/adm/perl-modules/clive +%endif +%changelog
View file
clive-backport.patch
Deleted
@@ -1,19 +0,0 @@ ---- lib/clive/Config.pm.orig 2011-01-20 07:23:47.000000000 +0100 -+++ lib/clive/Config.pm 2011-01-20 07:27:33.000000000 +0100 -@@ -40,7 +40,7 @@ - use clive::Compat; - use clive::Error qw(CLIVE_OK CLIVE_OPTARG); - --use version 0.77 (); our $VERSION = version->declare ("2.2.22"); -+use version 0.74 (); our $VERSION = version->new("2.2.22"); - - sub init { - my $self = shift; ---- t/eval-compile.t.orig 2011-01-20 07:24:08.000000000 +0100 -+++ t/eval-compile.t 2011-01-20 07:24:17.000000000 +0100 -@@ -6,4 +6,4 @@ - my $output = qx(perl -c -I./blib/lib blib/script/clive 2>&1); - - ok( $output =~ /syntax OK$/ ) -- or diag explain $output; -+ or die $output;
View file
clive-2.2.22.tar.bz2/ChangeLog.pre-gitlog
Deleted
@@ -1,963 +0,0 @@ - -2.2.18 Tue Nov 30 2010 legatvs -Changes: - - Change google test URL - - Accept dailymotion swf URLs (related b#3115846) - - -2.2.17 Sat Nov 06 2010 legatvs -Changes: - - toUnits: fix hi-speed issue, thanks to Thomas Klausner for the report - - Makefile.PL: Use VERSION_FROM - - Use 'version' module - - -Version 2.2.16 -September 28, 2010 - -Changes: - * Add support for webm_480p, webm_720p youtube - * Thanks to Mark Weaver for the patch, <http://is.gd/fmwv5> - * Misc. minor tweaks in manual (e.g. URLs, etc.) - * Migrate issue tracking from Googlecode to Sourceforge, <http://is.gd/fmylF> - - -Version 2.2.15 -September 10, 2010 - -Changes: - * New Youtube test URL - * --format, "flv" is now called "default" - * Add Youtube 1080p support (#62) - * Update Youtube format IDs to match those used with quvi - -Bugfixes: - * Vimeo support (http/404), thanks to Jonas Smedegaard for the fix (#61) - - <http://bugs.debian.org/595486> - - -Version 2.2.14 -September 2, 2010 - -Bugfixes: - * Output File path encoding (#60) - - -Version 2.2.13 -August 12, 2010 - -Changes: - * Add --license option - - -Version 2.2.12 -July 25, 2010 - -Changes: - * Mark cctv support as broken - -Bugfixes: - * youtube http/404, ported from quvi, fix by Daniel Schaal (quvi #7) - * break.com support, thanks to Werner Elsler for the fix (#57) - - -Version 2.2.11 --------------- -April 3, 2010 - -Bugfixes: - * Youtube, update patterns to reflect website changes - - -Version 2.2.10 --------------- -March 24, 2010 - -Changes: - * Add buzzhumor.com support - * Mark ehrensenf.de support as broken - -Bugfixes: - * Update --hosts format strings - * dailymotion.com - # Change format IDs to reflect website changes (yet again): - * h264-hd -> hd - * h264-hq -> hq - * removed h264 and spark-mini (no longer even listed) - # Parse title from elsewhere - * Title was previously parsed from the title HTML tag - * Which usually contained more than we cared for - # Spew out an error if the video looks like a partner video - * break.com - # Support, thanks to Werner Elsler for the fix - # Title parsing, ported from libquvi - - -Version 2.2.9 -(February 13, 2010) - - User-visible changes: - * Fix dailymotion formats - - vp6-hd -> h264-hd - - vp6-hq -> h264-hq - - vp6 -> h264 - * Fix vimeo support - # closes issue #49 - * Partial fix: cctv: dump multi-segment video links - # single-segment videos are still copied normally - # closes issue #45 (for now) - - Developer-visible changes: - * Rename CHANGES -> ChangeLog - * Add NEWS file - * Remove dead test link: - # tlinks/sload.url - # t/10sevenload.t - - -Version 2.2.8 -(December 18, 2009) - - User-visible changes: - * Remove the remains of the redtube support - * Do not replace dashes with underscores in IDs (closes issue #44) - * Sevenload: - # Fix http/401 error - # Cleanup title parsing (use config data instead) - * Croak with an error if BerkeleyDB module is not found - # And either -d or -g options are used - - -Version 2.2.7 -(September 29, 2009) - - User-visible changes: - * Fix: dailymotion id parsing - * Youtube: - # Accept -f fmt34 - # fmt34 is now treated as yet another (new?) format - # Rewrite youtube section of the FORMATS in the manual - * Fix: --format=best not working with youtube (closes issue #39) - # Thanks to Peter Baranyi for the fix - - Developer-visible changes: - * Disable: t/11redtube.t (broken, see known issues) - * "make test": ADULT_OK env.var. now enables redtube test - - Known issues: - * redtube: broken (verify -> http/404) - - -Version 2.2.6 -(September 14, 2009) - - User-visible changes: - * Fix: liveleak: "error: Unsupported protocol (http/1)" (closes #36) - * Fix: vimeo: title parsing (Thanks to Peter Baranyi for the fix, closes #37) - - Fixes title issues with accented chars - * Fix: break: http/403 (Thanks to Werner Elsler for the fix, closes #38) - - Developer-visible changes: - * t/11redtube.t: fix dead link - - -Version 2.2.5 -(August 14, 2009) - - User-visible changes: - * Add: --print-fname option - * Fix: dailymotion ID parsing - * Fix: --hosts: dailymotion: spak-mini -> spark-mini - * Zeropad ETA - - Developer-visible changes: - * Correct copyright years and notices in source code - * tlinks/youtube-utf8.url: fix dead link - - -Version 2.2.4 -(August 2, 2009) - - User-visible changes: - * Add: - # --stream-pass option (port from cclive) - # funnyhub support - * Port from cclive - # myubo support - * Port from cclive - # clipfish support - * Thanks to Patrick Hoffmann <patrick@sobran.de> for data mining - * Fix: - # Misc. typos in manual - # Redtube support (videoid/title parsing issues) - # Dailymotion: spak-mini -> spark-mini - * Change: - # replace dashes ("-") with underscores ("_") in video ids - - Developer-visible changes: - * Add: - # Host/Clipfish.pm
View file
clive-2.2.22.tar.bz2/examples/config
Deleted
@@ -1,23 +0,0 @@ -# clive reads ~/.cliverc by default. You can use --home-dir and -# CLIVE_HOME environment variable to change that. - -# You can add any of the supported command line options to clive -# configuration file. For example: - -#--format=mp4 -#-f mp4 -#--proxy=foo:1234 -#--cache-read -#--no-cache -#--save-dir=/home/user/videos - -# Note that the "dashed" command line options have aliases, so -# you can use any of the aliases as well, for example: - -# --no-cache -# --no_cache -# --nocache - -# If you are unsure about the command line options, see the output of -# "clive --help" output or refer to the clive manual page for a complete -# list of the supported command line options.
View file
clive-2.2.22.tar.bz2/lib
Deleted
-(directory)
View file
clive-2.2.22.tar.bz2/lib/clive
Deleted
-(directory)
View file
clive-2.2.22.tar.bz2/lib/clive/App.pm
Deleted
@@ -1,256 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::App; - -use warnings; -use strict; - -use base 'Class::Singleton'; - -use clive::Log; -use clive::Error qw( - CLIVE_OK - CLIVE_NOTHINGTODO - CLIVE_NOSUPPORT - CLIVE_READ -); -use clive::Config; -use clive::Curl; -use clive::Cache; -use clive::Exec; - -sub new { - my $class = shift; - return bless( {}, $class ); -} - -sub main { - my $self = shift; - - clive::Config->instance->init; - clive::Curl->instance->init; - clive::Log->instance->init; - clive::Cache->instance->init; - clive::Exec->instance->init; - - _parseInput(); - - exit( clive::Log->instance->returnCode ); -} - -sub _parseInput { - my $self = shift; - - $self->{queue} = ; - - my $config = clive::Config->instance->config; - - # Read from recall file. - if ( $config->{recall} and -e $config->{recall_file} ) { - if ( open( my $fh, "<", $config->{recall_file} ) ) { - _parseLine( $self, $_ ) while (<$fh>); - close($fh); - } - else { - clive::Log->instance->errn( CLIVE_READ, - "$config->{recall_file}: $!" ); - } - } - - # From cache (grep). - if ( $config->{cache_grep} ) { - my $cache = clive::Cache->instance; - foreach ( @{ $cache->grepQueue } ) { - push( @{ $self->{queue} }, $_ ); - } - } - - # Use argv. - _parseLine( $self, $_ ) foreach (@ARGV); - - # Default to STDIN. - if ( scalar( @{ $self->{queue} } ) == 0 - && scalar( @ARGV == 0 ) ) - { - _parseLine( $self, $_ ) while (<STDIN>); - } - - my $cache = clive::Cache->instance; - my $curl = clive::Curl->instance; - my $log = clive::Log->instance; - - require clive::HostFactory; - require clive::Video; - - foreach ( @{ $self->{queue} } ) { - my $host = clive::HostFactory->new($_); - if ($host) { - my $props = clive::Video->new; - $props->page_link($_); - - my $rc = 0; - - # Read from cache. - if ( $cache->enabled() && $config->{cache_read} ) { - $rc = $cache->read( \$props ); - if ( $rc == 1 && $props->video_format() ne $config->{format} ) - { - - # Cache: video format != requested format -> re-fetch. - $rc = 0; - } - } - - # Cache failed or record did not exist. Fetch the video page. - if ( $rc == 0 ) { - my $content; - - $rc = $curl->fetchToMem( $props->page_link, \$content ); - - if ( $rc == 0 ) { - - $props->page_title( \$content ); - $rc = $host->parsePage( \$content, \$props ); - - if ( $rc == 0 ) { - $rc = $curl->queryFileLength( \$props ); - if ( $rc == 0 ) { - $props->video_format( $config->{format} ); - $cache->write( \$props ); - } - } - } - } - - # Cache record found. - else { - $log->out("cache $_ ...done\n"); - $rc = 0; - } - - # If everything went OK so far, proceed to extract etc. - if ( $rc == 0 ) { - - push( @{ $self->{passed_queue} }, $_ ); - - $props->formatOutputFilename; - - if ( $props->nothing_todo ) { - $log->err( CLIVE_NOTHINGTODO, - "file already retrieved; nothing todo" ); - clive::Exec->instance->queue( \$props ); - next; - } - - if ( $config->{no_extract} ) { - $props->printVideo; - } - elsif ( $config->{emit_csv} ) { - $props->emitCSV; - } - elsif ( $config->{stream_pass} ) { - clive::Exec->instance->passStream( \$props ); - } - else { - if ( $config->{print_fname} ) { - $props->printVideo; - } - if ( $curl->fetchToFile( \$props ) == 0 ) { - clive::Exec->instance->queue( \$props ); - } - } - } - elsif ( $rc == 0xff ) { - - # Purpose: dump (cctv) video segment links to terminal. - # a.k.a. "One link leads to many video segment links." - # a.k.a. "Something we never had even thought of." - # We skip quite a few steps with this chunk of joy. - } - } - else { - $log->err( CLIVE_NOSUPPORT, "no support: $_" ); - } - } - - clive::Exec->instance->runExec; - - # Update recall file. - if ( $log->returnCode == CLIVE_OK ) { - if ( open( my $fh, ">", $config->{recall_file} ) ) {
View file
clive-2.2.22.tar.bz2/lib/clive/Cache.pm
Deleted
@@ -1,231 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Cache; - -use warnings; -use strict; - -use base 'Class::Singleton'; - -use clive::Video; -use clive::Error qw(CLIVE_OK CLIVE_GREP); - -use constant DEFAULT_DUMP_FORMAT => qq/%n: %t %f, %mMB/; - -sub init { - my $self = shift; - - my $config = clive::Config->instance->config; - - $self->{enabled} = 0; - - eval("require BerkeleyDB"); - $self->{enabled} = 1 - if ( !$@ && !$config->{no_cache} ); - - if ( $self->{enabled} ) { - require Digest::SHA; - - my %cache; - my $handle = tie( - %cache, "BerkeleyDB::Hash", - -Filename => $config->{cache_file}, - -Flags => BerkeleyDB->DB_CREATE - ) or die "error: cannot open $config->{cache_file}: $!\n"; - - $self->{handle} = $handle; - $self->{cache} = \%cache; - - if ( $config->{cache_dump} ) { - _dumpCache($self); - } - elsif ( $config->{cache_grep} ) { - _grepCache($self); - } - elsif ( $config->{cache_clear} ) { - _clearCache($self); - } - } - else { - if ( $config->{cache_dump} || $config->{cache_grep} ) { - die "error: requires BerkeleyDB module\n"; - } - } -} - -sub enabled { - my $self = shift; - return $self->{enabled}; -} - -sub read { - my $self = shift; - return (1) if !$self->{enabled}; - return _mapRecord( $self, @_ ); -} - -sub write { - my $self = shift; - return if !$self->{enabled}; - my $props = shift; - my $hash = Digest::SHA::sha1_hex( $$props->page_link ); - $self->{cache}{$hash} = $$props->toCacheRecord; - $self->{handle}->db_sync(); -} - -sub grepQueue { - my $self = shift; - $self->{grep_queue}; -} - -sub _mapRecord { - my ( $self, $props, $hash ) = @_; - $hash = Digest::SHA::sha1_hex( $$props->page_link ) - if ( !$hash ); - - # Key order matters. Keep in sync with clive::Video::toCacheRecord order. - if ( $self->{cache}{$hash} ) { - my @values = split( /#/, $self->{cache}{$hash} ); - my @keys = qw( - page_title page_link video_id video_link - video_host video_format file_length file_suffix - content_type time_stamp - ); - my $i = 0; - my %record = map { $_ => $values $i++ } @keys; - $$props->fromCacheRecord( \%record ); - return (1); - } - return (0); -} - -sub _dumpCache { - my $self = shift; - - my $config = clive::Config->instance->config; - my $dumpfmt = $config->{cache_dump_format} || DEFAULT_DUMP_FORMAT; - my $props = clive::Video->new - ; # Reuse this rather than re-create it for each record. - - my $i = 1; - print _formatDump( $self, $dumpfmt, $_, \$props, $i++ ) . "\n" - foreach ( keys %{ $self->{cache} } ); - - exit(CLIVE_OK); -} - -sub _grepCache { - my $self = shift; - - my $config = clive::Config->instance->config; - my $dumpfmt = $config->{cache_dump_format} || DEFAULT_DUMP_FORMAT; - my $props = clive::Video->new - ; # Reuse this rather than re-create it for each record. - - my $g - = $config->{cache_ignore_case} - ? qr|$config->{cache_grep}|i - : qr|$config->{cache_grep}|; - - $self->{grep_queue} = ; - my $i = 1; - foreach ( keys %{ $self->{cache} } ) { - my $dumpstr = _formatDump( $self, $dumpfmt, $_, \$props, $i++ ); - my @e = split( /#/, $self->{cache}{$_} ); - if ( grep /$g/, @e ) { - push( @{ $self->{grep_queue} }, $props->page_link ); - print "$dumpstr\n" - if ( $config->{cache_remove_record} ); - } - } - - if ( $config->{cache_remove_record} ) { - if ( scalar( @{ $self->{grep_queue} } ) > 0 ) { - print("Confirm delete (y/N):"); - $_ = lc <STDIN>; - chomp; - if ( lc $_ eq "y" ) { - foreach ( @{ $self->{grep_queue} } ) { - my $hash = Digest::SHA::sha1_hex($_); - delete $self->{cache}{$hash}; - } - } - exit(CLIVE_OK); - } - } - if ( scalar( @{ $self->{grep_queue} } ) == 0 ) { - clive::Log->instance->err( CLIVE_GREP, - "nothing matched $g in cache" ); - exit(CLIVE_GREP); - } -} - -sub _formatDump { - my ( $self, $dumpfmt, $hash, $props, $index ) = @_; - - if ( _mapRecord( $self, $props, $hash ) ) { - my $title = $$props->page_title; - my $id = $$props->video_id; - my $host = $$props->video_host; - my $len = $$props->file_length; - my $mb = sprintf( "%.1f", clive::Util::toMB($len) ); - my $tstamp = $$props->time_stamp; - my ( $date, $time ) = ( split( / /, $tstamp ) ); - my $format = $$props->video_format; - $index = sprintf( "%04d", $index ); - - my $fmt = $dumpfmt; - $fmt =~ s/%t/$title/g; - $fmt =~ s/%i/$id/g; - $fmt =~ s/%h/$host/g;
View file
clive-2.2.22.tar.bz2/lib/clive/Compat.pm
Deleted
@@ -1,111 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Compat; - -use warnings; -use strict; - -use clive::Error qw(CLIVE_OK CLIVE_READ); -use clive::Util; - -# Upgrades clive 2.0/2.1 config to 2.2+ format. -sub upgradeConfig { - require File::Spec; - my $path - = File::Spec->catfile( $ENV{HOME}, ".config", "clive", "config" ); - - require Config::Tiny; - print("Verify $path.\n"); - my $c = Config::Tiny->read($path); - - if ( !$c ) { - log->errn( "$path: " . Config::Tiny->errstr ); - exit(CLIVE_READ); - } - - my %opts = ( - connect_timeout => $c->{http}->{connect_timeout}, - connect_timeout_socks => $c->{http}->{connect_timeout_socks}, - agent => $c->{http}->{agent}, - proxy => $c->{http}->{proxy}, - limit_rate => $c->{http}->{limit_rate}, - format => $c->{output}->{format}, - save_dir => $c->{output}->{savedir}, - cclass => $c->{output}->{cclass}, - filename_format => $c->{output}->{filename_format}, - format => $c->{output}->{format}, - cache_dump_format => $c->{output}->{show}, - exec => $c->{commands}->{exec}, - stream_exec => $c->{commands}->{stream}, - - # Obsolete in 2.2: - #progress => $c->{_}->{progress}, - #ytuser => $c->{youtube}->{user}, - #ytpass => $c->{youtube}->{pass }, - #clivepass => $c->{commands}->{clivepass}, - ); - - my $data; - while ( ( my $i ) = each(%opts) ) { - $data .= qq/--$i="$opts{$i}"\n/ - if ( $opts{$i} ); - } - - if ( !$data ) { - my $a = clive::Util::prompt( - "error: Nothing to upgrade -- View file? (Y/n):"); - system("less $path") - if ( $a ne "n" ); - exit(CLIVE_OK); - } - - open my $fh, ">", "$path.new" - or print( STDERR "error: $path.new: $!" ) - and exit(CLIVE_READ); - - print $fh $data; - close $fh; - - my $a = clive::Util::prompt("View differences? (Y/n):"); - system("diff -u $path $path.new | less") - if ( $a ne "n" ); - - $a = clive::Util::prompt("Overwrite with new config? (y/N):"); - exit(CLIVE_OK) - unless ( $a eq "y" ); - - print("Backup -> $path.old\n"); - $c->write("$path.old"); - - print("Upgrade.\n"); - require File::Copy; - File::Copy::move( "$path.new", "$path" ) - or print( STDERR "error: move: $!" ) - and exit(CLIVE_READ); - print("Done.\n"); - - exit(CLIVE_OK); -} - -1; - -# A wildcat did growl.
View file
clive-2.2.22.tar.bz2/lib/clive/Config.pm
Deleted
@@ -1,200 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Config; - -use warnings; -use strict; - -use base 'Class::Singleton'; - -use Getopt::ArgvFile( - home => 1, - startupFilename => qw(.cliverc .clive/config .config/clive/config), -); - -use Getopt::Long qw(:config bundling); -use File::Spec::Functions; -use File::Path qw(mkpath); -use Cwd qw(getcwd); - -use clive::HostFactory; -use clive::Compat; -use clive::Error qw(CLIVE_OK CLIVE_OPTARG); - -use version 0.77 (); our $VERSION = version->declare ("2.2.22"); - -sub init { - my $self = shift; - - my %config; - - GetOptions( - \%config, - 'debug', 'exec=s', 'cclass=s', 'stream=i', - 'continue|c', 'recall|l', 'format|f=s', 'agent=s', - 'quiet|q', 'proxy=s', 'stderr', - 'hosts' => \&clive::HostFactory::dumpHosts, - 'version|v' => \&_printVersion, - 'license' => \&_printLicense, - 'help|h', => \&_printHelp, - - 'cache_read|cache-read|cacheread|r', - 'cache_dump|cache-dump|cachedump|d', - 'cache_grep|cache-grep|cachegrep|g=s', - 'cache_remove_record|cache-remove-record|cacheremoverecord|D', - 'cache_ignore_case|cache_ignore-case|cacheignorecase|i', - 'cache_dump_format|cache-dump-format|cachedumpformat=s', - 'cache_clear|cache-clear|cacheclear', - 'no_cache|no-cache|nocache', - 'no_extract|no-extract|noextract|n', - 'no_proxy|no-proxy|noproxy', - 'filename_format|filename-format|filenameformat=s', - 'emit_csv|emit-csv|emitcsv', - 'stream_exec|stream-exec|streamexec=s', - 'stream_pass|stream-pass|streampass|s', - 'output_file|output-file|outputfile|O=s', - 'limit_rate|limit-rate|limitrate=i', - 'connect_timeout|connect-timeout|connecttimeout=i', - 'connect_timeout_socks|connect-timeout-socks|connecttimeoutsocks=i', - 'save_dir|save-dir|savedir=s', - 'recall_file|recall-file|recallfile=s', - 'cache_file|cache-file|cachefile=s', - 'no_cclass|no-cclass|nocclass|C', - 'stop_after|stop-after|stopafter=s', - 'exec_run|exec-run|execrun|e', - 'upgrade_config|upgrade-config|upgradeconfig' => - \&clive::Compat::upgradeConfig, - 'cookie_jar|cookie-jar|cookiejar=s', - 'print_fname|print-fname|printfname', - ) or exit(CLIVE_OPTARG); - - my $homedir = $ENV{HOME} || getcwd(); - - my $cachedir = $ENV{CLIVE_CACHE} - || catfile( $homedir, ".cache", "clive" ); - - eval { mkpath($cachedir) }; - die "$cachedir: $@" - if ($@); - - $config{recall_file} ||= catfile( $cachedir, "last" ); - $config{cache_file} ||= catfile( $cachedir, "cache" ); - - $config{format} ||= 'default'; - - # Check format. - - # Youtube: For backward compatibility only. - my @youtube_orig = qw (fmt17 fmt18 fmt22 fmt34 fmt35 fmt37 fmt43 fmt45); - - my @youtube_old = - qw (mobile sd_270p sd_360p hq_480p hd_720p hd_1080p); - - my @youtube_arcane = qw (mp4 hd hq 3gp); - - # These are the most current ones, also listed with --hosts. Refer - # to clive/Host/Youtube.pm for details. - - my @youtube_latest = - qw (flv_240p flv_360p flv_480p mp4_360p mp4_720p mp4_1080p - mp4_3072p webm_480p webm_720p 3gp_144p); - - # Other: - - my @spiegel = # vp6_388=default - qw(vp6_64 vp6_576 vp6_928 h264_1400 small iphone podcast); - - my @golem = qw(high ipod); # medium=default - - my @formats = ( - qw(default best), - @youtube_orig, @youtube_old, @youtube_arcane, @youtube_latest, - @spiegel, @golem - ); - - #unless (@formats ~~ $config{format}) { # Perl 5.10.0+ - unless ( grep( /^$config{format}$/, @formats ) ) { - clive::Log->instance->err( CLIVE_OPTARG, - "unsupported format `$config{format}'" ); - exit(CLIVE_OPTARG); - } - - my $log = clive::Log->instance; - my $str = "%s depends on --stream-exec which is undefined"; - - # Check streaming options. - - if ( $config{stream} && !$config{stream_exec} ) { - $log->err( CLIVE_OPTARG, sprintf( $str, "--stream" ) ); - exit(CLIVE_OPTARG); - } - - if ( $config{stream_pass} && !$config{stream_exec} ) { - $log->err( CLIVE_OPTARG, sprintf( $str, "--stream-pass" ) ); - exit(CLIVE_OPTARG); - } - - # Check --stop-after. - if ( $config{stop_after} ) { - if ( $config{stop_after} !~ /M$/ - && $config{stop_after} !~ /%$/ ) - { - clive::Log->instance->err( CLIVE_OPTARG, - "--stop-after must be terminated by either '%' or 'M'" ); - exit(CLIVE_OPTARG); - } - } - - $self->{config} = \%config; -} - -sub config { - my $self = shift; - return $self->{config}; -} - -sub _printLicense { - print - "Copyright (C) 2007,2008,2009,2010 Toni Gundogdu. License: GNU GPL version 3+ -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -"; - exit CLIVE_OK; -} - -sub _printVersion { - printf "clive version %s with WWW::Curl version $WWW::Curl::VERSION\n" - . "os=%s, perl=%s, locale=%s\n", - $VERSION, $^O, ( sprintf "%vd", $^V ), $ENV{LANG} || "?"; - exit CLIVE_OK; -} - -sub _printHelp { - - # Edit bin/clive for --help contents. - require Pod::Usage; - Pod::Usage::pod2usage( -exitstatus => CLIVE_OK, -verbose => 1 ); -} - -1; -
View file
clive-2.2.22.tar.bz2/lib/clive/Curl.pm
Deleted
@@ -1,289 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Curl; - -use warnings; -use strict; - -use base 'Class::Singleton'; - -use WWW::Curl::Easy 4.05; -use Cwd; -use Encode qw(from_to decode_utf8 FB_CROAK); - -use clive::Error qw(CLIVE_NET CLIVE_STOP); - -my $bp; - -sub init { - my ($self, $config) = (shift, clive::Config->instance->config); - - my $c = WWW::Curl::Easy->new; - $c->setopt( CURLOPT_USERAGENT, $config->{agent} || "Mozilla/5.0" ); - $c->setopt( CURLOPT_FOLLOWLOCATION, 1 ); - $c->setopt( CURLOPT_AUTOREFERER, 1 ); - $c->setopt( CURLOPT_HEADER, 1 ); - $c->setopt( CURLOPT_NOBODY, 0 ); - # Ideally we'd set this for dailymotion only, as quvi does, but - # the current (2.2) code would require too many changes to do this. - $c->setopt( CURLOPT_COOKIE, "family_filter=off" ); - - $c->setopt( CURLOPT_VERBOSE, 1 ) - if $config->{debug}; - - $c->setopt( CURLOPT_PROXY, $config->{proxy} ) - if $config->{proxy}; - - $c->setopt( CURLOPT_PROXY, "" ) - if $config->{no_proxy}; - - $c->setopt( CURLOPT_COOKIEJAR, $config->{cookie_jar} ) - if $config->{cookie_jar}; - - $self->{handle} = $c; -} - -sub setTimeout { - my ( $self, $no_socks_timeout ) = @_; - - my $config = clive::Config->instance->config; - - $self->{handle} - ->setopt( CURLOPT_CONNECTTIMEOUT, $config->{connecttimeout} || 30 ); - - $self->{handle} - ->setopt( CURLOPT_TIMEOUT, $config->{connecttimeoutsocks} || 30 ) - unless $no_socks_timeout; -} - -sub resetTimeout { - - # Resetting SOCKS timeout is sufficient. - my $self = shift; - $self->{handle}->setopt( CURLOPT_TIMEOUT, 0 ); -} - -sub fetchToMem { - my ( $self, $url, $content, $what ) = @_; - - my $log = clive::Log->instance; - - my $_what = $what || $url; - $log->out("fetch $_what ..."); - - $self->{handle}->setopt( CURLOPT_URL, $url ); - $self->{handle}->setopt( CURLOPT_ENCODING, "" ); - - $$content = ""; - open( my $fh, ">", $content ); - - $self->{handle}->setopt( CURLOPT_WRITEDATA, $fh ); - - setTimeout($self); - my $rc = $self->{handle}->perform; - resetTimeout($self); - - close($fh); - - if ( $rc == 0 ) { - my $httpcode = $self->{handle}->getinfo(CURLINFO_RESPONSE_CODE); - if ( $httpcode == 200 ) { - $log->out("done.\n"); - $rc = 0; - } - else { - $log->errn( CLIVE_NET, - $self->{handle}->strerror($httpcode) . " (http/$httpcode)" ); - $rc = 1; - } - } - else { - $log->errn( CLIVE_NET, - $self->{handle}->strerror($rc) . " (http/$rc)" ); - $rc = 1; - } - - from_to( $$content, $1, "utf8" ) - if ( $$content =~ /charset=(.*?)"/ ); - - from_to( $$content, $1, "utf8" ) - if ( $$content =~ /encoding="(.*?)"/ ); - - $$content = decode_utf8( $$content, Encode::FB_CROAK ); - - return ($rc); -} - -sub queryFileLength { - my ( $self, $props ) = @_; - - my $log = clive::Log->instance; - $log->out("verify video link ..."); - - my $buffer = ""; - open( my $fh, ">", \$buffer ); - - $self->{handle}->setopt( CURLOPT_URL, $$props->video_link ); - $self->{handle}->setopt( CURLOPT_WRITEDATA, $fh ); - - # GET -> HEAD. - $self->{handle}->setopt( CURLOPT_NOBODY, 1 ); - - setTimeout($self); - my $rc = $self->{handle}->perform; - resetTimeout($self); - close($fh); - - # HEAD -> GET. - $self->{handle}->setopt( CURLOPT_HTTPGET, 1 ); - - if ( $rc == 0 ) { - my $httpcode = $self->{handle}->getinfo(CURLINFO_RESPONSE_CODE); - if ( $httpcode == 200 || $httpcode == 206 ) { - $$props->file_length( - $self->{handle}->getinfo(CURLINFO_CONTENT_LENGTH_DOWNLOAD) ); - - my $content_type - = $self->{handle}->getinfo(CURLINFO_CONTENT_TYPE); - $$props->content_type($content_type); - - # Figure out file suffix. - if ( $content_type =~ /\/(.*)/ ) { - my $suffix = $1; # Default to whatever was matched. - if ( $1 =~ /octet/ - || $1 =~ /plain/ - || $1 =~ /swf/ - || $1 =~ /flash/ ) - { - - # Otherwise use "flv" for the above exceptions. - $suffix = "flv"; - } - $suffix =~ tr{x-}//d; # e.g. x-flv -> flv. - $$props->file_suffix($suffix); - $log->out("done.\n"); - return (0); - } - else { - $log->errn( CLIVE_NET, - "$content_type: unexpected content-type" ); - } - } - else { - $log->errn( CLIVE_NET, - $self->{handle}->strerror($httpcode) . " (http/$httpcode)" ); - } - } - else { - $log->errn( CLIVE_NET, - $self->{handle}->strerror($rc) . " (http/$rc)" ); - }
View file
clive-2.2.22.tar.bz2/lib/clive/Error.pm
Deleted
@@ -1,60 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009,2010 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Error; - -require Exporter; - -our @ISA = qw(Exporter); - -use constant { - CLIVE_OK => 0, - CLIVE_NOTHINGTODO => 1, # file already retrieved - CLIVE_NOSUPPORT => 2, # host not supported - CLIVE_READ => 3, # file open/read error - CLIVE_GREP => 4, # grep: nothing matched in cache - CLIVE_OPTARG => 5, # invalid option argument - CLIVE_SYSTEM => 6, # system call failed (e.g. fork) - CLIVE_REGEXP => 7, # regexp pattern matching failed - CLIVE_FORMAT => 8, # requested format unavailable - CLIVE_NET => 9, # network error - CLIVE_STOP => 10, # --stop-after - CLIVE_MARKEDBROKEN => 11, # support marked broken -}; - -our @EXPORT_OK = qw( - CLIVE_OK - CLIVE_NOTHINGTODO - CLIVE_NOSUPPORT - CLIVE_READ - CLIVE_GREP - CLIVE_OPTARG - CLIVE_SYSTEM - CLIVE_REGEXP - CLIVE_FORMAT - CLIVE_NET - CLIVE_STOP - CLIVE_MARKEDBROKEN -); - -1; - -# Outside in the cold distance.
View file
clive-2.2.22.tar.bz2/lib/clive/Exec.pm
Deleted
@@ -1,154 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Exec; - -use warnings; -use strict; - -use base 'Class::Singleton'; - -use clive::Error qw(CLIVE_OK CLIVE_OPTARG CLIVE_SYSTEM); - -sub init { - my $self = shift; - $self->{exec_queue} = ; - $self->{stream_flag} = 0; - $self->{stream_pid} = -1; - - my $config = clive::Config->instance->config; - if ( $config->{exec} ) { - if ( $config->{exec} !~ /;+$/ ) { - clive::Log->instance->err( CLIVE_OPTARG, - "--exec expression must be " - . "terminated by either ';' or '+'" ); - exit(CLIVE_OPTARG); - } - } - - if ( !$config->{exec} && $config->{exec_run} ) { - clive::Log->instance->err( CLIVE_OPTARG, - "--exec-run depends on --exec" ); - exit(CLIVE_OPTARG); - } -} - -sub queue { - my $self = shift; - if (@_) { - my $config = clive::Config->instance->config; - if ( $config->{exec} && $config->{exec_run} ) { - my $props = shift; - push( @{ $self->{exec_queue} }, $$props->filename ); - } - } - return $self->{exec_queue}; -} - -sub runExec { - my $config = clive::Config->instance->config; - return if !$config->{exec_run}; - - my $self = shift; - if ( $config->{exec} =~ /;$/ ) { # Semi - foreach ( @{ $self->{exec_queue} } ) { - my $cmd = $config->{exec}; - $cmd =~ s/%i/"$_"/g; - $cmd =~ tr{;}//d; - system("$cmd"); - } - } - else { # Plus - my $cmd = sprintf( "%s ", $config->{exec} ); - $cmd =~ s/%i//g; - $cmd =~ tr{+}//d; - $cmd .= sprintf( '"%s" ', $_ ) foreach ( @{ $self->{exec_queue} } ); - system("$cmd"); - } -} - -sub resetStream { - my $self = shift; - - waitpid( $self->{stream_pid}, 0 ) - if $self->{stream_flag}; - - $self->{stream_flag} = 0; - $self->{stream_pid} = -1; -} - -sub runStream { - my ( $self, $percent, $props ) = @_; - my $config = clive::Config->instance->config; - if ( $config->{stream} - && $config->{stream_exec} - && !$self->{stream_flag} ) - { - _forkStreamer( $self, \$config, $props ) - if ( $percent >= $config->{stream} ); - } -} - -sub passStream { - my ( $self, $props ) = @_; - - my $config = clive::Config->instance->config; - my $cmd = $config->{stream_exec}; - my $lnk = $$props->video_link; - - $cmd =~ s/%i/"$lnk"/g; - - my $log = clive::Log->instance; - $log->out("stream ..."); - - my $n = system($cmd); - - if ( $n == 0 ) { - $log->out("done.\n"); - } - elsif ( $n == -1 ) { - $log->errn( CLIVE_SYSTEM, "failed to execute: `$!'" ); - } - else { - $log->errn( CLIVE_SYSTEM, "child exited with: " . ( $n >> 8 ) ); - } -} - -sub _forkStreamer { - my ( $self, $config, $props ) = @_; - - $self->{stream_flag} = 1; - my $child = fork; - if ( $child < 0 ) { - clive::Log->instance->errn( CLIVE_SYSTEM, "fork: $!" ); - } - elsif ( $child == 0 ) { - my $cmd = $$config->{stream_exec}; - my $fname = $$props->filename; - $cmd =~ s/%i/"$fname"/g; - system("$cmd"); - exit(CLIVE_OK); - } -} - -1; - -# Businessmen they, they drink my wine.
View file
clive-2.2.22.tar.bz2/lib/clive/Host
Deleted
-(directory)
View file
clive-2.2.22.tar.bz2/lib/clive/Host/Break.pm
Deleted
@@ -1,62 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Host::Break; - -# Rewritten from the original code contribution by Jan Hulsbergen -# <afoo@gmail.com> which was written in Python for clive 1.0. - -use warnings; -use strict; - -sub new { - return bless( {}, shift ); -} - -sub parsePage { - my ( $self, $content, $props ) = @_; - - $$props->video_host("break"); - - my %re = ( - id => qr|sGlobalContentID='(.*?)'|, - fname => qr|sGlobalFileName='(.*?)'|, - fhash => qr|flashVars.icon = \"(.*?)\"|, - title => qr|id="vid_title" content="(.*?)"| - ); - - my $tmp; - if ( clive::Util::matchRegExps( \%re, \$tmp, $content ) == 0 ) { - - my $xurl = "$tmp->{fname}.flv?$tmp->{fhash}"; - - $$props->video_id( $tmp->{id} ); - $$props->page_title( undef, $tmp->{title} ); - $$props->video_link($xurl); - - return (0); - } - return (1); -} - -1; - -# Ploughmen dig my earth.
View file
clive-2.2.22.tar.bz2/lib/clive/Host/Buzzhumor.pm
Deleted
@@ -1,51 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2010 Toni Gundogdu. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Host::Buzzhumor; - -use warnings; -use strict; - -sub new { - return bless( {}, shift ); -} - -sub parsePage { - my ( $self, $content, $props ) = @_; - - $$props->video_host("buzzhumor"); - - my %re = ( - id => qr|/videos/(\d+)/|, - lnk => qr|&file=(.*?)"| - ); - - my $tmp; - if ( clive::Util::matchRegExps( \%re, \$tmp, $content ) == 0 ) { - - $$props->video_id( $tmp->{id} ); - $$props->video_link( $tmp->{lnk} ); - - return (0); - } - - return (1); -} - -1;
View file
clive-2.2.22.tar.bz2/lib/clive/Host/Clipfish.pm
Deleted
@@ -1,76 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Host::Clipfish; - -use warnings; -use strict; - -sub new { - return bless( {}, shift ); -} - -sub parsePage { - my ( $self, $content, $props ) = @_; - - $$props->video_host("clipfish"); - - my %re = ( id => qr|/video/(.*?)/| ); - - my $tmp; - if ( clive::Util::matchRegExps( \%re, \$tmp, \$$props->page_link ) == 0 ) - { - my $url - = "http://www.clipfish.de/video_n.php?p=0|DE&vid=" . $tmp->{id}; - - if ( _fetchConfig( $self, $url ) == 0 ) { - - $$props->video_id( $tmp->{id} ); - $$props->video_link( $self->{video_link} ); - - return (0); - } - } - return (1); -} - -sub _fetchConfig { - my ( $self, $url ) = @_; - - my $curl = clive::Curl->instance; - - my $content; - if ( $curl->fetchToMem( $url, \$content, "config" ) == 0 ) { - - my %re = ( xurl => qr|\&url=(.*?)\&| ); - - my $tmp; - if ( clive::Util::matchRegExps( \%re, \$tmp, \$content ) == 0 ) { - - $self->{video_link} = $tmp->{xurl}; - - return (0); - } - } - return (1); -} - -1;
View file
clive-2.2.22.tar.bz2/lib/clive/Host/Dailymotion.pm
Deleted
@@ -1,134 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009,2010,2011 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Host::Dailymotion; - -use warnings; -use strict; - -use clive::Error qw(CLIVE_REGEXP CLIVE_NOSUPPORT); - -sub new { return bless ({}, shift); } - -sub parsePage { - - my ($self, $content, $props) = @_; - - $$props->video_host("dailymotion"); - - if ($$content =~ /SWFObject\("http:/) { - - clive::Log->instance->err(CLIVE_NOSUPPORT, - "Looks like a partner video. Refusing to continue."); - - return 1; - } - - # Match video ID, title. - - my %re = ( - id => qr|video/(.*?)_|, - title => qr|title="(.*?)"|, - ); - - my ($tmp, $lnk); - - return 1 if clive::Util::matchRegExps (\%re, \$tmp, $content) != 0; - - # Some videos have only one link available. - - if ($$content =~ /"video", "(.*?)"/) - { $lnk = $1; } - - else { - my $r; - ($r,$lnk) = parseVideoURL ($self, $content); - return $r unless $r == 0; - } - - if (not defined $lnk) { - clive::Log->instance->err (CLIVE_REGEXP, "no match: video URL"); - return 1; - } - - # Cleanup video link. - - $lnk =~ s/%5C//g; - - require URI::Escape; - $lnk = URI::Escape::uri_unescape ($lnk); - - # Set video properties. - - $$props->video_id ($tmp->{id}); - $$props->page_title (undef, $tmp->{title}); - $$props->video_link ($lnk); - - return 0; -} - -sub parseVideoURL { - - my ($self, $content) = @_; - my $lnk; - - # Match available formats. - - my $re = qr|%22(\w\w)URL%22%3A%22(.*?)%22|; - my %lst = $$content =~ /$re/gm; - - if (keys %lst == 0) { - clive::Log->instance->err(CLIVE_REGEXP, "no match: `$re'"); - return (1, $lnk); - } - - # User requested format. - - my $format = clive::Config->instance->config->{format}; - $format = "sd" if $format eq "default"; # sd=default - - # Match requested format to a video link. - - foreach (qw/sd hq hd/) { - - if (not exists $lst{$_}) { - print STDERR "warning: `$_' not found in hash, ignored.\n"; - next; - } - - if ($format eq "best") - { $lnk = $lst{$_}; } - - elsif ($format eq $_) { - $lnk = $lst{$_}; - last; - } - - } - - # parsePage will take care of checking $lnk value. - - return (0, $lnk); -} - -1; - -# Nobody of it is worth.
View file
clive-2.2.22.tar.bz2/lib/clive/Host/Funnyhub.pm
Deleted
@@ -1,50 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Host::Funnyhub; - -use warnings; -use strict; - -sub new { - return bless( {}, shift ); -} - -sub parsePage { - my ( $self, $content, $props ) = @_; - - $$props->video_host("funnyhub"); - - my %re = ( - id => qr|/videofiles/(.*?)_|, - url => qr|"flv", "(.*?)"|, - ); - - my $tmp; - if ( clive::Util::matchRegExps( \%re, \$tmp, $content ) == 0 ) { - $$props->video_id( $tmp->{id} ); - $$props->video_link( $tmp->{url} ); - return (0); - } - return (1); -} - -1;
View file
clive-2.2.22.tar.bz2/lib/clive/Host/Gaskrank.pm
Deleted
@@ -1,52 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Host::Gaskrank; - -use warnings; -use strict; - -sub new { - return bless( {}, shift ); -} - -sub parsePage { - my ( $self, $content, $props ) = @_; - - $$props->video_host("gaskrank"); - - my %re = ( - id => qr|.+/(.*?).flv|, - xurl => qr|file=(.*?)"|, - ); - - my $tmp; - if ( clive::Util::matchRegExps( \%re, \$tmp, $content ) == 0 ) { - $$props->video_id( $tmp->{id} ); - $$props->video_link( $tmp->{xurl} ); - return (0); - } - return (1); -} - -1; - -# No reason to get excited.
View file
clive-2.2.22.tar.bz2/lib/clive/Host/Golem.pm
Deleted
@@ -1,117 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Host::Golem; - -use warnings; -use strict; - -# --format=(high|medium|ipod) -# high = hd -# medium = default (what we call "default" in clive) -# ipod = ipod - -# Note that we do not use "medium" at all. The host -# defaults to "medium" if "?q=" is not appended. -# Users do not need to bother themselves with this. - -# We use config:title instead of video page title -# if it can be parsed from the config. Saves us -# the trouble from cleaning up the <title>. - -sub new { - return bless( {}, shift ); -} - -sub parsePage { - my ( $self, $content, $props ) = @_; - - $$props->video_host("golem"); - - my %re = ( id => qr|"id", "(.*?)"| ); - - my $tmp; - if ( clive::Util::matchRegExps( \%re, \$tmp, $content ) == 0 ) { - my $url = "http://video.golem.de/xml/$tmp->{id}"; - if ( _fetchConfig( $self, $url, $tmp->{id} ) == 0 ) { - - $$props->page_title( undef, $self->{page_title} ) - if ( $self->{page_title} ); - - $$props->video_id( $tmp->{id} ); - $$props->video_link( $self->{video_link} ); - - return (0); - } - } - return (1); -} - -sub _fetchConfig { - my ( $self, $url, $id ) = @_; - - my $curl = clive::Curl->instance; - - my $content; - if ( $curl->fetchToMem( $url, \$content, "config" ) == 0 ) { - - my $xurl = "http://video.golem.de/download/$id"; - my $config = clive::Config->instance->config; - - my $title = $1 - if ( $content =~ /<title>(.*?)<\/title>/ ); - - my $fmt; - if ( $config->{format} eq "best" ) { - - my %re = ( path => qr|<filename>(.*?)</filename>| ); - my @fnames = $content =~ /$re{path}/g; - - foreach my $i (qw/hd sd ipod/) { - if ( my @b = grep( /$i/, @fnames ) ) { - $fmt = $b0; - last; - } - } - - $fmt =~ s/hd/high/; - $fmt =~ s/sd//; # medium - } - else { - $fmt = $config->{format}; - $fmt =~ s/default//; # medium (default) - } - - $xurl .= "?q=$fmt" - if $fmt; - - $self->{page_title} = $title; - $self->{video_link} = $xurl; - - return (0) - if $xurl; - } - return (1); -} - -1; - -# And the wind began to howl.
View file
clive-2.2.22.tar.bz2/lib/clive/Host/Google.pm
Deleted
@@ -1,73 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Host::Google; - -use warnings; -use strict; - -use clive::Error qw(CLIVE_FORMAT); - -sub new { - return bless( {}, shift ); -} - -sub parsePage { - my ( $self, $content, $props ) = @_; - - $$props->video_host("google"); - - my %re = ( - id => qr|docid:'(.*?)'|, - xurl => qr|videoUrl\\x3d(.*?)\\x26|, - ); - - my $tmp; - if ( clive::Util::matchRegExps( \%re, \$tmp, $content ) == 0 ) { - - my $mp4 = "http://$1=ck1" - if ( $$content =~ /http:\/\/(.*?)\=ck1/ ); - - my $config = clive::Config->instance->config; - - my $xurl; - if ( ( $config->{format} eq "mp4" || $config->{format} eq "best" ) - && $mp4 ) - - { - $xurl = $mp4; - } - else { - require URI::Escape; - $xurl = URI::Escape::uri_unescape( $tmp->{xurl} ); - } - - $$props->video_id( $tmp->{id} ); - $$props->video_link($xurl); - - return (0); - } - return (1); -} - -1; - -# The thief he kindly spoke.
View file
clive-2.2.22.tar.bz2/lib/clive/Host/Liveleak.pm
Deleted
@@ -1,85 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Host::Liveleak; - -use warnings; -use strict; - -sub new { - return bless( {}, shift ); -} - -sub parsePage { - my ( $self, $content, $props ) = @_; - - $$props->video_host("liveleak"); - - my %re = ( - id => qr|token=(.*?)'&|, - config => qr|'config','(.*?)'|, - ); - - my $tmp; - if ( clive::Util::matchRegExps( \%re, \$tmp, $content ) == 0 ) { - if ( _parseConfig( $self, $tmp->{config} ) == 0 ) { - $$props->video_id( $tmp->{id} ); - $$props->video_link( $self->{video_link} ); - return (0); - } - } - return (1); -} - -sub _parseConfig { - my ( $self, $url ) = @_; - - require URI::Escape; - $url = URI::Escape::uri_unescape($url); - - my $curl = clive::Curl->instance; - my $log = clive::Log->instance; - - my $content; - if ( $curl->fetchToMem( $url, \$content, "config" ) == 0 ) { - my %re = ( file => qr|<file>(.*?)</file>| ); - my $tmp; - if ( clive::Util::matchRegExps( \%re, \$tmp, \$content ) == 0 ) { - if ( $curl->fetchToMem( $tmp->{file}, \$content, "playlist" ) - == 0 ) - { - %re = ( location => qr|<location>(.*?)</location>| ); - $tmp = undef; - if (clive::Util::matchRegExps( \%re, \$tmp, \$content ) == 0 ) - { - $self->{video_link} = $tmp->{location}; - $self->{video_link} =~ tr/ //d; - return (0); - } - } - } - } - return (1); -} - -1; - -# There are many here among us.
View file
clive-2.2.22.tar.bz2/lib/clive/Host/Sevenload.pm
Deleted
@@ -1,94 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### - -# Rewritten from the original code contribution by Kai Wasserbach -# <debian@carbon-project.org> which was written in Python for clive 1.0. - -package clive::Host::Sevenload; - -use warnings; -use strict; - -use clive::Error qw(CLIVE_REGEXP); - -sub new { - return bless( {}, shift ); -} - -sub parsePage { - my ( $self, $content, $props ) = @_; - - $$props->video_host("sevenload"); - - my %re = ( config => qr|configPath=(.*?)"| ); - - my $tmp; - if ( clive::Util::matchRegExps( \%re, \$tmp, $content ) == 0 ) { - return _parseConfig( $self, $tmp->{config}, $props ); - } - return (1); -} - -sub _parseConfig { - my ( $self, $url, $props ) = @_; - - require URI::Escape; - $url = URI::Escape::uri_unescape($url); - - my $curl = clive::Curl->instance; - my $log = clive::Log->instance; - - my $content; - if ( $curl->fetchToMem( $url, \$content, "config" ) == 0 ) { - - my $re = qr|item id="(\w+)">\s+<title>(.*?)</|i; - - if ( $content =~ $re ) { - my ( $id, $title ) = ( $1, $2 ); - $$props->video_id($id); - $$props->page_title( undef, $title ); - } - else { - clive::Log->instance->err( CLIVE_REGEXP, "no match: `$re'" ); - return (1); - } - - $re = qr|location seeking="yes">(.*?)</|i; - - if ( $content =~ /$re/ ) { - my $lnk = $1; - $lnk =~ s/&/&/g; - $$props->video_link($lnk); - } - else { - clive::Log->instance->err( CLIVE_REGEXP, "no match: `$re'" ); - return (1); - } - - return (0); - } - return (1); -} - -1; - -# But ah, you and I we've been through that.
View file
clive-2.2.22.tar.bz2/lib/clive/Host/Spiegel.pm
Deleted
@@ -1,133 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Host::Spiegel; - -use warnings; -use strict; - -# The fetched config xml contains paths to -# 3gp, small, etc. but we are yet to find -# a working link to test them properly. - -# h264 and the vp_(*) videos seem to work OK. - -use clive::Curl; -use clive::Log; - -sub new { - return bless( {}, shift ); -} - -sub parsePage { - my ( $self, $content, $props ) = @_; - - $$props->video_host("spiegel"); - - my %re = ( id => qr|/video/video-(.*?)\.| ); - - my $id = $1 - if ( $$props->page_link =~ /$re{id}/ ); - - my $log = clive::Log->instance; - - if ( !$id ) { - $log->errn("not matched: `$re{id}'"); - return (1); - } - - # playlist: get title (html page does not disclose title) - if ( _fetchPlaylist( $self, $id ) == 0 ) { - - # config: get list of available videos - if ( _fetchConfig( $self, $id ) == 0 ) { - $$props->video_id($id); - $$props->page_title( undef, $self->{title} ); - $$props->video_link( $self->{video_link} ); - return (0); - } - } - return (1); -} - -sub _fetchPlaylist { - my ( $self, $id ) = @_; - - my $url = "http://www1.spiegel.de/active/playlist/fcgi/playlist.fcgi/" - . "asset=flashvideo/mode=id/id=$id"; - - my $curl = clive::Curl->instance; - - my $content; - if ( $curl->fetchToMem( $url, \$content, "playlist" ) == 0 ) { - my %re = ( headline => qr|<headline>(.*?)</headline>| ); - my $tmp; - if ( clive::Util::matchRegExps( \%re, \$tmp, \$content ) == 0 ) { - $self->{title} = $tmp->{headline}; - return (0); - } - } - return (1); -} - -sub _fetchConfig { - my ( $self, $id ) = @_; - - my $url = "http://video.spiegel.de/flash/$id.xml"; - my $curl = clive::Curl->instance; - - my $content; - if ( $curl->fetchToMem( $url, \$content, "config" ) == 0 ) { - my %re = ( - path => qr|<filename>(.*?)</filename>|, - rate => qr|_(\d+)\.| - ); - - my @fnames = $content =~ /$re{path}/g; - my $path = $fnames0; # default format - - my $config = clive::Config->instance->config; - - if ( $config->{format} eq "best" ) { - my %rates; # Ignores iphone, 3gp etc. - foreach (@fnames) { - $rates{$1} = $_ - if ( $_ =~ /$re{rate}/ ); - } - my $best = ( sort { $b <=> $a } keys %rates )0; - $path = $rates{$best}; - } - else { - if ( my @m = grep( /$config->{format}/i, @fnames ) ) { - $path = $m0; - } - } - if ($path) { - $self->{video_link} = "http://video.spiegel.de/flash/$path"; - return (0); - } - } - return (1); -} - -1; - -# Two riders were approaching.
View file
clive-2.2.22.tar.bz2/lib/clive/Host/Vimeo.pm
Deleted
@@ -1,89 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Host::Vimeo; - -use warnings; -use strict; - -use clive::Error qw(CLIVE_REGEXP); - -sub new { return bless ({}, shift); } - -sub parsePage { - my ( $self, $content, $props ) = @_; - - $$props->video_host("vimeo"); - - my $id = $1 if $$props->page_link =~ /vimeo\.com\/(\d+)/; - - unless ($1) { - clive::Log->instance->err (CLIVE_REGEXP, "no match: video id"); - return (1); - } - - my $config_url = "http://vimeo.com/moogaloop/load/clip:$1"; - my $rc = _parseConfig ($self, $config_url, $1); - - unless ($rc) { - $$props->video_id ($id); - $$props->video_link ($self->{video_link}); - } - - return ($rc); -} - -sub _parseConfig { - my ( $self, $url, $id ) = @_; - - my $curl = clive::Curl->instance; - - my $content; - if ( $curl->fetchToMem( $url, \$content, "config" ) == 0 ) { - my %re = ( - sig => qr|<request_signature>(.*?)</request_signature>|, - sig_exp => - qr|request_signature_expires>(.*?)</request_signature_expires>| - ); - - my $tmp; - if ( clive::Util::matchRegExps( \%re, \$tmp, \$content ) == 0 ) { - my $xurl = "http://vimeo.com/moogaloop/play/clip:$id" - . "/$tmp->{sig}/$tmp->{sig_exp}/?q="; - my $config = clive::Config->instance->config; - my $q = "sd"; - if ( $config->{format} eq "hd" - || $config->{format} eq "best" ) - { - if ( $content =~ /<hd_button>(.*?)<\/hd_button>/ ) { - $q = "hd" if ( $1 eq "1" ); - } - } - $xurl .= $q; - $self->{video_link} = $xurl; - return (0); - } - } - return (1); -} - -1; - -# So let us not talk falsely now.
View file
clive-2.2.22.tar.bz2/lib/clive/Host/Youtube.pm
Deleted
@@ -1,131 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009,2010 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Host::Youtube; - -use warnings; -use strict; - -sub new { return bless ({}, shift); } - -sub parsePage { - my ($self, $content, $props) = @_; - - $$props->video_host ("youtube"); - - my %re = ( - id => qr|&video_id=(.*?)&|, - fmt_url_map => qr|fmt_url_map=(.*?)&|, - ); - - my $tmp; - if (clive::Util::matchRegExps (\%re, \$tmp, $content) == 0) { - - my $best; - my %h; - - require URI::Escape; - - foreach (split /,/, URI::Escape::uri_unescape ($tmp->{fmt_url_map})) { - my ($id, $url) = split /\|/, $_; - $best = $url unless $best; - $h{$id} = $url; - } - - my $url; - - my $config = clive::Config->instance->config; - - if ($config->{format} eq 'best') { - $url = $best; - } - else { - $url = toURL ($self, $config->{format}, \%h); - $url = toURL ($self, 'default', \%h) unless $url; - } - - $$props->video_id ($tmp->{id}); - $$props->video_link ($url); - - return 0; - } - - return 1; -} - -sub toURL { - my ($self, $fmt, $h) = @_; - - $fmt = 'flv_240p' if $fmt eq 'default'; - $fmt = toFmt ($self, $fmt); - - foreach (keys %{$h}) - { return $$h{$_} if $_ eq $fmt; } - - return undef; -} - -sub toFmt { - my ($self, $id) = @_; - -# http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs -# $container_$maxwidth = '$fmt_id' - - my %h = ( - # flv - flv_240p => '5', - flv_360p => '34', - flv_480p => '35', - # mp4 - mp4_360p => '18', - mp4_720p => '22', - mp4_1080p => '37', - mp4_3072p => '38', - # webm - webm_480p => '43', - webm_720p => '45', - # 3gp - '3gp_144p'=> '17', - -# For backward-compatibility only. - mobile => '17', - sd_270p => "18", - sd_360p => "34", - hq_480p => "35", - hd_720p => "22", - hd_1080p => "37", - webm_480p => "43", - webm_720p => "45", - '3gp' => "17", - mp4 => "18", - hq => "35", - hd => "22", - ); - - foreach (keys %h) - { return $h{$_} if $id eq $_; } - - return $id; -} - -1; - -# And this is not our fate.
View file
clive-2.2.22.tar.bz2/lib/clive/HostFactory.pm
Deleted
@@ -1,76 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::HostFactory; - -use warnings; -use strict; - -use clive::Error qw(CLIVE_OK); - -my @_hosts = ( - "Youtube", qr|youtube.com|i, -# Sat Dec 11 2010: webm_*, 3gp_144p support found in Youtube.pm, website -# no longer seems to list them, however. Listing here only those formats -# that seem to still work. -"default|flv_240p|flv_360p|flv_480p|mp4_360p|mp4_720p|mp4_1080p|mp4_3072p", - "Youtube", qr|last.fm|i, "see youtube formats" , - "Google", qr|video.google.|i, "default|mp4" , - "Sevenload", qr|sevenload.com|i, "default" , - "Break", qr|break.com|i, "default" , - "Liveleak", qr|liveleak.com|i, "default" , - "Gaskrank", qr|gaskrank.tv|i, "default" , - "Dailymotion", qr|dailymotion.com|i, "default|hq|hd" , - "Vimeo", qr|vimeo.com|i, "default|hd" , - "Spiegel", qr|spiegel.de|i, "default|vp6_928|vp6_576|vp6_64|h264_1400" - , - "Golem", qr|golem.de|i, "default|ipod|high" , - "Clipfish", qr|clipfish.de|i, "default" , - "Funnyhub", qr|funnyhub.com|i, "default" , - "Buzzhumor", qr|buzzhumor.com|i, "default" , -); - -sub new { - my ( $class, $url ) = @_; - foreach (@_hosts) { - my ( $host, $re ) = @{$_}; - if ( $url =~ /$re/ ) { - my $req = "clive/Host/$host.pm"; - $class = "clive::Host::$host"; - require $req; - return $class->new(@_); - } - } -} - -sub dumpHosts { - my $self = shift; - foreach (@_hosts) { - my ( $host, $re, $fmts ) = @{$_}; - printf( "%s\t%s\n", $1, $fmts ) - if ( $re =~ /xsm:(.*?)\)/ && $re !~ /last\.fm/ ); - } - exit(CLIVE_OK); -} - -1; - -# The hour's getting late.
View file
clive-2.2.22.tar.bz2/lib/clive/Log.pm
Deleted
@@ -1,89 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Log; - -use warnings; -use strict; - -use base 'Class::Singleton'; - -use clive::Error qw(CLIVE_OK); - -sub init { - my $self = shift; - - $self->{return_code} = CLIVE_OK; - - my $config = clive::Config->instance->config; - $self->{quiet} = $config->{quiet}; - - # Go unbuffered. - select STDERR; - $| = 1; - select STDOUT; - $| = 1; -} - -sub out { - my $self = shift; - return if $self->{quiet}; - - my $ref - = clive::Config->instance->config->{stderr} - ? \*STDERR - : \*STDOUT; - - my $fmt = shift; - my $str = @_ ? sprintf( $fmt, @_ ) : $fmt; - - print $ref $str; -} - -sub err { - my $self = shift; - $self->{return_code} = shift; - - return if $self->{quiet}; - - my $fmt = shift; - my $msg = "error: " . ( @_ ? sprintf( $fmt, @_ ) : $fmt ); - - print( STDERR "$msg\n" ); -} - -sub errn { - my $self = shift; - - print( STDERR "\n" ) - if ( !$self->{quiet} ); - - err ( $self, @_ ); -} - -sub returnCode { - my $self = shift; - return $self->{return_code}; -} - -1; - -# All along the watchtower.
View file
clive-2.2.22.tar.bz2/lib/clive/Progress
Deleted
-(directory)
View file
clive-2.2.22.tar.bz2/lib/clive/Progress/Bar.pm
Deleted
@@ -1,180 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Progress::Bar; - -# Based on wget code. - -use warnings; -use strict; - -use File::Basename qw(basename); - -use clive::Util; - -use constant DEFAULT_TERM_WIDTH => 80; -use constant REFRESH_INTERVAL => 0.2; - -my $recv_sigwinch; - -sub new { - my ( $class, $props ) = @_; - - my $initial = $$props->initial_length; - my $total = $$props->file_length; - - $total = $initial - if ( $initial > $total ); - - $recv_sigwinch = 0; - $SIG{WINCH} = \&handle_sigwinch; - - my $self = { - props => $$props, - initial => $initial, - total => $total, - term_width => clive::Util::termWidth(), - width => DEFAULT_TERM_WIDTH - 1, - last_update => 0, - done => 0, - time_started => time, - }; - - return bless( $self, $class ); -} - -sub update { - my ( $self, $clientp, $total, $now, $ultotal, $ulnow ) = @_; - - my $force_update = 0; - if ($recv_sigwinch) { - my $old_width = $self->{term_width}; - $self->{term_width} = clive::Util::termWidth(); - if ( $self->{term_width} != $old_width ) { - $self->{width} = $self->{term_width} - 1; - $force_update = 1; - } - $recv_sigwinch = 0; - } - - my $tnow = time; - my $elapsed = $tnow - $self->{time_started}; - - if ( !$self->{done} ) { - if ( ( $elapsed - $self->{last_update} ) < REFRESH_INTERVAL - && !$force_update ) - { - return ( 0, 0 ); - } - } - else { - $now = $self->{total}; - } - - $self->{last_update} = $elapsed; - my $size = $self->{initial} + $now; - - my $fname_len = 32; - if ( $self->{width} > DEFAULT_TERM_WIDTH ) { - $fname_len += $self->{width} - DEFAULT_TERM_WIDTH; - } - - my $buf = substr( basename( $self->{props}->filename ), 0, $fname_len ); - - my $percent = 0; - my $stop_transfer = 0; - - if ( $self->{total} > 0 ) { - my $_size = !$self->{done} ? $size : $now; - $percent = 100.0 * $size / $self->{total}; - if ( $percent < 100 ) { - $buf .= sprintf( " %2d%% ", $percent ); - } - else { - $buf .= sprintf(" 100%%"); - } - $buf .= sprintf( - " %4.1fM / %4.1fM", - clive::Util::toMB($_size), - clive::Util::toMB( $self->{total} ) - ); - - my $stop_after = clive::Config->instance->config->{stop_after}; - if ($stop_after) { - if ( $stop_after =~ /(.*?)M$/ ) { - $stop_transfer = 1 - if ( clive::Util::toMB($_size) >= $1 ); - } - elsif ( $stop_after =~ /(.*?)%$/ ) { - $stop_transfer = 1 - if ( $percent >= $1 ); - } - } - } - - my $rate = $elapsed ? ( $now / $elapsed ) : 0; - my $tmp = ""; - if ( $rate > 0 ) { - my $eta; - if ( !$self->{done} ) { - my $left = ( $total - $now ) / $rate; - $eta = clive::Util::timeToStr($left); - } - else { - $eta = clive::Util::timeToStr($elapsed); - } - my ( $unit, $_rate ) = clive::Util::toUnits($rate); - $tmp = sprintf( " %4.1f%s %6s", $_rate, $unit, $eta ); - } - else { - $tmp = " --.-K/s --:--"; - } - - # pad to max. width leaving enough space for rate+eta - my $pad = $self->{width} - length($tmp) - length($buf); - $buf .= sprintf( "%${pad}s", " " ); - $buf .= $tmp; # append rate+eta - - clive::Log->instance->out("\r$buf"); - $self->{count} = $now; - - return ( $percent, $stop_transfer, \$self->{props} ); -} - -sub finish { - my $self = shift; - if ( $self->{total} > 0 - && $self->{count} + $self->{initial} > $self->{total} ) - { - $self->{total} = $self->{initial} + $self->{count}; - } - - $self->{done} = 1; - update( $self, -1, -1, -1, -1, -1 ); -} - -sub handle_sigwinch { - $recv_sigwinch = 1; -} - -1; - -# Princess kept the view.
View file
clive-2.2.22.tar.bz2/lib/clive/Util.pm
Deleted
@@ -1,140 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Util; - -use warnings; -use strict; - -eval("use Term::ReadKey"); -my $TermReadKey = int( !$@ ); - -use clive::Error qw(CLIVE_REGEXP); - -use constant DEFAULT_TERM_WIDTH => 80; -use constant MBDIV => 0x100000; - -sub termWidth { - return DEFAULT_TERM_WIDTH - unless $TermReadKey; - my ($width) = Term::ReadKey::GetTerminalSize(); - return $width; -} - -sub toMB { - my $bytes = shift; - return $bytes / MBDIV; -} - -sub fileExists { - my ($path) = @_; - return -s $path || 0; -} - -sub timeToStr { - my $secs = shift; - - my $str; - if ( $secs < 100 ) { - $str = sprintf( "%02ds", $secs ); - } - elsif ( $secs < 100 * 60 ) { - $str = sprintf( "%02dm%02ds", $secs / 60, $secs % 60 ); - } - elsif ( $secs < 48 * 3600 ) { - $str = sprintf( "%02dh%02dm", $secs / 3600, ( $secs / 60 ) % 60 ); - } - elsif ( $secs < 100 * 86400 ) { - $str = sprintf( "%dd%02dh", $secs / 86400, ( $secs / 3600 ) % 60 ); - } - else { - $str = sprintf( "%dd", $secs / 86400 ); - } - return $str; -} - -sub toUnits { - my $rate = shift; - my $units = "K/s"; - if ($rate >= 1024*1024*1024) { - $rate /= 1024*1024*1024; - $units = "G/s"; - } - elsif ($rate >= 1024*1024) { - $rate /= 1024*1024; - $units = "M/s"; - } - else - { $rate /= 1024; } - ($units, $rate); -} - -sub matchRegExps { - my ( $regexps, $results, $content ) = @_; - while ( my ( $key, $re ) = each( %{$regexps} ) ) { - $$results->{$key} = $1 if $$content =~ /$re/; - if ( !$$results->{$key} ) { - clive::Log->instance->err( CLIVE_REGEXP, "no match: `$re'" ); - return (1); - } - } - return (0); -} - -sub toDomain { - my $uri = shift; - - my ( $scheme, $authority, $path, $query, $fragment ) - = $uri - =~ m{(?:(^:/?#+):)?(?://(^/?#*))?(^?#*)(?:\?(^#*))?(?:#(.*))?}o; - - return split( /\./, $authority ); -} - -sub prompt { - print shift; - chomp( my $ln = <STDIN> ); - return $ln; -} - -sub fromEntities { - my %conv_table = ( - """ => "\"", - """ => "\"", - "&" => "&", - "&" => "&", - "'" => "'", - "'" => "'", - "<" => "<", - "<" => "<", - ">" => ">", - ">" => ">", - ); - my $str = shift; - while ( my ( $from, $to ) = each(%conv_table) ) { - $str =~ s/$from/$to/g; - } - return $str; -} - -1; - -# While all the women came and went.
View file
clive-2.2.22.tar.bz2/lib/clive/Video.pm
Deleted
@@ -1,269 +0,0 @@ -# -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# -# Copyright 2009 Toni Gundogdu. -# -# This file is part of clive. -# -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. -# -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### -package clive::Video; - -use warnings; -use strict; - -use Carp; -use POSIX; -use File::Basename qw(basename); -use File::Spec::Functions; -use Cwd qw(getcwd); -use Encode qw(decode_utf8); - -use clive::Util; - -our $AUTOLOAD; - -sub new { - my $class = shift; - my %fields = ( - page_link => undef, - video_id => undef, - file_length => undef, - content_type => undef, - file_suffix => undef, - video_link => undef, - video_host => undef, - video_format => undef, - base_filename => undef, - filename => undef, - initial_length => undef, - time_stamp => undef, - nothing_todo => undef, - ); - my $self = { - _permitted => \%fields, - %fields, - }; - return bless( $self, $class ); -} - -sub page_title { - my $self = shift; - if (@_) { - my ( $content, $title ) = @_; - if ( !$title ) { - require HTML::TokeParser; - my $p = HTML::TokeParser->new($content); - $p->get_tag("title"); - $self->{page_title} = $p->get_trimmed_text; - _cleanupTitle($self); - } - else { - $self->{page_title} = clive::Util::fromEntities($title); - } - } - return $self->{page_title}; -} - -sub printVideo { - my $self = shift; - my $str = sprintf( - "file: %s %.1fM %s\n", - $self->{base_filename}, - clive::Util::toMB( $self->{file_length} ), - $self->{content_type} - ); - clive::Log->instance->out($str); -} - -sub emitCSV { - my $self = shift; - - require URI::Escape; - - my @fields = qw(base_filename file_length video_link); - - my $str = "csv:"; - $str .= sprintf( qq/"%s",/, $self->$_ ) foreach (@fields); - $str =~ s/,$//; - - clive::Log->instance->out("$str\n"); -} - -sub formatOutputFilename { - my ( $self, $suffix, $index ) = @_; - - my $config = clive::Config->instance->config; - my $fname; - - if ( !$config->{output_file} ) { - - # Apply character-class. - my $title = $self->{page_title}; - my $cclass = $config->{cclass} || qr|\w|; - - $title = join( '', $self->{page_title} =~ /$cclass/g ) - if ( !$config->{no_cclass} ); - - # Format output filename. - $fname = $config->{filename_format} || "%t.%s"; - - my $id = $self->{video_id}; - - # $id =~ s/-/_/g; - - $title = $id - if ( !$title && $fname !~ /%i/ ); - - $fname =~ s/%t/$title/; - if ( $self->{file_suffix} ) { - $fname =~ s/%s/$self->{file_suffix}/; - } - elsif ($suffix) { - my $tmp = "$index.$suffix"; - $fname =~ s/%s/$tmp/; - } - $fname =~ s/%i/$id/; - $fname =~ s/%h/$self->{video_host}/; - - my $config = clive::Config->instance->config; - my $path = Encode::decode_utf8( $config->{save_dir} or getcwd ); - - $fname = catfile( $path, $fname ); - my $tmp = $fname; - - for ( my $i = 1; $i < 9999; ++$i ) { - $self->{initial_length} = clive::Util::fileExists($fname); - - if ( $self->{initial_length} == 0 ) { - last; - } - elsif ( $self->{initial_length} == $self->{file_length} ) { - $self->{nothing_todo} = 1; - last; - } - else { - if ( $config->{continue} ) { - last; - } - } - $fname = "$tmp.$i"; - } - } - else { - $self->{initial_length} - = clive::Util->fileExists( $config->{output_file} ); - if ( $self->{initial_length} == $self->{file_length} ) { - $self->{nothing_todo} = 1; - } - else { - $fname = $config->{output_file}; - } - } - - if ( !$config->{continue} ) { - $self->{initial_length} = 0; - } - - $self->{base_filename} = basename($fname); - $self->{filename} = $fname; -} - -sub fromCacheRecord { - my ( $self, $record ) = @_; - - # No need to keep order in sync with clive::Video::toCacheRecord - # or clive::Cache::_mapRecord -- just make sure each item gets - # set here. - $self->{page_title} = decode_utf8( $$record{page_title} ); - $self->{page_link} = $$record{page_link}; - $self->{video_id} = $$record{video_id}; - $self->{video_link} = $$record{video_link}; - $self->{video_host} = $$record{video_host}; - $self->{video_format} = $$record{video_format}; - $self->{file_length} = $$record{file_length}; - $self->{file_suffix} = $$record{file_suffix}; - $self->{content_type} = $$record{content_type}; - $self->{time_stamp} = $$record{time_stamp};
View file
clive-2.2.22.tar.bz2/man1
Deleted
-(directory)
View file
clive-2.2.22.tar.bz2/man1/clive.1.pod
Deleted
@@ -1,550 +0,0 @@ - -=head1 NAME - -clive - command line video extraction utility - -=head1 SYNOPSIS - -clive options... URL... - -=head1 DESCRIPTION - -clive is a command line video extraction utility for Youtube and other similar -video-sharing websites. It was written to work around the Adobe Flash plugin -requirement as the technology is poorly supported on Unix-like systems. - -clive is not an universal video extraction utility. In fact, it supports only -a number of video websites. Each website typically exposes access to the video -content in a very different way, meaning that clive has to be customized for -each website in order to download any videos from them. - -=head1 OPTION SYNTAX - -You may freely mix different option styles and specify options after -the command line arguments, e.g.: - % clive -c URL --format=best - -You may also put several options together that do not require arguments: - % clive -cnrf best URL - -Note that the "dashed" options have aliases. For example: - % clive --no-extract --no_extract --noextract - % clive --cache-read --cache_read --cacheread - -=head1 OPTIONS - -=over 4 - -=item B<-h, --help> - -Print help and exit. - -=item B<-v, --version> - -Print version and exit. - -=item B<--hosts> - -Print supported hosts with available formats and exit. - -=item B<--upgrade-config> - -Upgrade clive 2.0/2.1 config to current 2.2+ format and exit. - -=item B<-l, --last> - -Re-feed the previously fed video page links from the last run time. - -=item B<--last-file>=I<path> - -Use I<path> instead of the default path. See also L</FILES>. - -=back - -B<Output options> - -=over 4 - -=item B<--emit-csv> - -Print (or emit) video details in CSV format to standard output. -Implies --no-extract. - -=item B<--print-fname> - -Print filename on a separate line before download starts. - -=item B<--debug> - -Print cURL debug (or verbose) messages to standard error. - -=item B<-q, --quiet> - -Turn off all output to standard output and error. - -=item B<--stderr> - -Direct all output to standard error. - -=back - -B<HTTP Options> - -=over 4 - -=item B<--agent>=I<string> - -Identify clive as I<string> to HTTP servers. Defaults to "Mozilla/5.0". - -=item B<--connect-timeout>=I<seconds> - -Maximum time in I<seconds> allowed for connection to take. Defaults to 30. - -=item B<--connect-timeout-socks>=I<seconds> - -Same as above but tries to workaround the SOCKS proxy bug in cURL. -Defaults to 30. - -=item B<--proxy>=I<address> - -Use I<address> for HTTP proxy. Example: "http://foo:1234". - -=item B<--no-proxy> - -Disable all use of HTTP proxy, even if http_proxy environment variable is set. - -=item B<--cookie-jar>=I<file> - -Enable cookies, which are otherwise rejected by default, and have libcurl -to write them to I<file>. Specify "-" to instead to have the cookies written -to stdout. - -=back - -B<Cache Options> - -=over 4 - -=item B<--cache-file>=I<path> - -Use I<path> instead of the default path. See L</FILES>. - -=item B<-r, --cache-read> - -Read video details from cache record if it exists. Allows clive to -skip video page fetching and parsing again. See L</CACHE> section for more -on this. - -=item B<-d, --cache-dump> - -Dump cache records to standard output. - -=item B<--cache-dump-format>=I<format-string> - -Used to format the output of the above. Defaults to "%n: %t %f, %mMB". - -Example: - % clive --cache-dump --cache-dump-format="%d: %t" - -Supported format specifiers: - %t .. video page title - %i .. video id - %h .. video host - %l .. video file length (bytes) - %m .. video file length (MB) - %d .. date (last update) - %T .. time (last update) - %s .. time stamp (same as "%d %T") - %f .. video file format - %n .. index - -=item B<--cache-grep>=I<pattern> - -Grep stored cache records for I<pattern>. See also L</EXAMPLES - ADVANCED USE>. - -=item B<-i, --cache-ignore-case> - -Ignore case-differences while matching records. - -=item B<-D, --cache-remove-record> - -Remove matched records from cache. - -=item B<--cache-clear> - -Truncate cache records. - -=item B<--no-cache> - -Disable all (read and write) cache use. - -=back - -B<Download Options> - -=over 4 - -=item B<-f, --format>=I<format> - -Download the I<format> of the video. If I<format> is set to I<best>, clive -will attempt to download the best quality of the video. - -If this option is not used (or is used with "default"), clive will -attempt to download whatever is assumed to be the default format -for the website. - -Note also that each I<format> is specific to a website. See -L</FORMATS> for more. - -=item B<-n, --no-extract>
View file
clive-2.2.22.tar.bz2/t/eval-compile.t
Deleted
@@ -1,9 +0,0 @@ -use warnings; -use strict; - -use Test::More qw(no_plan); - -my $output = qx(perl -c -I./blib/lib blib/script/clive 2>&1); - -ok( $output =~ /syntax OK$/ ) - or diag explain $output;
View file
clive-2.2.22.tar.bz2/t/eval-exitstatus.t
Deleted
@@ -1,14 +0,0 @@ -#!/usr/bin/env perl -I./t/lib - -use warnings; -use strict; - -use Test::More tests => 1; - -my $clive = "perl -I./blib/lib blib/script/clive -q"; -my $cmd = "$clive http://nosupport"; -my $output = qx($cmd); - -my $rc = $? >> 8; -ok( $rc == 2 ) - or diag "$cmd\nexpected return code 2 (got $rc)";
View file
clive-2.2.22.tar.bz2/t/eval-pod.t
Deleted
@@ -1,11 +0,0 @@ -use warnings; -use strict; - -use Test::More; - -eval "use Test::Pod 1.00"; -plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; - -my @poddirs = qw(bin man1); - -all_pod_files_ok (all_pod_files(@poddirs));
View file
clive-2.2.22.tar.bz2/ChangeLog -> clive-2.3.3.tar.gz/ChangeLog
Changed
@@ -1,487 +1,1854 @@ -commit 2aec28627f219b58edc82ad0c081144739b12ce5 +commit 6f22d90 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2012-03-16 + + Update NEWS for 2.3.3 + +NEWS + +commit 1867800 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2012-03-16 + + Bump version to 2.3.3 + +bin/clive + +commit 13c5d89 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2012-03-14 + + Do not prepend "http" URL if it is not found + +bin/clive + +commit 02b3f64 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-12-12 + + Use -vq with quvi when supported (#15) + + Mutes: "warning: --quiet: deprecated, use --verbosity instead" + when more recent quvi version is available. + + * http://sourceforge.net/apps/trac/clive/ticket/15 + +bin/clive + +commit 9b32fd2 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-12-12 + + examples/cliverc: Use new category option + + * Comment out deprecated option + +examples/cliverc + +commit 249c3d9 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-11-21 + + Fix a typo in manual + +doc/man1/clive.1.pod + +commit cf1f0dd +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-10-22 + + Revise --help output + +bin/clive + +commit f98aa15 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-10-22 + + Remove ChangeLog.pre-gitlog, examples/git/hooks/pre-commit + +ChangeLog.pre-gitlog +MANIFEST +examples/git/hooks/pre-commit + +commit d9a00b7 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-10-22 + + Bump version to 2.3.2 + +bin/clive + +commit a8ef5a1 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-10-22 + + Update NEWS for 2.3.2 + +NEWS + +commit 85e8db7 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-10-22 + + Revise README + +README + +commit 78f1a3b +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-10-22 + + Revise README.packagers + +README.packagers + +commit 19555bc +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-10-22 + + Revise INSTALL + +INSTALL + +commit 5068442 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-10-21 + + Revise manual + +doc/man1/clive.1.pod + +commit 059b078 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-10-21 + + Add --user-agent to args used with detected curl + +bin/clive + +commit a1c3802 +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-10-21 + + Revise examples/cliverc + +examples/cliverc + +commit b5e8ddc +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-10-22 + + Remove print_version + +bin/clive + +commit 1bafddf +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-09-16 + + Add todo/ to skipped + +MANIFEST.SKIP + +commit e06648f +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-09-16 + + Revise README + + * Add INSTALL + * Add README.packagers + +INSTALL +MANIFEST +README +README.packagers + +commit b2c52fc +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-09-16 + + mv man1/ -> doc/ + +MANIFEST +Makefile.PL +doc/man1/clive.1.pod +man1/clive.1.pod +t/clive-Pod.t + +commit dbb0e2f +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-09-16 + + Revise Makefile.PL + +Makefile.PL + +commit 7fd4d2a +Author: Toni Gundogdu <legatvs@gmail.com> +Date: 2011-09-16 + + Cleanup ignored files + +.gitignore +MANIFEST.SKIP +scripts/tidy.sh + +commit c72efe6
View file
clive-2.3.3.tar.gz/INSTALL
Added
@@ -0,0 +1,41 @@ + + +Prerequisites +============= + +* Perl 5.8.9+ <http://perl.org/> +* quvi 0.2.16.1+ <http://quvi.sourceforge.net/> +* Getopt::ArgvFile <http://search.cpan.org/perldoc?Getopt::ArgvFile> +* JSON::XS <http://search.cpan.org/perldoc?JSON::XS> +* curl <http://curl.haxx.se/> + + +Installation from source +======================== + +Uninstall earlier versions of clive if you have any installed. + +For the impatient +----------------- + +Run bin/clive without installing. This assumes the required Perl modules +and system commands can be found by the script. + +Typical installation +-------------------- + +To install: + + perl Makefile.PL + make + make install + + * Note that you can specify install prefix with INSTALL_BASE + e.g. perl Makefile.PL INSTALL_BASE=/usr/local + +Recommended reading: + * <http://search.cpan.org/perldoc?ExtUtils::MakeMaker> + * <http://perldoc.perl.org/ExtUtils/MakeMaker/FAQ.html> + + +vim: set ts=2 sw=2 tw=72 expandtab:
View file
clive-2.2.22.tar.bz2/MANIFEST -> clive-2.3.3.tar.gz/MANIFEST
Changed
@@ -1,39 +1,13 @@ bin/clive -NEWS ChangeLog -ChangeLog.pre-gitlog COPYING -examples/config -man1/clive.1.pod -lib/clive/App.pm -lib/clive/Cache.pm -lib/clive/Compat.pm -lib/clive/Config.pm -lib/clive/Curl.pm -lib/clive/Error.pm -lib/clive/Exec.pm -lib/clive/Host/Break.pm -lib/clive/Host/Clipfish.pm -lib/clive/Host/Dailymotion.pm -lib/clive/Host/Gaskrank.pm -lib/clive/Host/Funnyhub.pm -lib/clive/Host/Golem.pm -lib/clive/Host/Google.pm -lib/clive/Host/Liveleak.pm -lib/clive/Host/Sevenload.pm -lib/clive/Host/Spiegel.pm -lib/clive/Host/Vimeo.pm -lib/clive/Host/Youtube.pm -lib/clive/Host/Buzzhumor.pm -lib/clive/HostFactory.pm -lib/clive/Log.pm -lib/clive/Progress/Bar.pm -lib/clive/Util.pm -lib/clive/Video.pm +examples/cliverc Makefile.PL +doc/man1/clive.1.pod MANIFEST This list of files +NEWS +INSTALL README -t/eval-compile.t -t/eval-pod.t -t/eval-exitstatus.t +README.packagers +t/clive-Pod.t META.yml Module meta-data (added by MakeMaker)
View file
clive-2.2.22.tar.bz2/META.yml -> clive-2.3.3.tar.gz/META.yml
Changed
@@ -1,8 +1,9 @@ --- #YAML:1.0 name: clive -version: 2.2.22 -abstract: ~ -author: +version: 2.3.3 +abstract: (c)ommand (li)ne (v)ideo (e)xtraction tool +author: + - Toni Gundogdu <legatvs@cpan.org> license: gpl distribution_type: module configure_requires: @@ -10,19 +11,14 @@ build_requires: ExtUtils::MakeMaker: 0 requires: - Class::Singleton: 1.4 - Config::Tiny: 2.12 - Digest::SHA: 5.45 Getopt::ArgvFile: 1.11 - HTML::TokeParser: 2.37 - URI::Escape: 3.29 - version: 0.77 - WWW::Curl: 4.05 + JSON::XS: 2.3 + perl: 5.008009 no_index: directory: - t - inc -generated_by: ExtUtils::MakeMaker version 6.56 +generated_by: ExtUtils::MakeMaker version 6.57_05 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4
View file
clive-2.2.22.tar.bz2/Makefile.PL -> clive-2.3.3.tar.gz/Makefile.PL
Changed
@@ -7,34 +7,33 @@ use ExtUtils::MakeMaker; WriteMakefile( - 'NAME' => 'clive', - ( $ >= 5.8 ) - ? ( AUTHOR => 'Toni Gundogdu <legatvs at sign gmail com>', - 'ABSTRACT' => 'command line video downloading tool' - ) - : (), - 'VERSION_FROM' => 'lib/clive/Config.pm', - 'EXE_FILES' => 'bin/clive', - 'PREREQ_PM' => { - 'Getopt::ArgvFile' => 1.11, - 'Class::Singleton' => 1.4, - 'HTML::TokeParser' => 2.37, - 'URI::Escape' => 3.29, - 'Digest::SHA' => 5.45, - 'WWW::Curl' => 4.05, - 'Config::Tiny' => 2.12, - 'version' => 0.77 - }, - 'LICENSE' => 'gpl', - 'MAN1PODS' => { - 'man1/clive.1.pod' => '${INST_MAN1DIR}/clive.$(MAN1EXT)' }, - dist => { - PREOP => -'@if test -f .git/HEAD; then \ - git log --stat --after="Tue Nov 30 14:02:38 2010" >ChangeLog; \ + NAME => 'clive', + DISTNAME => 'clive', + VERSION_FROM => 'bin/clive', + PREREQ_PM => { +'Getopt::ArgvFile' => 1.11, +'JSON::XS' => 2.30, + }, + BUILD_REQUIRES => { + 'ExtUtils::MakeMaker' => 0, + }, + CONFIGURE_REQUIRES => { + 'ExtUtils::MakeMaker' => 0, + }, + MIN_PERL_VERSION => 5.008009, + ($ >= 5.005 ? + (ABSTRACT_FROM => 'doc/man1/clive.1.pod', + AUTHOR => 'Toni Gundogdu <legatvs@cpan.org>') : ()), + 'LICENSE' => 'gpl', + 'EXE_FILES' => 'bin/clive', + 'MAN1PODS' => + {'doc/man1/clive.1.pod' => '$(INST_MAN1DIR)/clive.$(MAN1EXT)'}, + dist => { + PREOP => '@if test -f .git/HEAD; then \ + git log --stat --name-only --date=short --abbrev-commit \ + --after="Tue Sep 28 02:13:39 2010" > ChangeLog; \ fi', - POSTOP => -'@if test -f .git/HEAD; then \ + POSTOP => '@if test -f .git/HEAD; then \ git checkout ChangeLog; \ fi', },
View file
clive-2.2.22.tar.bz2/NEWS -> clive-2.3.3.tar.gz/NEWS
Changed
@@ -1,62 +1,121 @@ +v2.3.3 (2012-03-16) / Toni Gundogdu -2.2.22 Sun Jan 16 2011 Toni Gundogdu +Toni Gundogdu: + - Do not prepend "http" URL if it is not found 13c5d89 + - examples/cliverc: Use new category option 9b32fd2 + - Fix a typo in manual 249c3d9 + - Revise --help output cf1f0dd + - Use -vq with quvi when supported (#15) 02b3f64 + + +2.3.2 Sat Oct 22 2011 Toni Gundogdu Changes: - - Accept youtu.be URLs (#8) + - Revise README, README.packagers, INSTALL, manual, Makefile.PL + - Add --user-agent to args used with autodetected curl command + - Revise examples/cliverc, add --user-agent to curl example + - Lower quvi prerequisite to 0.2.16.1 -2.2.21 Fri Jan 07 2011 Toni Gundogdu -Bugfixes: - - Dailymotion.pm: Access blocked by "family filter" (#4) +2.3.1.1 Sun Jun 19 2011 Toni Gundogdu +Fixes: + - Missing details in --help output -2.2.20 Mon Dec 27 2010 Toni Gundogdu + +2.3.1 Sat Jun 18 2011 Toni Gundogdu Changes: - - Accept non-HTTP (input) URLs #3 -Bugfixes: - - Vimeo.pm: Fix video ID parsing #2 - - -2.2.19 Sat Dec 11 2010 Toni Gundogdu -Changes: - - Set <http://clive.sourceforge.net> as new WWW home - - Add man1/clive.1.pod, manify from this from now on - - Youtube: Extend format aliases to match quvi IDs - - Remove myubo support: dead site - - Backup ChangeLog as ChangeLog.pre-gitlog - - Generate ChangeLog from gitlog - - Rename Evisor.pm to Gaskrank.pm - - Rename tests - - Remove dangling (and broken) ehrensenf, cctv support - - Exclude network tests, can still be found in the repo - - gzip release tarball from now on + - Add --query-formats, deprecate "--format list" + - Detect quvi and/or download command from $PATH + - In the absence of --quvi and/or --get-with + - Bump quvi prerequisite to 0.2.17 + - Revise manual + + +2.3.0.3 Mon May 02 2011 Toni Gundogdu +Changes: + - Add support to read input from files + + +2.3.0.2 Tue Mar 15 2011 Toni Gundogdu +Changes: + - Make --version less verbose + - Manual: Add SYNOPSIS + - examples/cliverc, Manual: Add --category-http (quvi 0.2.12+) Bugfixes: - - Liveleak.pm: token/ID parsing - - Youtube.pm: Unknown error (http/404) #1 + - examples/cliverc: Typo in --get-with -Version 2.2.15 +2.3.0.1 Sat Feb 12 2011 Toni Gundogdu +Changes: + - Replace outdated webm_480p with mp4_360p in examples + - README: Cleanup, add notes for packagers + - Add examples/git/hooks/pre-commit + - Manual: Cleanup, add HISTORY + - Add vim modeline +Other: + - Create "2.2" branch from "master" + - Merge "2.3_gws" into "master" branch + - http://sourceforge.net/apps/trac/clive/wiki/Changes-2.3 + + +2.3.0_4 (beta 4, 2.3_gws) Sat Dec 18 2010 Toni Gundogdu +Changes: + - Generate ChangeLog from git log + + +2.3.0_3 (beta 3, 2.3_gws) Wed Dec 01 2010 legatvs +Changes: + - Add support for /etc/xdg/clive/clive.conf + - Add support /etc/xdg/clive.conf + - Add --format list pattern + - Add --format list + - Add --format help + -Changes to --format +2.3.0_2 (beta 2, 2.3_gws) Thu Nov 04 2010 legatvs +Changes: + - Use quvi(1) for parsing video details, --quvi arg + - Use external command to download, --get-with arg + - Use version->declare instead of version::qv + - Add JSON::XS dependency + - Add examples/cliverc + - Additional config file search paths (e.g. system-wide) + - Remove WWW::Quvi dependency + - Remove WWW::Curl dependency + - Remove Term::ReadKey dependency + - Remove --continue, --overwrite, --proxy + - Remove --no-proxy, --agent, --throttle + + +2.3.0_1 (beta 1) Wed Oct 27 2010 + +Changes: + - Use libquvi (WWW::Quvi) to parse video details + - Remove options / features + - Rename options + - Prerequisites +Bugfixes: + - Progressbar unicode issues - * "flv" is now called "default" -Youtube: +2.3.0 "Glorified Wrapper Script" (2.3_gws) - * Add HD 1080p support +* Single-script vs. multiple-clive-modules + - clive is no longer dispersed all over the file system in Perl packages - * Add support for the quvi supported Youtube IDs (e.g. sd_270p). - The old (and vague) IDs (e.g. mp4 or hd) are still supported - but should be considered _deprecated_. +* Use quvi(1) to parse the video details + - 2.3 was going to use WWW::Quvi and libquvi (beta 1) + - Had a piffany (beta 2) +* Leave downloading for an external 3rd party command to do + - e.g. curl, wget or whatever -Version 2.2.9 +* Complete command line interface clean up + - Esoteric, or otherwise now completely obsoleted, features were discarded -cctv support was fixed. These videos appear to come in (at least) two -flavors now: multi-segment and single-segment. The issue has been -discussed here: - http://code.google.com/p/clive/issues/detail?id=45 +See also: + <http://sourceforge.net/apps/trac/clive/wiki/DevelopmentStatus> -It was decided, mainly due to overall laziness, that multi-segment -video links are to be dumped to the terminal without any further -fiddling with them. The reasons have also been covered in the above -discussion. +For earlier version history, please see: + http://repo.or.cz/w/clive.git/blob/maint-2.2:/NEWS + http://repo.or.cz/w/clive.git/blob/maint-2.2:/ChangeLog.pre-gitlog
View file
clive-2.2.22.tar.bz2/README -> clive-2.3.3.tar.gz/README
Changed
@@ -1,53 +1,7 @@ -README for clive ----------------- -clive is a command line utility for extracting videos from Youtube and other -video-sharing websites. It was written to bypass the Adobe Flash requirement -to view the hosted videos. - -WWW: <http://clive.sourceforge.net/> - - -Prerequisites -------------- - -See Makefile.PL file. - - -Optional modules ----------------- - -* BerkeleyDB - - If not installed, clive cache features will be disabled - -* Term::ReadKey - - If not installed, clive will not resize progressbar to - match terminal width - - -Installation ------------- - -Be sure to remove any previous versions of clive first. - -INSTALL_BASE can be passed into Makefile.PL to change where clive will -be installed. For example: - - perl Makefile.PL INSTALL_BASE=/usr/local - - perl Makefile.PL - make - (make test) - make install - -See also (for Makefile.PL options etc.): - <http://search.cpan.org/perldoc?ExtUtils::MakeMaker> - - -Notes ------ - -If you want to try clive without installing it first: - cd lib; ../bin/clive URL +clive is a command line media extraction tool for YouTube and similar +websites that require flash. +Home : <http://clive.sourceforge.net/> +gitweb: <http://repo.or.cz/w/clive.git>
View file
clive-2.3.3.tar.gz/README.packagers
Added
@@ -0,0 +1,14 @@ + +PACKAGERS +========= + +clive will attempt to detect the quvi(1) and the curl(1) commands +from the $PATH if either "--quvi" or "--get-with" is missing. + +Please consider installing a preconfigured system wide configuration +file with clive. This file should contain the preconfigured "--quvi" +and "--get-with" (see "$top_srcdir/examples/cliverc"). See also the +manual page ($top_srcdir/doc/man1/clive.1.pod) for "FILES" which lists +the typical system wide config file paths. + +Last but not least, thanks for your support.
View file
clive-2.2.22.tar.bz2/bin/clive -> clive-2.3.3.tar.gz/bin/clive
Changed
@@ -1,84 +1,551 @@ #!/usr/bin/perl # -*- coding: ascii -*- -########################################################################### -# clive, command line video extraction utility. -# Copyright 2007, 2008, 2009 Toni Gundogdu. # -# This file is part of clive. +# clive +# Copyright (C) 2010-2011 Toni Gundogdu <legatvs@gmail.com> # -# clive is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your option) -# any later version. +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# clive is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -########################################################################### +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + use warnings; use strict; -binmode( STDOUT, ":utf8" ); -binmode( STDERR, ":utf8" ); +use version 0.77 (); our $VERSION = version->declare("2.3.3"); + +binmode STDOUT, ":utf8"; +binmode STDERR, ":utf8"; + +use Getopt::ArgvFile qw(argvFile); + +use Getopt::Long qw(:config bundling); +use Encode qw(decode_utf8); +use Carp qw(croak); + +my $depr_msg = "Warning: + '--format list' is deprecated and will be removed in the later + versions. Use --query-formats instead."; + +my $quvi_quiet_switch = '-q'; +my %config; +my @queue; +my $media; + +exit main(); + +sub main +{ + init(); + return process_queue(); +} + +sub init +{ + if (grep {$_ eq "--config-file"} @ARGV) + { + argvFile(fileOption => '--config-file'); + } + else + { + @ARGV = ( + @ARGV, + ( + "@/usr/local/share/clive/cliverc", + "@/usr/share/clive/cliverc", + "@/etc/clive/config", + "@/etc/xdg/clive/clive.conf", + "@/etc/xdg/clive.conf" + ) + ); + + if ($ENV{HOME}) + { + @ARGV = ( + @ARGV, + ( + '@' . "$ENV{HOME}/.cliverc", + '@' . "$ENV{HOME}/.clive/config", + '@' . "$ENV{HOME}/.config/clive/config" + ) + ); + } + + push @ARGV, '@' . "$ENV{CLIVE_CONFIG}" if $ENV{CLIVE_CONFIG}; + + argvFile(); + } + + GetOptions( + \%config, + 'help' => \&print_help, + 'version' => sub {print "clive version $VERSION\n"; exit 0}, + 'license' => \&print_license, + 'quiet|q', + 'query_formats|query-formats|F', + 'format|f=s', + 'output_file|output-file|O=s', + 'no_download|no-download|n', + + # Configuration: + 'quvi=s', + 'get_with|get-with=s', + 'filename_format|filename-format=s', + 'regexp=s', + 'exec=s', + ) or exit 1; + + $config{format} ||= 'default'; + $config{filename_format} ||= '%t.%s'; + $config{regexp} ||= '/(\\w|\\s)/g'; + + # Check --quvi. + unless ($config{quvi}) + { + print "Detect quvi from \$PATH\n" unless $config{quiet}; + + my $s = detect_cmd('quvi'); + if ($s) + { + $config{quvi} = "quvi %u"; + } + else + { + croak "error: specify path to quvi(1) command with --quvi\n"; + } + } + check_quvi(); + check_format(); + + # Check --get-with. + unless ($config{get_with}) + { + + print "Detect a download command from \$PATH\n" + unless $config{quiet}; + + my %h = ( + curl => "-L -C - -o %f %u --user-agent Mozilla/5.0", + + # Add new ones below. + ); + + for my $k (keys %h) + { + my $s = detect_cmd($k); + if ($s) + { + $config{get_with} = "$k $h{$k}"; + last; + } + } + + croak "error: specify path to a download command with --get-with\n" + unless $config{get_with}; + } + + # Check --regexp. + + apply_regexp(); + + # Process input. + + if (scalar @ARGV == 0) + { + append_queue($_) while <STDIN>; + } + else + { + foreach (@ARGV) + { + if (!is_url($_)) + { + open my $fh, "<", $_ + or print STDERR "$_: $!\n" and next; + append_queue($_) while <$fh>; + close $fh; + } + else + { + append_queue($_); + } + } + }
View file
clive-2.3.3.tar.gz/doc
Added
+(directory)
View file
clive-2.3.3.tar.gz/doc/man1
Added
+(directory)
View file
clive-2.3.3.tar.gz/doc/man1/clive.1.pod
Added
@@ -0,0 +1,318 @@ +=head1 NAME + +clive - (c)ommand (li)ne (v)ideo (e)xtraction tool + +=head1 SYNOPSIS + +clive E<lt>optionsE<gt> E<lt>urlE<gt> | E<lt>fileE<gt> ... + +=head1 DESCRIPTION + +clive is a command line media extraction tool for YouTube and similar +websites that require flash. + +=head2 Background + +clive originates from a simple shell script that was cooked up to work +around the YouTube's flash requirement back in 2006. + +=head2 Getting started + +=head3 Configuring + +=head4 Autodetection + +clive will attempt to autodetect the required commands from the $PATH, +when they have not been defined in either config file or the command +line. + +=head4 Configuration file + +See L</FILES> for an example configuration file. You may want to +consider adding at least the L</--quvi> and L</--get-with> there. + +=head4 See also + +L</TROUBLESHOOTING>, L</KNOWN ISSUES> and L</EXAMPLES>. + +=head1 OPTIONS + +clive expects the URLs to be separated by a newline character when the +they are read from either stdin or files. + +=head2 --help + +Print help and exit. + +=head2 --version + +Print version and exit. + +=head2 --license + +Print license and exit. + +=head2 -q, --quiet + +Turn off all I<clive> output excluding errors. Note that this switch has no +effect on any of the third party commands that clive invokes. + +=head2 -F, --query-formats + +Query available formats to an URL. The returned string will contain +an array of I<format strings>, each separated by the '|' character. +The array is created, by libquvi, from the data returned by the server. +You can use these I<format strings> with C<--format>. + +See also L</EXAMPLES> and C<--format>. + +=head2 -f, --format I<arg> (=default) + +Download format I<arg> of the media. The I<arg> can also be C<default>, +C<best>, C<help> or C<list>. Note, however, that of these, the C<list> and +the C<help> are deprecated and will be removed in the later versions of +clive. + +The I<arg> value is used with all of the URLs fed to clive at runtime. If +the I<arg> is C<best>, libquvi will determine the C<best> format available +to an URL. + +If the I<arg> is C<default> libquvi attempts to return an URL to whatever +was deemed to be the C<default> format to the URL. libquvi will switch +to C<default> format if the I<arg> was unregognized or the requested +I<arg> format was unavailable. + +For the above reasons, the downloaded format may be different from the +requested I<arg> format. + +For details about the YouTube's "fmt" IDs, refer to: + http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs + +See also L</EXAMPLES>, C<--query-formats>. + +=head2 -O, --output-file I<arg> + +Write media to I<arg>. Overrides C<--filename-format>. + +=head2 -n, --no-download + +Do not download the media, print details only. + +=head2 --config-file I<arg> + +Path to a file to read clive arguments from. See also L</FILES>. + +=head1 OPTIONS - CONFIGURATION + +The C<configuration> options may be read from the config file. +See L</FILES>. + +=head2 --quvi I<arg> + +I<arg> to be invoked to start the C<quvi(1)> command which clive uses to +parse the media details. This is typically a full path to C<quvi(1)> with +any additional options. Overrides any value set by autodetection. + +The following specifiers can be used in the I<arg>: + + %u .. Media stream URL + +I<All> occurences of the specifier will be replaced. clive will +automatically append C<--quiet> to I<arg>. + +=head2 --get-with I<arg> + +Path to a download command (e.g. C<wget(1)> or C<curl(1)>) with any additional +arguments. clive invokes this command to download the media. Overrides any +value set by autodetection. + +The following specifiers are supported: + + %n Media filename (after applying --regexp and --filename-format) + %f Path to downloaded media file (output path and %n) + %u Media stream URL + +I<All> occurences of the specifier will be replaced. + +=head2 --filename-format I<arg> (="%t.%s") + +Use I<arg> to specify the media output filename format. +The following specifiers are supported: + + %t Media title (after applying --regexp) + %h Media host ID + %s File suffix + %i Media ID + +I<All> occurences of the specifier will be replaced. + +=head2 --regexp I<arg> (="/(\w|\s)/g") + +Use regular expression I<arg> to clean up the media title before +it is used in the filename. The syntax supports both "i" +(case-insensitive) and "g" (global or "find all"). + +=head2 --exec I<arg> + +Invoke I<arg> after media download finishes. The following specifiers +are supported: + + %f Path to the downloaded media file + +I<All> occurences of the specifier will be replaced. + +=head1 TROUBLESHOOTING + +=head2 error: specify path to quvi(1) command with --quvi + +clive uses C<quvi(1)> to parse the media details. Use the C<--quvi> to specify +the path. See also L</FILES>. + +=head2 error: specify path to a download command with --get-with + +clive uses a 3rd party command to download the media. Use the C<--get-with> to +specify the path to such command. See also L</FILES>. + +=head2 HTTP/1.0 500 Internal Server Error + +Any number of reasons. Some have been tracked back to unacceptable +user-agent string value and mangled HTTP headers (e.g. a green-eyed +HTTP proxy). See also L</KNOWN ISSUES>. + +=head1 KNOWN ISSUES + +=head2 Resuming partially transferred files may fail + +Some websites are known to refuse to work with the HTTP requests to +resume a file transfer. + +=head3 Workaround + +None known. You will have to remove the existing file before you try +again. + +=head2 HTTP user-agent + +Some websites refuse to play nice with renegade user-agent strings. + +=head3 Recommendations +
View file
clive-2.3.3.tar.gz/examples/cliverc
Added
@@ -0,0 +1,37 @@ + +# Typical paths. +# /usr/local/share/clive/config +# /usr/share/clive/config +# /etc/clive/config +# ~/.cliverc +# ~/.clive/config +# ~/.config/clive/config +# or set the path to the file with CLIVE_CONFIG env. variable. + +# quvi command. clive appends "--quiet" to it. +# %u Media page URL +# quvi 0.4.1+ +--quvi "/usr/bin/quvi -c http %u" +#--quvi "/usr/bin/quvi --category-http %u" + +# Download command. +# %u Media stream URL +# %f Path to the downloaded media file +# %n File name (basename of the above) +# Make a note of user-agent. Some websites are known refuse to work +# with the curl default user-agent value. Use the quvi default value. +--get-with "/usr/bin/curl -L -C - -o %f %u --user-agent Mozilla/5.0" + +# Play copied media file when transfer finishes. +# %f Path to the local media file +#--exec "/usr/bin/vlc --quiet %f" + +# Save downloaded media as, where +# %h Media host ID +# %t Media title +# %s File suffix +# %i Media ID +#--filename-format "%t_%i.%s" + +# Cleanup title with regular expression. +#--regexp "/(\\w)/g"
View file
clive-2.3.3.tar.gz/t/clive-Pod.t
Added
@@ -0,0 +1,11 @@ +use warnings; +use strict; + +use Test::More; + +eval "use Test::Pod 1.00"; +plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; + +my @poddirs = qw(doc/man1); + +all_pod_files_ok(all_pod_files(@poddirs));
View file
clive-rpmlintrc
Changed
@@ -1,1 +1,5 @@ +# This line is mandatory to access the configuration functions +from Config import * + addFilter("perl5-naming-policy-not-applied") +addFilter("invalid-spec-name")
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.