| 116 | | ($data, $success, $status) = Shepherd::Common::get_url(url => "http://$user:$pw\@minnie.tuhs.org/tivo-bin/xmlguide.pl", retries => 5, retry_delay => 20); |
| 117 | | unless ($success) |
| 118 | | { |
| 119 | | if ($status =~ /401/) |
| 120 | | { |
| 121 | | print "Your OzTivo username and/or password may be incorrect!\n". |
| 122 | | "The username and password you supplied when configuring the oztivo grabber\n" . |
| 123 | | "must match your registration details on the OzTivo.com site.\n". |
| 124 | | "If this error persists, try reconfiguring: ". |
| 125 | | " tv_grab_au --configure $progname\n"; |
| 126 | | print "Download failed: $status\n"; |
| 127 | | } |
| 128 | | exit 5; |
| | 116 | foreach my $tries (1 .. 3) { |
| | 117 | ($data, $success, $status) = Shepherd::Common::get_url( |
| | 118 | url => "http://$user:$pw\@minnie.tuhs.org/tivo-bin/xmlguide.pl", |
| | 119 | retries => 5, retry_delay => 20); |
| | 120 | |
| | 121 | unless ($success) |
| | 122 | { |
| | 123 | if ($status =~ /401/) |
| | 124 | { |
| | 125 | print "Your OzTivo username and/or password may be incorrect!\n". |
| | 126 | "The username and password you supplied when configuring the oztivo grabber\n" . |
| | 127 | "must match your registration details on the OzTivo.com site.\n". |
| | 128 | "If this error persists, try reconfiguring: ". |
| | 129 | " tv_grab_au --configure $progname\n"; |
| | 130 | } |
| | 131 | print "Download failed: $status\n"; |
| | 132 | exit 5; |
| | 133 | } |
| | 134 | |
| | 135 | my $bytes = do { use bytes; length($data) }; |
| | 136 | last if $bytes > 1000 or $data !~ /<message>/i; |
| | 137 | $data =~ /<message>(.*?)<\/message>/si; |
| | 138 | print "OzTivo message: $1\n"; |
| | 139 | exit 6 if $tries == 3; |
| | 140 | my $sleep = int(30 + rand(30)); |
| | 141 | print "Sleeping for $sleep\n"; |
| | 142 | sleep($sleep); |