Changeset 590 for grabbers/jrobbo
- Timestamp:
- 03/04/07 19:25:06 (6 years ago)
- Files:
-
- 1 modified
-
grabbers/jrobbo (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
grabbers/jrobbo
r393 r590 8 8 9 9 my $progname = "jrobbo"; 10 my $version = "0.0 6";10 my $version = "0.07"; 11 11 12 12 use LWP::UserAgent; 13 13 use Getopt::Long; 14 14 use XMLTV; 15 use IO::Uncompress::Unzip qw(unzip $UnzipError) ; 15 16 $| = 1; 16 17 … … 43 44 $opt->{channels_file} = ""; 44 45 $opt->{outputfile} = "output.xmltv"; 45 $opt->{downloadfile} = "last_jrobbo_download.zip";46 46 $opt->{region} = 94; 47 47 … … 57 57 'channels_file=s' => \$opt->{channels_file}, # ignored 58 58 'output=s' => \$opt->{outputfile}, 59 'downloadfile=s' => \$opt->{downloadfile},60 59 'warper' => \$opt->{warper}, 61 60 'anonymous' => \$opt->{anonymous}, … … 77 76 printf " --region=<i> region as per the table below (default $opt->{region})\n"; 78 77 printf " --output=<file> file to send output to (default $opt->{outputfile})\n"; 79 printf " --downloadfile=<file> file to send output to (default $opt->{downloadfile})\n";80 78 printf " --warper fetch via webwarper (default: don't)\n"; 81 79 printf " --anonymous fetch anonymously (default: don't)\n"; … … 149 147 die "Failed to fetch $url after 3 retries!\n" if (!($response->is_success)); 150 148 151 open(F,">$opt->{downloadfile}") || die "can't open $opt->{downloadfile} for writing: $!\n";152 print F $response->content;153 close(F);154 155 156 149 # 157 150 # 4. uncompress data … … 159 152 160 153 my $data; 161 my $inputpipe = "/usr/bin/unzip -p $opt->{downloadfile} |"; 162 open(INFILE,"$inputpipe") || die "can't open $inputpipe for reading: $!\n"; 163 while (<INFILE>) { 164 $data .= $_; 165 } 166 close(INFILE); 167 154 unzip \$response->content => \$data 155 or die "unzip failed: $UnzipError\n"; 168 156 169 157 #
