Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting a 403 from browscap.org #66

Open
nicekiwi opened this issue Jul 7, 2014 · 6 comments
Open

getting a 403 from browscap.org #66

nicekiwi opened this issue Jul 7, 2014 · 6 comments

Comments

@nicekiwi
Copy link

nicekiwi commented Jul 7, 2014

file_get_contents(http://browscap.org/stream?q=Full_PHP_BrowsCapINI): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden

Can still grab it in my browser, so it looks like they've blocked remote download/scraping.

@Funzinator
Copy link

What is the User-Agent string you are sending from your PHP instance? You should consider adding a reasonable value like "My Browser Capabilities Scraper v1.0" in case you didn't set any.

ini_set('user_agent', $myUserAgentString) should do the trick.

Another possibility could be that repetitive download attempts have got you (temporarily) banned from browscap.org.

@nicekiwi
Copy link
Author

nicekiwi commented Aug 4, 2014

Uhhh User-Agent string?

I'm calling:
$browser = BrowserDetect::getInfo();

This worked for half a year with no issues, So I doubt its a ban.

Preforms a wGet from the server terminal

Ok, it seems I am banned.. 0_o;; phpbrowsecap caches the file though right? Why would it have been downloading so many times?

@Funzinator
Copy link

That's not what I meant. In the source of your original question, you state that you use file_get_contents(...). I meant the User-Agent PHP sends to the web server at browscap.org. This is controlled by the ini setting.

Seems pretty much that you have been banned. The rules for the download are very strict. Calling the version URL is not restricted, but calling the URL you mention above is. As stated on browscap.org, you have to contact the browscap people via the Discussion Forum to get yourself unbanned.

Anyway, the browscap.ini is cached and you can download the ini manually from a non-blocked machine and copy it over.

@nicekiwi
Copy link
Author

nicekiwi commented Aug 6, 2014

No, I'm not calling file_get_contents() directly, that's the trace error I got in the Laravel PHP debugger.

@Funzinator
Copy link

You have to admit that I can't know that if I read your initial issue description...
Anyway, seems you are banned because stream?q=Full_PHP_BrowsCapINI has been downloaded too frequently. Any luck on the Discussion Forum?

@korys
Copy link

korys commented May 18, 2017

Have this issue been fixed in ver. 2.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants