ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Convert-UUlib/example-decoder
(Generate patch)

Comparing Convert-UUlib/example-decoder (file contents):
Revision 1.14 by root, Fri Oct 10 20:23:12 2008 UTC vs.
Revision 1.18 by root, Sat Jul 18 05:58:26 2009 UTC

41# of some subject lines not detected properly by uulib: 41# of some subject lines not detected properly by uulib:
42SetFileNameCallback sub { 42SetFileNameCallback sub {
43 return unless $_[1]; # skip "Re:"-plies et al. 43 return unless $_[1]; # skip "Re:"-plies et al.
44 local $_ = $_[0]; 44 local $_ = $_[0];
45 45
46 return $1 if /(\S+\s+IMG_\d+.jpg)/i;
47
48 # the following rules are rather effective on some newsgroups, 46 # the following rules are rather effective on some newsgroups,
49 # like alt.binaries.games.anime, where non-mime, uuencoded data 47 # like alt.binaries.games.anime, where non-mime, uuencoded data
50 # is very common 48 # is very common
49
50 # File 06 of 33 - Kendo - Final - 0001.jpg (2/3)
51 return $1 if /File \d+ of \d+ - (.*) \(\d+\/\d+\)/i;
51 52
52 # if we find some *.rar, take it as the filename 53 # if we find some *.rar, take it as the filename
53 return $1 if /(\S{3,}\.(?:[rstuvwxyz]\d\d|rar))\s/i; 54 return $1 if /(\S{3,}\.(?:[rstuvwxyz]\d\d|rar))\s/i;
54 55
55 # one common subject format 56 # one common subject format
99 } 100 }
100 print "\n"; 101 print "\n";
101 } 102 }
102 103
103 print $uu->filename; 104 print $uu->filename;
105
106 $uu->remove_temp;
107
104 if (my $err = $uu->decode_temp) { 108 if (my $err = $uu->decode) {
105 print " ", strerror $err, "\n"; 109 print ", ", strerror $err, "\n";
106 } else { 110 } else {
107 print " temporarily decoded to ", $uu->binfile;
108 $uu->remove_temp;
109
110 if (my $err = $uu->decode ()) {
111 print ", ", strerror $err, "\n";
112 } else {
113 print ", saved as uudst/", $uu->filename, "\n"; 111 print ", saved as uudst/", $uu->filename, "\n";
114 }
115 } 112 }
116} 113}
117 114
118print "cleanup...\n"; 115print "cleanup...\n";
119 116
120CleanUp(); 117CleanUp;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines