mirror of
https://github.com/YGGverse/gemini-dl.git
synced 2026-03-31 17:15:32 +00:00
connect --follow argument to limit redirections count; set 5 by default (protocol specification)
This commit is contained in:
parent
3395d4fa17
commit
d9db0ad7e9
2 changed files with 4 additions and 3 deletions
|
|
@ -181,7 +181,7 @@ class Cli
|
|||
// Crawl next address...
|
||||
if ($this->option->crawl)
|
||||
{
|
||||
if ($this->redirects <= 5) // @TODO optional (currently protocol spec)
|
||||
if ($this->redirects <= $this->option->follow)
|
||||
{
|
||||
// Validate redirection target location
|
||||
if (filter_var($response->getMeta(), FILTER_VALIDATE_URL)) // @TODO resolve relative locations
|
||||
|
|
@ -216,7 +216,8 @@ class Cli
|
|||
print(
|
||||
Message::red(
|
||||
sprintf(
|
||||
_("\tredirection count reached, continue next address in queue"),
|
||||
_("\tredirection limit (%d) reached, continue next address in queue"),
|
||||
$this->option->follow
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class Option
|
|||
public bool $crawl = false;
|
||||
public int $delay = 1;
|
||||
public bool $external = false;
|
||||
public int $follow = 0;
|
||||
public int $follow = 5;
|
||||
public bool $help = false;
|
||||
public string $index = 'index.gmi';
|
||||
public bool $keep = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue