get($url); if ($res->getStatusCode() === 200) { $ogpResolver = new OGPResolver(); $metadata = $ogpResolver->parse($res->getBody()); preg_match("~https://i\.pximg\.net/c/128x128/img-master/img/\d{4}/\d{2}/\d{2}/\d{2}/\d{2}/\d{2}/{$illustId}(_p0)?_square1200\.jpg~", $res->getBody(), $match); $illustThumbnailUrl = $match[0]; $illustUrl = $this->thumbnailToMasterUrl($illustThumbnailUrl); $metadata->image = $this->proxize($illustUrl); return $metadata; } else { throw new \RuntimeException("{$res->getStatusCode()}: $url"); } } }