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

Not returning anything? #121

Closed
GeorgeFive opened this issue Apr 18, 2018 · 16 comments
Closed

Not returning anything? #121

GeorgeFive opened this issue Apr 18, 2018 · 16 comments

Comments

@GeorgeFive
Copy link

Hi there. Been using the script for ages, and it was working fine up until last night. Now it doesn't return anything.... no data whatsoever. I'm away from my PC right now so I can't give the exact error, but basically it said that it failed to retrieve the URL.

I've double checked that I have the updated version, and I do. I even redownloaded it and tried the demo included with it. Nothing.

If it's not an issue with imdb, is there something on my server to check that may have somehow changed behind my back?

@XaXo81
Copy link

XaXo81 commented Apr 18, 2018

Same here..

@paxter
Copy link
Contributor

paxter commented Apr 18, 2018

Works for me as usual. Maybe IMDb blocked your ip addresses?

@XaXo81
Copy link

XaXo81 commented Apr 18, 2018

Actually, I open imdb from time to time but most of the time I just get this ..
IMDb - D'oh

We're sorry, something went wrong.
Please try again...wait...wait...yep, try reload/refresh now.
But if you are seeing this again, please report it here.
Please explain which page you were at and where on it that you clicked
Thank you!

I have noticed that not only this script doesn't work normally, PHP-IMDB-Grabber have the same problem here is the closed ticket

@paxter
Copy link
Contributor

paxter commented Apr 18, 2018

Doesn't sound like an issue of imdbphp for me.

@jreklund
Copy link
Collaborator

I'm afraid I can't replicate this problem at this time. It works great with the demo application and utilized in another application.

Please activate the debug mode if your problem still exists.

$config = new \Imdb\Config();
$config->debug = 1;
$movie = new \Imdb\Title(0360486,$config);

@GeorgeFive
Copy link
Author

Still the same on my end. I tried accessing it through a browser running from my server and it did work fine, but the script won't do anything. Wasn't sure if there was some change on their side that broke it.

[debug] [Page] Requesting [http://www.imdb.com/title/tt6772950/]
[error] [Page] Failed to retrieve url [
http://www.imdb.com/title/tt6772950/
]. Response headers:
Array
(
[0] => HTTP/1.1 503 Service Unavailable

[1] => Date: Wed, 18 Apr 2018 18:10:21 GMT

[2] => Server: Server

[3] => Vary: Content-Type,Accept-Encoding,User-Agent

[4] => Last-Modified: Wed, 16 May 2012 19:48:13 GMT

[5] => ETag: "210-4c02c997c5940"

[6] => Accept-Ranges: bytes

[7] => Content-Length: 528

[8] => Connection: close

[9] => Content-Type: text/html

@XaXo81
Copy link

XaXo81 commented Apr 18, 2018

GeorgeFive, after twenty minutes, try open imdb.com again if it loads open imdbphp search some movie, then when you see the error try to open imdb again with a browser. I always get the IMDb - D'oh error after using imdbphp, I think imdb are blocking the script when it makes a connection.

@GeorgeFive
Copy link
Author

Yep, same thing. Script won't work, then the D'oh error in the browser.

@jreklund
Copy link
Collaborator

Can't really be sure be sure but IMDb have switched to https and all links inside imdbphp points towards http.
Can you open this one? (from server)
https://www.imdb.com/title/tt6772950/
Does it fail on this one? (from server)
http://www.imdb.com/title/tt6772950/

@XaXo81
Copy link

XaXo81 commented Apr 18, 2018

I can confirm one more not working script on one my friend. So it's not an isolated problem, also as I can see the PHP-IMDB-Grabber was having the same issue, didn't know how the https solve the things.
jreklund
Yes, it's failing on the two of them, but I have to wait at least 10-20 minutes until imdb unblock me.

@GeorgeFive
Copy link
Author

Failing on both of them for me too, but it's been more than 10-20 minutes for me.... hasn't worked at all in two days now,

@jreklund
Copy link
Collaborator

If it's not working with the https patches that PHP-IMDB-Grabber added (in version 3.0.8), then I'm afraid that solution won't work here too. And IMDb have blocked scraping from your area.
The https patches made only help with incorrect redirection from http to https urls.

You can try to set $config->ip_address (use_proxy turned off) based on a UK proxy IP-address or connect entirely with a proxy.

[proxy]
; Enable HTTP-Proxy support
; use_proxy = 0
; Set originating IP address of a client connecting to a web server through an HTTP proxy or a load balancer.
; ip_address = ''
; Set hostname of HTTP-Proxy
; proxy_host = ''
; Set port on which HTTP-Proxy is listening
; proxy_port = ''
; Set username for authentication against HTTP-Proxy, if the proxy requires login.
; proxy_user = ''
; Set password for authentication against HTTP-Proxy, if the proxy requires login.
; proxy_pw = ''

@GeorgeFive
Copy link
Author

Do you know how long the blocks usually last? He mentioned 10-20 minutes for him, which isn't the case for me, but...

I can just wait it out if need be, I just use imdb as extra data on my site, it's not killing anything to lose it for a bit.

I'll try the proxy when I get home tonight, gotta go to work. Just fill in the ip_address option?

jreklund added a commit that referenced this issue Apr 18, 2018
Request only over https; skip IMDb 302 Found.
@jreklund
Copy link
Collaborator

jreklund commented Apr 18, 2018

I'm afraid I don't know how long you get blocked. Haven't happen to me before.
I have now switched every link from http into https, so that we don't get any 302 redirects anymore. Don't know if it solves anything for you guys thought.

Yes you fill it in like so:

$config = new \Imdb\Config();
$config->ip_address = '127.0.0.1'; // Change into a proxy ip
$movie = new \Imdb\Title(0360486,$config);

@XaXo81
Copy link

XaXo81 commented Apr 18, 2018

I can confirm that with a proxy is running fine and our networks are maybe blacklisted. Not totally but blacklisted.

@GeorgeFive
Copy link
Author

Ok, all is working fine now. The blocks last about fifteen minutes. I think it was an issue with the https, because I noticed in the logs that it was redirecting from http to https in very rapid succession. I would imagine that imdb catches that and issues a temporary block on the IP. Without the https, even loading something from the demo would rapidly shoot out the redirects. After, it works as expected.

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

4 participants