PHPで頼む言われてんのにRuby厨また沸いてんのかw

$api = 'https://www.pixiv.net/ajax/illust/79136582/pages';
$json = json_decode(file_get_contents($api));
$ctx = stream_context_create(['http'=>['header'=>"Referer: {$api}\r\n"]]);
foreach ($json->body as $body) {
  $url = $body->urls->original;
  $fname = basename($url);
  file_put_contents($fname, file_get_contents($url, false, $ctx));
  sleep(1);
}

保存先やら上書きやら考慮してないからこのままは使うなよ