IMDB script doesn't work

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Dorohedoro
Posts: 57
Joined: 2016-12-13 00:45:45

Re: IMDB script doesn't work

Post by Dorohedoro »

MrObama2022 wrote: 2025-06-19 17:57:55
antp wrote: 2025-06-19 17:44:33
Munkey wrote: 2025-06-19 14:15:29 I think this whole script needs to be rewritten to something more modern instead of getting stuff from HTML elements.
Or were you thinking about something else than parsing public pages? IMDb does not provide free APIs to retrieve their data more efficiently, as far as I know.
We could try to use JsonUtils.pas, I don't know if it could work ...

Maybe in next months all the imdb pages we'll be converted in the new format
The new version is a huge leap forward, amazing work thanks.

For my options is almost perfect but I think there is a problem with movies like this that have more than one Director:

https://www.imdb.com/title/tt0387059/reference/

It fails to retrieve the data. The rest seems prefectly ok, even the posters.
MrObama2022
Posts: 77
Joined: 2022-02-02 00:03:55

Re: IMDB script doesn't work

Post by MrObama2022 »

New version here: 5.0 beta 5

CHANGELOG
* added Certification
* fixed ActorsLayout 4 (added attributes, if any)
* added DescriptionSelection
* fixed MediaType 3 (but still doesn't work)

Notes: for DescriptionSelection Short/Long I tried to guess how this could mean. So here (sorry for this random url) you have 2 plot, an outline plot (the one near the poster) and a summary plot (below in the page). In this random url the outline plot is smaller then the summary plot. So: if you select DescriptionSelection Short you always get the first one (near the poster), if you select Long you get the other one and, if it's missing, it select the first one. If this should work in a different way, please explain using an url and copy and paste both short and long description

To do:
* check Awards
* check CommentType
* TESTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
MrObama2022
Posts: 77
Joined: 2022-02-02 00:03:55

Re: IMDB script doesn't work

Post by MrObama2022 »

Dorohedoro wrote: 2025-06-19 18:02:10 For my options is almost perfect but I think there is a problem with movies like this that have more than one Director:

https://www.imdb.com/title/tt0387059/reference/

It fails to retrieve the data. The rest seems prefectly ok, even the posters.
Thank you for this test, I'll try asap
MrObama2022
Posts: 77
Joined: 2022-02-02 00:03:55

Re: IMDB script doesn't work

Post by MrObama2022 »

New version 5.0 beta 6

CHANGELOG
* fixed Director

Thank you all for addressing me with this issue. Now, for the first time after days, I'll do some test ...

Still have to fix imagekind 3 ...

And I'll try to update ItalianMultisite too (this is for italian people only) ...
Valmiki
Posts: 14
Joined: 2023-11-20 21:14:07

Re: IMDB script doesn't work

Post by Valmiki »

MrObama2022 wrote: 2025-06-19 21:24:03 New version 5.0 beta 6

CHANGELOG
* fixed Director

Thank you all for addressing me with this issue. Now, for the first time after days, I'll do some test ...

Still have to fix imagekind 3 ...

And I'll try to update ItalianMultisite too (this is for italian people only) ...
Sorry. I get an error:
Errore script in "IMDB": unknown identifier: GETVALUE linea 986

This is the code, line 985 and line 986:
if (GetParam('UserCountry') = 'United States') then
SetField(fieldMediaType, getValue(fieldCertification))

Hope it makes sense.
MrObama2022
Posts: 77
Joined: 2022-02-02 00:03:55

Re: IMDB script doesn't work

Post by MrObama2022 »

Thank you. Replace getValue with getField, save and retry
humungus
Posts: 28
Joined: 2010-03-23 00:29:01

Re: IMDB script doesn't work

Post by humungus »

Thanks again, MrObama2022!

I tried Beta 6 script on:

1. https://www.imdb.com/title/tt0077355/reference/
2. https://www.imdb.com/title/tt0113101/reference/
3. https://www.imdb.com/title/tt3457734/reference/

Movie 1. now returns Certification (albeit TV-PG rather than PG, but this has always been an issue with multiple ratings for United States, so you may ignore it) as well as actors' "as" and "uncredited" attributes except in this instance:

Donald Wayne (uncredited)

is retrieved as simply

Donald Wayne

Movie 2. has the same issue as Movie 1. with

Russell Vossler (uncredited)

being retrieved as simply

Russell Vossler

Additionally, the actors' "segment" attributes such as

Valeria Golino Athena (segment "The Missing Ingredient")

are retrieved as

Valeria Golino ... Athena (segment \The Missing Ingredient\)

I don't know where the \'s come from. With the old script/IMDb page, the result was

Valeria Golino ... Athena (segment "The Missing Ingredient")

More importantly, however, Movie 2. retrieves only one of five directors:

Allison Anders director (segment "The Missing Ingredient")
Alexandre Rockwell director (segment "The Wrong Man")
Robert Rodriguez director (segment "The Misbehavers")
Quentin Tarantino director (segment "The Man from Hollywood")
Chuck Jones director (animation sequences) (uncredited)

Of these only "Allison Anders" (with no attributes) is retrieved. (note: director attributes have never been retrieved, so that is not an issue)

Movie 3. retrieves both directors, but they don't have any attribute.
Dorohedoro
Posts: 57
Joined: 2016-12-13 00:45:45

Re: IMDB script doesn't work

Post by Dorohedoro »

MrObama2022 wrote: 2025-06-19 21:24:03 New version 5.0 beta 6

CHANGELOG
* fixed Director

Thank you all for addressing me with this issue. Now, for the first time after days, I'll do some test ...

Still have to fix imagekind 3 ...

And I'll try to update ItalianMultisite too (this is for italian people only) ...
Thanks to you!!!
MrObama2022
Posts: 77
Joined: 2022-02-02 00:03:55

Re: IMDB script doesn't work

Post by MrObama2022 »

I have still a lot of works to do ... on actors ... and I still have to do awards ...
Valmiki
Posts: 14
Joined: 2023-11-20 21:14:07

Re: IMDB script doesn't work

Post by Valmiki »

MrObama2022 wrote: 2025-06-19 22:00:49 Thank you. Replace getValue with getField, save and retry
Thank you so much. I it works now.

About the issue with director. I think you almost did it. On this movie https://www.imdb.com/title/tt0356150 now it retrieves 2 directors, which is better than 1. Still there are 3 directors ... :hihi: (Jeff Schaffer, Alec Berg, David Mandel)

You are almost there man. Appreciating so much your hard work. Wish I could do something more
Munkey
Posts: 4
Joined: 2025-06-19 04:55:29

Re: IMDB script doesn't work

Post by Munkey »

antp wrote: 2025-06-19 17:44:33
Munkey wrote: 2025-06-19 14:15:29 I think this whole script needs to be rewritten to something more modern instead of getting stuff from HTML elements.
Or were you thinking about something else than parsing public pages? IMDb does not provide free APIs to retrieve their data more efficiently, as far as I know.
It has free public API... TLDR: Look at this PR I made using it: https://github.com/Purfview/IMDb-Scout- ... 922f5e4e2b

I'll try to implement it in AMC script.
Don't hold your breath as I don't know Pascal, I would need to deduct how it works and looks like here is no real JSON parser...
MrObama2022
Posts: 77
Joined: 2022-02-02 00:03:55

Re: IMDB script doesn't work

Post by MrObama2022 »

Munkey wrote: 2025-06-20 14:51:03 It has free public API... TLDR: Look at this PR I made using it: https://github.com/Purfview/IMDb-Scout- ... 922f5e4e2b

I'll try to implement it in AMC script.
Don't hold your breath as I don't know Pascal, I would need to deduct how it works and looks like here is no real JSON parser...
They have a free trial and they have free access only if you have a paid AWS data exchange account

https://zuplo.com/blog/2024/10/03/best- ... db-vs-tmdb

This project looks nice but I don't know if this can remain free & legal forever and when you get info from other site you can't be 100% sure they are updated.

https://imdbapi.dev/

With the new format (I think the old one will be dismessed soon or it already is) you get a similar json from the page, so you don't get a huge boost using another json. FreePascal doesn't have a native jsondecode function, so it get some time to manually get information from the json
Munkey
Posts: 4
Joined: 2025-06-19 04:55:29

Re: IMDB script doesn't work

Post by Munkey »

MrObama2022 wrote: 2025-06-20 16:34:24 They have a free trial and they have free access only if you have a paid AWS data exchange account
I dunno about that, it just works.
Post Reply