X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=videosite-dl.pl;h=4222f782dedff4cada23ddaa54b77a9169106232;hb=09d45a4c4460dce9322f4528dad5123322ab6b38;hp=594b020680704b81be1dfd506ff80bb00b3d1f3a;hpb=3255f6f448ae2e392871dc5241536b0dfb009a59;p=videosite.git diff --git a/videosite-dl.pl b/videosite-dl.pl index 594b020..4222f78 100755 --- a/videosite-dl.pl +++ b/videosite-dl.pl @@ -18,6 +18,7 @@ my %config = ( 'plugin.youtube.QUALITY' => 'hd', 'plugin.filegetter.FILEPATTERN' => './%3$s.flv', ); +my @options; sub link_callback { my $m = shift; @@ -34,19 +35,15 @@ sub link_callback { } -GetOptions("i" => \$info, "d" => \$debug); +GetOptions("i" => \$info, "d" => \$debug, "o=s" => \@options); +%config = (%config, map { split(/=/, $_, 2) } @options); push(@INC, dirname(realpath($0))); load 'libvideosite'; unless(libvideosite::register_api({ - config_init => sub {}, - config_save => sub {}, - config_get => sub { return $config{join(".", @{$_[0]})} }, - config_set => sub { $config{join(".", @{$_[0]})} = $_[1] }, - config_has => sub { exists($config{join(".", @{$_[0]})}) }, - config_del => sub { delete($config{join(".", @{$_[0]})}) }, link_callback => \&link_callback, + _config_default => sub { return \%config }, _debug => sub { return $debug }, })) { die("Error registering API: $libvideosite::error"); @@ -60,7 +57,7 @@ foreach (@ARGV) { printf("Handling %s...\n", $_); libvideosite::check_for_link({ message => $_, - ewpf => sub { print @_, "\n" }, + io => sub { print @_, "\n" }, window => "", }); }