不要な成否判定をやめる
This commit is contained in:
parent
40fedf59d4
commit
59aec2c038
@ -25,7 +25,6 @@ class NicoSeigaResolver implements Resolver
|
|||||||
public function resolve(string $url): Metadata
|
public function resolve(string $url): Metadata
|
||||||
{
|
{
|
||||||
$res = $this->client->get($url);
|
$res = $this->client->get($url);
|
||||||
if ($res->getStatusCode() === 200) {
|
|
||||||
$html = (string)$res->getBody();
|
$html = (string)$res->getBody();
|
||||||
$metadata = $this->ogpResolver->parse($html);
|
$metadata = $this->ogpResolver->parse($html);
|
||||||
$crawler = new Crawler($html);
|
$crawler = new Crawler($html);
|
||||||
@ -39,8 +38,5 @@ class NicoSeigaResolver implements Resolver
|
|||||||
$metadata->image = "https://lohas.nicoseiga.jp/thumb/${matches[1]}l?";
|
$metadata->image = "https://lohas.nicoseiga.jp/thumb/${matches[1]}l?";
|
||||||
|
|
||||||
return $metadata;
|
return $metadata;
|
||||||
} else {
|
|
||||||
throw new \RuntimeException("{$res->getStatusCode()}: $url");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user