メロンから取得したサムネイルからcensored flagらしきパラメータを外す
This commit is contained in:
parent
ad5fbc7ada
commit
581c1ed952
@ -14,7 +14,14 @@ class MelonbooksResolver implements Resolver
|
|||||||
$res = $client->get($url, ['cookies' => $cookieJar]);
|
$res = $client->get($url, ['cookies' => $cookieJar]);
|
||||||
if ($res->getStatusCode() === 200) {
|
if ($res->getStatusCode() === 200) {
|
||||||
$ogpResolver = new OGPResolver();
|
$ogpResolver = new OGPResolver();
|
||||||
return $ogpResolver->parse($res->getBody());
|
$metadata = $ogpResolver->parse($res->getBody());
|
||||||
|
|
||||||
|
// censoredフラグの除去
|
||||||
|
if (mb_strpos($metadata->image, '&c=1') !== false) {
|
||||||
|
$metadata->image = preg_replace('/&c=1/u', '', $metadata->image);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $metadata;
|
||||||
} else {
|
} else {
|
||||||
throw new \RuntimeException("{$res->getStatusCode()}: $url");
|
throw new \RuntimeException("{$res->getStatusCode()}: $url");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user