Hello,
I not sure if there already is a way to choose only some album when
fetching with picasa-get. So I give in attachement a patch to picasa-get
which allows to give at the end of the command line a list of regexp for
selecting albums.
'picasa-get --user-id toto Perl' will only select albums whose title
matches .*Perl.* (in order to simplify the writing of the rules).
It is mainly a quick and dirty hack, so be careful :)
Sorry if I missed something existing.
Cheers,
Olivier
Subject: | choose_album.patch |
--- /usr/local/bin/picasa-get 2008-12-11 02:01:43.000000000 +0100
+++ /home_s/olivier/scripts/picasa-get 2008-12-11 02:53:10.000000000 +0100
@@ -52,10 +52,10 @@
if ($kind eq 'album') {
$user_id ||= 'default';
-
+ my @wanted = @ARGV;
$options{user_id} = $user_id;
my @albums = $service->list_albums(%options);
- &download_albums(@albums);
+ &download_albums(\@wanted, @albums);
}
else {
@@ -73,10 +73,14 @@
}
sub download_albums {
+ my $wanted = shift;
my @albums = @_;
ALBUM:
for my $album (@albums) {
+ if (@{$wanted}) {
+ next ALBUM unless grep {$album->title =~ /.*$_.*/} @{$wanted};
+ }
my $dir_name = to_filename($album->title);
if (-e $dir_name) {
warn "$0: $dir_name exists, will not overwrite\n";