IMDb Translated Title Regional Title Issue

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.
doctormaligno
Posts: 10
Joined: 2008-02-01 02:17:43

IMDb Translated Title Regional Title Issue

Post by doctormaligno »

Hello,

I edited IMDb script so it'll use Spanish title for translated title instead of English alternative title.
It works fine except when there's also a title in Catalan (that's a regional language in northeastern Spain).
Since it appears first in IMDb alternative page, that's the one the script uses.

Is there a workaround for this?
I can't find a way.

Thanks a lot for this amazing software and for your time.
doctormaligno
Posts: 10
Joined: 2008-02-01 02:17:43

Re: IMDb Translated Title Regional Title Issue

Post by doctormaligno »

Unfortunately, on the latest 4.2.2-beta this is still happening.

EDIT:
This is an example of how it shows on IMDb:
Spain Ciudadano Kane
Spain (Catalan title) Ciutadà Kane

If I set the UserCountry in script parameters as Spain, whenever there's a Catalan title, that's the one AMC gets from the IMDb script.
antp
Site Admin
Posts: 9904
Joined: 2002-05-30 10:13:07
Location: Brussels

Re: IMDb Translated Title Regional Title Issue

Post by antp »

It is strange because how the script is made it should stop at the first result found :??: And I get the Spanish title first.
Maybe in your case IMDb sends the Catalan title first?
If so, a workaround could be to take in account the titles that match exactly the country (so no match if there is an extra detail between parenthesis):
replace

Code: Select all

if pos(AKACountry(), value) > 0 then
by

Code: Select all

if AKACountry() = value then
doctormaligno
Posts: 10
Joined: 2008-02-01 02:17:43

Re: IMDb Translated Title Regional Title Issue

Post by doctormaligno »

Thank you for your quick answer!
I'll look into that.
cunhak9
Posts: 6
Joined: 2018-03-15 17:46:10
Location: Portugal

Re: IMDb Translated Title Regional Title Issue

Post by cunhak9 »

Hi, im not creating a new topic because its a similar problem so;

Im using amc 4.2.2.1 and the last imdb script 4.013 and i cant get the Title Translated with the script, it gets all the rest fine, the UserCountry is config to my language(portugal) but even if i change to other language, it still dont get any title translated -.-
antp
Site Admin
Posts: 9904
Joined: 2002-05-30 10:13:07
Location: Brussels

Re: IMDb Translated Title Regional Title Issue

Post by antp »

There is indeed something about titles on my to-do list since more than a month, I assume it is the same problem.
I should take some time for it ... some day
cunhak9
Posts: 6
Joined: 2018-03-15 17:46:10
Location: Portugal

Re: IMDb Translated Title Regional Title Issue

Post by cunhak9 »

antp wrote: 2018-12-20 18:24:33 There is indeed something about titles on my to-do list since more than a month, I assume it is the same problem.
I should take some time for it ... some day
Thanks you, i appreciate that, looking for future updates!
cunhak9
Posts: 6
Joined: 2018-03-15 17:46:10
Location: Portugal

Re: IMDb Translated Title Regional Title Issue

Post by cunhak9 »

Happy new year! :grinking:

Any news about the Title Translated fix?
antp
Site Admin
Posts: 9904
Joined: 2002-05-30 10:13:07
Location: Brussels

Re: IMDb Translated Title Regional Title Issue

Post by antp »

Happy New Year
Not checked yet, sorry
cunhak9
Posts: 6
Joined: 2018-03-15 17:46:10
Location: Portugal

Re: IMDb Translated Title Regional Title Issue

Post by cunhak9 »

Thanks to user athe , the fix is:

edit the script in atm program, replace the lines 478 to 512 with;

Code: Select all

  // AKA Name
  if CanSetField(fieldTranslatedTitle) then
  begin
    FullValue := ConvertToASCII(GetPage(MovieURL+'/releaseinfo#akas'));
    FullValue := TextBetween(FullValue, 'id="akas"', '</table>');
     while Fullvalue <> '' do
     begin
      Value2 := TextBetween(FullValue, ' <td class="aka-item__name">', '</td>');  //country
      Value := TextBetween(FullValue, '<td class="aka-item__title">', '</td>');   //title
      HTMLDecode(Value2);
      if (GetParam('UserCountry') = Value2) then
      begin
        HTMLDecode(Value);
        SetField(fieldTranslatedTitle, FullTrim(Value));
        FullValue := '';
      end
      else  FullValue := TextAfter(FullValue, '</tr>');
     end;

Tested and working!
antp
Site Admin
Posts: 9904
Joined: 2002-05-30 10:13:07
Location: Brussels

Re: IMDb Translated Title Regional Title Issue

Post by antp »

Thanks, I updated it on the server
athe
Posts: 170
Joined: 2013-06-01 20:26:24
Location: Poland

Re: IMDb Translated Title Regional Title Issue

Post by athe »

this line has to be changed

Code: Select all

if (GetParam('UserCountry') = Value2) then
to

Code: Select all

 if AKACountry() = Value2 then

Code: Select all

// AKA Name
  if CanSetField(fieldTranslatedTitle) then
  begin
    FullValue := ConvertToASCII(GetPage(MovieURL+'/releaseinfo#akas'));
    FullValue := TextBetween(FullValue, 'id="akas"', '</table>');
     while Fullvalue <> '' do
     begin
      Value2 := TextBetween(FullValue, ' <td class="aka-item__name">', '</td>');  //country
      Value := TextBetween(FullValue, '<td class="aka-item__title">', '</td>');   //title
      HTMLDecode(Value2);
     if AKACountry() = Value2 then   //this line must be for users from the USA and UK
      begin
        HTMLDecode(Value);
        SetField(fieldTranslatedTitle, FullTrim(Value));
        FullValue := '';
      end
      else  FullValue := TextAfter(FullValue, '</tr>');
     end;
  end;

  // Comments
only for users from the USA and UK
antp
Site Admin
Posts: 9904
Joined: 2002-05-30 10:13:07
Location: Brussels

Re: IMDb Translated Title Regional Title Issue

Post by antp »

Thanks
(well it should work for all users, but indeed useful only for UK/US)
antp
Site Admin
Posts: 9904
Joined: 2002-05-30 10:13:07
Location: Brussels

Re: IMDb Translated Title Regional Title Issue

Post by antp »

New version 4.016, asking to select the translated title if multiple are found.
Titles identical to original one are ignored.
First one is taken by default is BatchMode is enabled.