Youtube: Add support for adaptive video formats (split video/audio)
[videosite.git] / videosite-dl.pl
index 594b020..688efb3 100755 (executable)
@@ -16,6 +16,7 @@ my %config = (
     mode => 'download',
     getter => 'filegetter',
     'plugin.youtube.QUALITY' => 'hd',
+    'plugin.youtube.ADAPTIVE' => 1,
     'plugin.filegetter.FILEPATTERN' => './%3$s.flv',
 );
 
@@ -40,13 +41,8 @@ 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 +56,7 @@ foreach (@ARGV) {
     printf("Handling %s...\n", $_);
     libvideosite::check_for_link({
         message => $_,
-        ewpf => sub { print @_, "\n" },
+        io => sub { print @_, "\n" },
         window => "",
     });
 }