|
|
@ -51,8 +51,6 @@ sub load_config { |
|
|
|
or do { _log(fatal => "Can't load config: $@"); }; |
|
|
|
or do { _log(fatal => "Can't load config: $@"); }; |
|
|
|
|
|
|
|
|
|
|
|
_log(debug => "Sanity checks for config file"); |
|
|
|
_log(debug => "Sanity checks for config file"); |
|
|
|
_log(fatal => "Missing section `defaults` in config file") |
|
|
|
|
|
|
|
unless (exists $config->{defaults} and ref $config->{defaults} eq 'HASH'); |
|
|
|
|
|
|
|
_log(fatal => "Missing section `feeds` in config file") |
|
|
|
_log(fatal => "Missing section `feeds` in config file") |
|
|
|
unless (exists $config->{feeds} and ref $config->{feeds} eq 'ARRAY'); |
|
|
|
unless (exists $config->{feeds} and ref $config->{feeds} eq 'ARRAY'); |
|
|
|
_log(warn => "'outdir' not set in config, using /tmp"), $config->{outdir} = '/tmp' |
|
|
|
_log(warn => "'outdir' not set in config, using /tmp"), $config->{outdir} = '/tmp' |
|
|
@ -71,9 +69,8 @@ sub load_config { |
|
|
|
_log(fatal => "Empty 'matches' section in feed") |
|
|
|
_log(fatal => "Empty 'matches' section in feed") |
|
|
|
unless (scalar @{ $feed->{matches} }); |
|
|
|
unless (scalar @{ $feed->{matches} }); |
|
|
|
|
|
|
|
|
|
|
|
foreach my $key (qw(use lookup)) { |
|
|
|
$feed->{use} //= 'link'; |
|
|
|
$feed->{$key} //= $config->{defaults}->{$key}; |
|
|
|
$feed->{lookup} //= 'title'; |
|
|
|
} |
|
|
|
|
|
|
|
# TODO: more |
|
|
|
# TODO: more |
|
|
|
($feed->{hostname}) = ($feed->{url} =~ m{://([a-z0-9\.-]+)}oi); |
|
|
|
($feed->{hostname}) = ($feed->{url} =~ m{://([a-z0-9\.-]+)}oi); |
|
|
|
} |
|
|
|
} |
|
|
@ -278,18 +275,6 @@ If set - will use http proxy, when fetching rss and torrent-files. Otherwise wil |
|
|
|
|
|
|
|
|
|
|
|
If set to any non-empty value, will accept and send back cookies in http-requests. Default - unset. |
|
|
|
If set to any non-empty value, will accept and send back cookies in http-requests. Default - unset. |
|
|
|
|
|
|
|
|
|
|
|
=head2 Section C<defaults> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This is default values for each configured feed. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=head3 C<use> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Use this field in RSS/ATOM entry as link to torrent file. For now, only acceptable value is 'link'. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=head3 C<lookup> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Lookup this field in RSS/ATOM entry for wanted keywords. Acceptable values: 'body', 'title' (default). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=head2 Section C<feeds> |
|
|
|
=head2 Section C<feeds> |
|
|
|
|
|
|
|
|
|
|
|
Configured feeds. |
|
|
|
Configured feeds. |
|
|
@ -306,9 +291,13 @@ If feed entry matches ANY keyword, torrent file will be downloaded and stored to |
|
|
|
|
|
|
|
|
|
|
|
Matches list must contain at least one keyword. If you want all torrents from this feed, use '/.*/' regex keyword. |
|
|
|
Matches list must contain at least one keyword. If you want all torrents from this feed, use '/.*/' regex keyword. |
|
|
|
|
|
|
|
|
|
|
|
=head3 C<lookup>, C<use> |
|
|
|
=head3 C<lookup> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Lookup this field in RSS/ATOM entry for wanted keywords. Acceptable values: 'body', 'title' (default). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=head3 C<use> |
|
|
|
|
|
|
|
|
|
|
|
Normally this options uses values from C<defaults> section, but you may override them for each feed you want. |
|
|
|
Use this field in RSS/ATOM entry as link to torrent file. For now, only acceptable value is 'link'. |
|
|
|
|
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
|
|
=head1 SEE ALSO |
|
|
|
|
|
|
|
|
|
|
|