FANZA: 年齢認証Cookieを送信する
This commit is contained in:
parent
a04faa7001
commit
b232279c25
@ -3,6 +3,7 @@
|
||||
namespace App\MetadataResolver;
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Cookie\CookieJar;
|
||||
use Symfony\Component\DomCrawler\Crawler;
|
||||
|
||||
class FanzaResolver implements Resolver
|
||||
@ -43,7 +44,9 @@ class FanzaResolver implements Resolver
|
||||
|
||||
public function resolve(string $url): Metadata
|
||||
{
|
||||
$res = $this->client->get($url);
|
||||
$cookieJar = CookieJar::fromArray(['age_check_done' => '1'], 'dmm.co.jp');
|
||||
|
||||
$res = $this->client->get($url, ['cookies' => $cookieJar]);
|
||||
$html = (string) $res->getBody();
|
||||
$crawler = new Crawler($html);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user