Page 1 of 1

IMDb Translated Title Regional Title Issue

Posted: 2017-05-23 13:07:19
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.

Re: IMDb Translated Title Regional Title Issue

Posted: 2018-09-15 09:45:04
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.

Re: IMDb Translated Title Regional Title Issue

Posted: 2018-09-15 20:39:26
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

Re: IMDb Translated Title Regional Title Issue

Posted: 2018-09-16 08:31:53
by doctormaligno
Thank you for your quick answer!
I'll look into that.

Re: IMDb Translated Title Regional Title Issue

Posted: 2018-12-20 17:12:36
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 -.-

Re: IMDb Translated Title Regional Title Issue

Posted: 2018-12-20 18:24:33
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

Re: IMDb Translated Title Regional Title Issue

Posted: 2018-12-20 18:43:13
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!

Re: IMDb Translated Title Regional Title Issue

Posted: 2019-01-04 16:36:17
by cunhak9
Happy new year! :grinking:

Any news about the Title Translated fix?

Re: IMDb Translated Title Regional Title Issue

Posted: 2019-01-06 11:42:05
by antp
Happy New Year
Not checked yet, sorry

Re: IMDb Translated Title Regional Title Issue

Posted: 2019-01-27 20:25:10
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!

Re: IMDb Translated Title Regional Title Issue

Posted: 2019-01-27 21:22:16
by antp
Thanks, I updated it on the server

Re: IMDb Translated Title Regional Title Issue

Posted: 2019-01-27 21:48:23
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

Re: IMDb Translated Title Regional Title Issue

Posted: 2019-01-28 21:51:14
by antp
Thanks
(well it should work for all users, but indeed useful only for UK/US)

Re: IMDb Translated Title Regional Title Issue

Posted: 2019-01-29 09:10:57
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.