-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdailymotion-download
99 lines (69 loc) · 1.99 KB
/
dailymotion-download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
use lib 'lib';
use WWW::Dailymotion::Download;
my $home =$ENV{HOME};
my $pwd = $ENV{PWD};
my $help;
my $version = 0;
my $destination;
my $quiet;
my $get_url;
my $title;
my $title_of_the_page;
my $found = 0;
GetOptions (
"h|help" => \$help,
"v|version" => \$version,
"o|output=s" => \$destination,
"q|quiet" => \$quiet,
"d|debug+" => \my $debug,
"t|title" => \$title,
"g|get-url" => \$get_url
);
my ($url) = @ARGV;
if ( (!defined($url)) and
(!defined($help))and
(!defined($destination))and
(!defined($quiet))and
(!defined($title))and
(!defined($get_url))and
(($version eq 1))
){
die "$WWW::Dailymotion::Download::VERSION\n";
}
elsif ((!defined($url)) or (defined($help)) ) {
die "
usage: dailymotion-download <video_url> [<video_url> ...]
options:
-d, --debug print debug output, repeat for more verbose
-h, --help print this help text and exit
-v, --version print program version and exit
";
}
my $wdd = WWW::Dailymotion::Download->new( debug => $debug );
for my $url (@ARGV){
print "Downloading $url\n";
$wdd->download($url);
}
=pod
=head1 NAME
dailymotion-download - command-line script to download videos from Dailymotion
=head1 SYNOPSIS
dailymotion-download <URL>
=head1 DESCRIPTION
Similar to the script being shipped with L<Yuji|http://search.cpan.org/~xaicron/>)'s effort
L<WWW::YouTube::Download>, this script is a Perl replacement for what the python based youtube-dl
does: help a user download videos from Dailymotion.com.
=head1 HISTORY
I've found the script L<dailymotion-dl.pl|http://backpan.perl.org/authors/id/G/GN/GNUTOO/dailymotion-dl.pl>
abandoned on CPAN. No user email was to be found, no description, and it had been deleted from CPAN.
The BackPAN had a copy, with the original GNU open source license intact.
Since then it has evolved quite a bit and doesn't resemble the original script anymore.
=head1 AUTHOR
Originally, CPAN ~GNUTOO.
=head1 LICENSE
GNU GPL 3.
=cut