… | |
… | |
18 | 0; |
18 | 0; |
19 | } |
19 | } |
20 | |
20 | |
21 | SetOption (OPT_IGNMODE, 1); |
21 | SetOption (OPT_IGNMODE, 1); |
22 | SetOption (OPT_VERBOSE, 1); |
22 | SetOption (OPT_VERBOSE, 1); |
|
|
23 | #SetOption (OPT_DOTDOT, 1); |
23 | |
24 | |
24 | # show the three ways you can set callback functions |
25 | # show the three ways you can set callback functions |
25 | SetFNameFilter (\&namefilter); |
26 | SetFNameFilter (\&namefilter); |
26 | |
27 | |
27 | SetBusyCallback ("busycb",333); |
28 | SetBusyCallback ("busycb",333); |
28 | |
29 | |
29 | SetMsgCallback (sub { |
30 | SetMsgCallback (sub { |
30 | my($msg,$level)=@_; |
31 | my($msg,$level)=@_; |
31 | print uc(strmsglevel($_[1])),": $msg\n"; |
32 | print uc(strmsglevel($_[1])),": $msg\n"; |
32 | }); |
33 | }); |
|
|
34 | |
|
|
35 | SetFileNameCallback sub { |
|
|
36 | return unless $_[1]; # skip "Re:"-plies et al. |
|
|
37 | local $_ = $_[0]; |
|
|
38 | |
|
|
39 | # the following rules are rather effective on some newsgroups, |
|
|
40 | # like alt.binaries.games.anime, where non-mime, uuencoded data |
|
|
41 | # is very common |
|
|
42 | |
|
|
43 | # if we find some *.rar, take it |
|
|
44 | return $1 if /(\S+\.(?:[rstuvwxyz]\d\d|rar))\s/i; |
|
|
45 | |
|
|
46 | # - filename.par (04/55) |
|
|
47 | return $1 if /- "?(\S+\.\S+?)"? (:yenc )?\(\d+\/\d+\)/i; |
|
|
48 | |
|
|
49 | return $1 if /No\.[ 0-9]+ (\S+\....) (?:\d+ bytes )?\[/; |
|
|
50 | |
|
|
51 | # otherwise just pass what we have |
|
|
52 | return (); |
|
|
53 | }; |
|
|
54 | |
33 | |
55 | |
34 | for(<uusrc/*>) { |
56 | for(<uusrc/*>) { |
35 | my($retval,$count)=LoadFile ($_,$_,1); |
57 | my($retval,$count)=LoadFile ($_,$_,1); |
36 | print "file($_), status(",strerror($retval),") parts($count)\n"; |
58 | print "file($_), status(",strerror($retval),") parts($count)\n"; |
37 | } |
59 | } |
… | |
… | |
58 | print "$k > $v, "; |
80 | print "$k > $v, "; |
59 | } |
81 | } |
60 | print "\n"; |
82 | print "\n"; |
61 | } |
83 | } |
62 | |
84 | |
|
|
85 | if ($uu->state & FILE_OK) { |
63 | print strerror($uu->decode_temp)."\n"; |
86 | print strerror($uu->decode_temp)."\n"; |
64 | print " temporarily decoded to ",$uu->binfile,"\n"; |
87 | print " temporarily decoded to ",$uu->binfile,"\n"; |
65 | $uu->remove_temp; |
88 | $uu->remove_temp; |
66 | |
89 | |
67 | print strerror($uu->decode)."\n"; |
90 | print strerror($uu->decode)."\n"; |
68 | print " saved as uudst/",$uu->filename,"\n"; |
91 | print " saved as uudst/",$uu->filename,"\n"; |
|
|
92 | } else { |
|
|
93 | print "file NOT ok, not decoding\n"; |
|
|
94 | } |
69 | } |
95 | } |
70 | |
96 | |
71 | print "cleanup...\n"; |
97 | print "cleanup...\n"; |
72 | |
98 | |
73 | CleanUp(); |
99 | CleanUp(); |