如何通过卷发通过蒸汽年龄检查? [英] How to pass the steam age check using curl?

查看:50
本文介绍了如何通过卷发通过蒸汽年龄检查?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的卷毛有问题.我想尝试使用curl访问Steam游戏页面,但我必须通过年龄检查.因为curl无法加载javascript,如何单击按钮才能进入游戏页面的问题.这是我的代码.

I have a problem with curl. I wanna tried to access a steam game page by using curl but I have to pass the age check. The problem that how to click the button in order to go to the game page because curl can't load javascript. Here is my code.

$url = "http://store.steampowered.com/app/312660/";
$file = __DIR__ . DIRECTORY_SEPARATOR . "cookie.txt";
$postData = array(
'ageDay' => '31',
'ageMonth' => 'July',
'ageYear' => '1993'
);
$ch = curl_init();

curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,true);
curl_setopt($ch,CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13");
curl_setopt($ch,CURLOPT_POSTFIELDS,$postData);
curl_setopt($ch,CURLOPT_COOKIESESSION, true);
curl_setopt($ch,CURLOPT_COOKIEJAR,$file); 
curl_setopt($ch,CURLOPT_COOKIEFILE,$file);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);

curl_close($ch);

这里有人可以帮助我通过Valve实施的年龄验证系统吗?无论如何,可以使用curl方法单击按钮吗?谢谢.

Does anyone here can help me to by pass the age verification system which implemented by Valve? Anyway, is it possible to do clicking the button by using curl method? Thank you.

推荐答案

这是示例代码,现在您将获得游戏视频,因为我们将强制使用cookie.因此,您不会看到年龄限制屏幕

Here is the sample code, now you will get the game video because we r forcing the cookie. So you won't see the age restriction screen

<?php
$url = "http://store.steampowered.com/app/312660/";
// $file = __DIR__ . DIRECTORY_SEPARATOR . "cookie.txt";
// $postData = array(
// 'ageDay' => '31',
// 'ageMonth' => 'July',
// 'ageYear' => '1993'
// );
$ch = curl_init();

curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,true);
curl_setopt($ch,CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13");
curl_setopt($ch,CURLOPT_POSTFIELDS,$postData);
// curl_setopt($ch,CURLOPT_COOKIESESSION, true);
// curl_setopt($ch,CURLOPT_COOKIEJAR,$file); 
// curl_setopt($ch,CURLOPT_COOKIEFILE,$file);
$strCookie = 'mature_content=' . 1 . '; path=/';
curl_setopt( $ch, CURLOPT_COOKIE, $strCookie );

curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);

curl_close($ch);
echo $data;
?>

这篇关于如何通过卷发通过蒸汽年龄检查?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆