jonasva / google-trends

Google Trends unofficial PHP API
MIT License
22 stars 15 forks source link

Fatal error: Uncaught exception 'GuzzleHttp\Exception\ClientException' #2

Open Evgeny-Ru opened 8 years ago

Evgeny-Ru commented 8 years ago

Hi, @jonasva, thank's for GT API.

When I try to execute the code

require ('vendor/autoload.php');

use Jonasva\GoogleTrends\GoogleSession;
use Jonasva\GoogleTrends\GoogleTrendsResponse;
use GuzzleHttp\Exception\BadResponseException;

$config = [
    'email' =>  'dbaemailforgt@gmail.com',
    'password' =>  'xxxx',
    'recovery-email'  =>  'xxxx'
];

$session = (new GoogleSession($config))->authenticate();

I'm getting the error

Fatal error: Uncaught exception 'GuzzleHttp\Exception\ClientException' with message 'Client error response [url] https://accounts.google.com/CheckCookie?chtml=LoginDoneHtml [status code] 400 [reason phrase] Bad Request' in /home/ubuntu/workspace/dba/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 89 GuzzleHttp\Exception\ClientException: Client error response [url] https://accounts.google.com/CheckCookie?chtml=LoginDoneHtml [status code] 400 [reason phrase] Bad Request in /home/ubuntu/workspace/dba/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 89 Call Stack: 0.0023 236712 1. {main}() /home/ubuntu/workspace/dba/dbaQueryToGT.php:0 0.0093 410440 2. Jonasva\GoogleTrends\GoogleSession->authenticate() /home/ubuntu/workspace/dba/dbaQueryToGT.php:17 0.7901 997848 3. GuzzleHttp\Client->get() /home/ubuntu/workspace/dba/vendor/jonasva/google-trends/src/Jonasva/GoogleTrends/GoogleSession.php:270 0.7904 1009608 4. GuzzleHttp\Client->send() /home/ubuntu/workspace/dba/vendor/guzzlehttp/guzzle/src/Client.php:204

Also, Google notify me about the ban

If the error with Guzzle arose from the ban, is there some way to fix it?

Thank's in advance.

omergisha commented 8 years ago

The same happened to me, though without the ban.

Any ideas?

jonasva commented 8 years ago

Google changed their login process a little bit, I'm working on updating the bundle to cope with that. Will have an update soon.

sircovsw commented 8 years ago

The same error.

tanxeel commented 8 years ago

having same issue, working fine on localhost but error on live server. if any one have alternate for this please mention. Thanks

serjgamover commented 7 years ago

Hey @jonasva Do you plan to update the task?

Epizefiri commented 7 years ago

Hola @jonasva, news?

mazard commented 7 years ago

This is not working anymore and the author doesn't look like is going to fix it. For who may interest, there is a working php library for google trends api that works pretty well. It has the same features than this library and some more.

ReymOleg commented 5 years ago

Google changed their login process a little bit, I'm working on updating the bundle to cope with that. Will have an update soon.

Thanks (no) for updates!!!!