{$comic}{'fullName'}) ******* -->
@@ -258,11 +279,22 @@ sub writeComic ($$) {
$comics->{$comic}{'fullName'}
-
+
$comics->{$comic}{'url'}
+EOF
+ if ( $comics->{$comic}{'mode'} == 3 ) {
+ print("Mode 3\n");
+ $content .= <
+EOF
+ } else {
+ $content .= <
+EOF
+ }
+ $content .= <
|
@@ -361,7 +393,7 @@ sub writeTitle ($$) {
Daily Comics for $today
-
+
|
$today_long |
|
@@ -381,22 +413,38 @@ sub directDownload ($$) {
my $cDir = $date->{'mon2'} . $date->{'year2'};
my $cDate = $date->{'day2'};
- my $cmd = "wget -q $file --referer='" . $comics->{$comic}{'url'} ."' --user-agent=\"$USER_AGENT\" -O - | /usr/bin/convert - jpeg:images/$cDir/$comic-$cDate.jpg";
+ my $cmd = "wget --no-check-certificate -q $file --referer='" . $comics->{$comic}{'url'} ."' --user-agent=\"$USER_AGENT\" -O - | /usr/bin/convert - jpeg:images/$cDir/$comic-$cDate.jpg";
return system($cmd);
}
#######################################################################
#######################################################################
+sub linkOnly ($$) {
+ my ( $comics, $comic, $date ) = @_;
+
+ return 0;
+}
+#######################################################################
+#######################################################################
sub indexDownload ($$) {
my ( $comics, $comic, $date ) = @_;
my ( @lines, $comicLine, $mainURL );
my $comicIndex = "indexes/index.$comic";
- my $wget_cmd = "wget -q --referer='$comics->{$comic}{'url'}' " .
- "--user-agent=\"$USER_AGENT\" " .
+ print("Getching Index $comicIndex.\n");
+ print("comic url: $comics->{$comic}{'url'}\n");
+
+ print Dumper($comics->{$comic});
+
+ my $wget_cmd = "wget --referer='$comics->{$comic}{'url'}' " .
+ "--no-check-certificate --user-agent=\"$USER_AGENT\" " .
"$comics->{$comic}{'url'} -O $comicIndex";
- system($wget_cmd);
+ print ("Using wget command:\n$wget_cmd\n");
+
+ my $status = system($wget_cmd);
+
+ print ("Return status: $status\n");
if ( ! open FILEN, "<$comicIndex" ) {
return "ERROR: Can't open index file for " . $comics->{$comic}{'fullName'} .
@@ -421,9 +469,13 @@ sub indexDownload ($$) {
## Find the comic strip URL based on the specified regex in the search
##
+ print "Using search $comics->{$comic}{'search'}\n";
+
foreach my $line (@lines) {
if ( $line =~ m/$comics->{$comic}{'search'}/i ) {
+ print "Found match:\n";
$comicLine = $1; chomp $comicLine;
+ print "+ $comicLine\n";
}
}
@@ -434,11 +486,13 @@ sub indexDownload ($$) {
my $cDate = $date->{'day2'};
if ( $comicLine ) {
+ print "Downloading Comic\n";
if ( $comicLine =~ m/(gif|jpg|png)/i ) { $comics->{$comic}{'ext'} = $1; }
my $comicURL = ( $comicLine =~ m/http/ ) ? $comicLine : $mainURL . $comicLine;
+ print "Final URL: $comicURL\n";
# Strip &
$comicURL =~ s/\&\;/&/g;
- my $cmd = "wget --user-agent=\"$USER_AGENT\" --referer='" . $comics->{$comic}{'url'} . "' -q '$comicURL' -O images/$cDir/$comic-$cDate.$comics->{$comic}{'ext'}";
+ my $cmd = "wget --no-check-certificate --user-agent=\"$USER_AGENT\" --referer='" . $comics->{$comic}{'url'} . "' -q '$comicURL' -O images/$cDir/$comic-$cDate.$comics->{$comic}{'ext'}";
system( $cmd );
return 0;
}