11 $SIG{ __DIE__ } = sub { Carp::confess( @_ ) };
17 getter => 'filegetter',
18 'plugin.youtube.QUALITY' => 'hd',
19 'plugin.youtube.ADAPTIVE' => 1,
20 'plugin.filegetter.FILEPATTERN' => './%3$s.flv',
28 foreach (keys(%{$m})) {
29 printf("%s: %s\n", $_, defined($m->{$_})?$m->{$_}:'(undef)');
33 print("Downloading $m->{'TITLE'}\n");
39 GetOptions("i" => \$info, "d" => \$debug, "o=s" => \@options);
40 %config = (%config, map { split(/=/, $_, 2) } @options);
42 push(@INC, dirname(realpath($0)));
45 unless(libvideosite::register_api({
46 link_callback => \&link_callback,
47 _config_default => sub { return \%config },
48 _debug => sub { return $debug },
50 die("Error registering API: $libvideosite::error");
53 unless(libvideosite::init()) {
54 die("Could not init libvideosite: $libvideosite::error");
58 printf("Handling %s...\n", $_);
59 libvideosite::check_for_link({
61 io => sub { print @_, "\n" },