Browse Source

* honor config options 'proxy' and 'cookies'

master
Alex 'AdUser' Z 10 years ago
parent
commit
8c266c3d92
  1. 11
      twatch-lite

11
twatch-lite

@ -205,8 +205,14 @@ my $state = load_state ($opts{state});
my $ua = LWP::UserAgent->new; my $ua = LWP::UserAgent->new;
$ua->agent("twatch-lite/$VERSION"); $ua->agent("twatch-lite/$VERSION");
$ua->show_progress(1) if $opts{verbose}; $ua->show_progress(1) if $opts{verbose};
if ($config->{proxy}) {
$ua->proxy(['http', 'https'], $config->{proxy});
} else {
$ua->env_proxy; $ua->env_proxy;
# TODO: save cookies? }
if ($config->{cookies}) {
$ua->cookie_jar({ file => "$ENV{HOME}/.config/twatch-lite/cookies.txt" });
}
foreach my $feed (@{ $config->{feeds} }) { foreach my $feed (@{ $config->{feeds} }) {
my $host = $feed->{hostname}; my $host = $feed->{hostname};
@ -218,5 +224,6 @@ foreach my $feed (@{ $config->{feeds} }) {
} }
save_state($opts{state}, $state); save_state($opts{state}, $state);
# cleanup
exit 0; exit 0;
__END__

Loading…
Cancel
Save