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

Import failed because of unfound movies #8

Closed
vavelsky opened this issue Jan 19, 2018 · 5 comments
Closed

Import failed because of unfound movies #8

vavelsky opened this issue Jan 19, 2018 · 5 comments
Labels

Comments

@vavelsky
Copy link

vavelsky commented Jan 19, 2018

Has anything changed on imdb that can't find a movies? I've tried multiple times on different titles with no success.
What should I change to make it work?

Here you have what I got with movie called "Project Nim":

Searching for Project Nim

Warning: file_get_contents(http://www.imdb.com/xml/find?json=1&nr=1&tt=on&q=Project+Nim): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
 in /.../Composer/imdb-importer/src/ImdbImporter/Importer.php on line 119

Fatal error: Uncaught Exception: Error while fetching tconst for Project Nim. in /.../Composer/imdb-importer/src/ImdbImporter/Importer.php:122
Stack trace:
#0 /.../Composer/imdb-importer/src/ImdbImporter/Importer.php(63): ImdbImporter\Importer->getIdByTitle('Project Nim')
#1 /.../Composer/imdb-importer/runme.php(11): ImdbImporter\Importer->submit(Array)
#2 {main}
  thrown in /.../Composer/imdb-importer/src/ImdbImporter/Importer.php on line 122
@shatner
Copy link

shatner commented Jan 19, 2018

IMDb has been pushing out a site-wide redesign, with a new structure for pages and some new behaviors (e.g., visiting the main IMDb page for a film now redirects to a “reference” page in some cases—enter http://www.imdb.com/title/tt1590193/ in s browser and get http://www.imdb.com/title/tt1590193/reference for instance).

Similar scripts for fetching information from IMDb have also been failing since this redesign. It’s unclear whether IMDb is intentionally shutting down the pathways being used to fetch information, or if the redesign has brought changes that will require the information to be fetched in a slightly different way.

An example of another affected project: https://github.com/yswery/PHP-IMDB-API/

@tomzx tomzx added the bug label Jan 19, 2018
@tomzx
Copy link
Owner

tomzx commented Jan 19, 2018

I've pushed 9ac337f which should fix this issue. Can you both give it a try and let me know if it works fine for you? I'll make a release afterward.

@vavelsky
Copy link
Author

Thank you for fixing so quickly. Actually now I got a 400 Bad Request in the same place

Searching for Project Nim

Warning: file_get_contents(https://v2.sg.media-imdb.com/suggests/P/Project+Nim.json): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
 in /.../Composer/imdb-importer/src/ImdbImporter/Importer.php on line 120

Fatal error: Uncaught Exception: Error while fetching tconst for Project Nim. in /.../Composer/imdb-importer/src/ImdbImporter/Importer.php:124
Stack trace:
#0 /.../Composer/imdb-importer/src/ImdbImporter/Importer.php(63): ImdbImporter\Importer->getIdByTitle('Project Nim')
#1 /.../Composer/imdb-importer/runme.php(11): ImdbImporter\Importer->submit(Array)
#2 {main}
  thrown in /.../Composer/imdb-importer/src/ImdbImporter/Importer.php on line 124

@tomzx
Copy link
Owner

tomzx commented Jan 19, 2018

Alright I see. I forgot to lowercase the results. Furthermore, it appears that IMDb also does convert accented characters into non-accented characters. It seems it should be formatted as a valid function name as the query will be used as part of the javascript function name. However, I didn't go as far as stripping all the invalid characters. I'll see what I can do about that another day.

@vavelsky
Copy link
Author

Fixes work fine now.

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

No branches or pull requests

3 participants