In all IMDB_ [EN] [HTTPS], IMDB_ [EN] (HTTPS] (series) and IMDB_ [EN] [HTTPS] (episodes) scripts, Runtime information is now incorrectly downloaded. The reason is a change in the source code of the primary Imdb web pages. I have fixed this bug and all Imdb scripts may be added to the forum tonight or tomorrow.
I have a custom field Run time for runtime. In IMDB_ [EN] [HTTPS] I added
AddCustomFieldValueByName('Run time',ItemValue);
I did analog in IMDB_ [EN] (HTTPS] (series) by adding
1104 AddCustomFieldValueByName('Run time',ItemValue1);
but for some reason it doesn't work.
Since the only way to record actual media length in PVD is to record it to Duration field, I'd prefer IMDb length to be recorded to a custom field Run time
Any help on this, please?
EDIT:
If I put
1111 AddCustomFieldValueByName('Run time',ItemValue00);
I get length 1 hour for https://www.imdb.com/title/tt8694364/, but not 60 minutes???
For afrocubanIn IMDB_ [EN] [HTTPS] script it is necessary to change the Runtime code in Function ParsePage_IMDBMovieBASE.
//Get the original "Runtime" (in minutes) as ~length~ (in seconds) instead of the duration of the user movie copy
StartPos:=Pos('<span class="ipc-metadata-list-item__label">Runtime</span>',HTML);
if StartPos>0 then begin
Hours:=StrToInt(HTMLValue(HTML,StartPos,0,'<div class="ipc-metadata-list-item__content-container">','<!-- --> <!-- -->hour'));
Minutes:=StrToInt(HTMLValue(HTML,StartPos,0,'hour<!-- --> <!-- -->','<!-- --> <!-- -->minutes'));
ItemValue:=IntToStr(Hours*60 + Minutes);
If ItemValue = '0' then ItemValue:='';
If ItemValue = '' then Minutes:=StrToInt(HTMLValue(HTML,StartPos,0,'<div class="ipc-metadata-list-item__content-container">','<!-- --> <!-- -->minutes'));
ItemValue:=IntToStr(Hours*60 + Minutes);
//LogMessage('duration: '+ItemValue);
if ItemValue <> '' then LogMessage(' Get result Original Runtime:'+ItemValue+'||');
//AddFieldValueXML('duration', ItemValue);
AddFieldValueXML('length',IntToStr(60*StrToInt(ItemValue))); //~length~ Value in seconds.
if ItemValue <> '' then AddCustomFieldValueByName('Run time1',ItemValue);
if ItemValue <> '' then LogMessage(' Get result lenght:'+ItemValue+'||');
end else
LogMessage('duration not found');
Function ParsePage_IMDBMovieTECHNICAL
is such a code for the "Run time" custom field.
//Get "Runtime" info
curPos:=Pos('<td class="label"> Runtime </td>',HTML); //WEB_SPECIFIC.
If 0<curPos Then Begin
ItemValue:=TextBetWeen(HTML,' (',' min)',false,curPos); //Strings which opens/closes the data. WEB_SPECIFIC
//Get the original "Runtime" (in minutes) as ~length~ instead of the duration of the user movie copy
AddFieldValueXML('length',IntToStr(60*StrToInt(ItemValue))); //~length~ Value in seconds.
//AddFieldValue(14,ItemValue); //Field number 14 = Duration, value in minutes
if ItemValue <> '' then AddCustomFieldValueByName('Run time',ItemValue);
if ItemValue <> '' then LogMessage(' Get result lenght from Original Runtime:'+ItemValue+'||');
End;
LogMessage('Function ParsePage_IMDBMovieTECHNICAL END=====================||');
For IMDB_ [EN] [HTTPS] (episodes) script
V Function ParsePage_IMDBMovieTECHNICAL is such a code for the "Run time" custom field.
//Get "Runtime" info
curPos:=Pos('<td class="label"> Runtime </td>',HTML); //WEB_SPECIFIC.
If 0<curPos Then Begin
ItemValue0:=TextBetWeen(HTML,' (',' min)',false,curPos); //Strings which opens/closes the data. WEB_SPECIFIC
//Get the original "Runtime" (in minutes) as ~length~ instead of the duration of the user movie copy
AddFieldValueXML('length',IntToStr(60*StrToInt(ItemValue0))); //~length~ Value in seconds.
//AddFieldValue(14,ItemValue); //Field number 14 = Duration, value in minutes
if ItemValue0 <> '' then AddCustomFieldValueByName('Run time',ItemValue0);
if ItemValue0 <> '' then LogMessage(' Get result lenght from Original Runtime:'+ItemValue0+'||');
End;
//Get "Runtime" info
curPos:=Pos('<td class="label"> Runtime </td>',HTML); //WEB_SPECIFIC.
If 0<curPos Then Begin
ItemValue1:=TextBetWeen(HTML,'<td>',' min',false,curPos); //Strings which opens/closes the data. WEB_SPECIFIC
//Get the original "Runtime" (in minutes) as ~length~ instead of the duration of the user movie copy
AddFieldValueXML('length',IntToStr(60*StrToInt(ItemValue1))); //~length~ Value in seconds.
//AddFieldValue(14,ItemValue); //Field number 14 = Duration, value in minutes
if ItemValue1 <> '' then AddCustomFieldValueByName('Run time1',ItemValue1);
if ItemValue1 <> '' then LogMessage(' Get result lenght from Original Runtime0:'+ItemValue1+'||');
End;
LogMessage('Function ParsePage_IMDBMovieTECHNICAL END=====================||');
Here are two pieces of code for "RUNTIME" information transfer. Both are needed. that there will always be information transfer. if the Runtime record is present in the Technical Specifications web pages.
And this one.The "runtime" custom fields here may be named differently because I wrote them them that way because of the tests, if the information is transmitted correctly.
Therefore, each user should change the names of the custom fields that they already use now.