English > Support

IMDb [EN][HTTPS](series) issues and support

(1/6) > >>

afrocuban:

--- Quote from: Ivek23 on December 06, 2021, 06:23:57 pm ---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.
--- End quote ---

I have a custom field Run time for runtime. In IMDB_ [EN] [HTTPS] I added

--- Quote ---AddCustomFieldValueByName('Run time',ItemValue);
--- End quote ---

I did analog in IMDB_ [EN] (HTTPS] (series) by adding


--- Quote ---1104      AddCustomFieldValueByName('Run time',ItemValue1);

--- End quote ---

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

--- Quote ---1111     AddCustomFieldValueByName('Run time',ItemValue00);
--- End quote ---

I get length 1 hour for https://www.imdb.com/title/tt8694364/, but not 60 minutes???

afrocuban:
Also, IMDB_Series-year custom field doesn't import category and year as it did until recent layout changes.

Ivek23:
I will edit AllMovie scripts first, then I will edit your requests and problems with Imdb scripts.

Ivek23:

--- Quote from: afrocuban on December 08, 2021, 09:16:11 pm ---
--- Quote from: Ivek23 on December 06, 2021, 06:23:57 pm ---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.
--- End quote ---

I have a custom field Run time for runtime. In IMDB_ [EN] [HTTPS] I added

--- Quote ---AddCustomFieldValueByName('Run time',ItemValue);
--- End quote ---

I did analog in IMDB_ [EN] (HTTPS] (series) by adding


--- Quote ---1104      AddCustomFieldValueByName('Run time',ItemValue1);

--- End quote ---

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

--- Quote ---1111     AddCustomFieldValueByName('Run time',ItemValue00);
--- End quote ---

I get length 1 hour for https://www.imdb.com/title/tt8694364/, but not 60 minutes???
--- End quote ---

For afrocuban

In IMDB_ [EN] [HTTPS] script it is necessary to change the Runtime code in Function ParsePage_IMDBMovieBASE.

--- Quote ---    //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');
--- End quote ---

Function ParsePage_IMDBMovieTECHNICAL
is such a code for the "Run time" custom field.

--- Quote ---    //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=====================||');
--- End quote ---

For IMDB_ [EN] [HTTPS] (episodes) script

V Function ParsePage_IMDBMovieTECHNICAL is such a code for the "Run time" custom field.
--- Quote ---    //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=====================||');
--- End quote ---

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.

Ivek23:
For afrocuban

However, in the IMDB_ [EN] (HTTPS) (series) script, several pieces of code need to be changed.

In Function ParsePage_IMDBMovieBASE, the following pieces of code change.
--- Quote ---



Function ParsePage_IMDBMovieBASE(HTML:String):Cardinal; //BlockOpen
    //Returns:
    //     Result:=prFinished; Script has finished gathering data
    //     Result:=prError; If żany big problem? with exit;
    //Retrieve: ~title~, ~year~, ~origtitle~, ~poster~ / ~imdbrating~, ~IMDB_Votes~ (Custom Field) / ~TOP_250~(Custom Field) /
    //          If Not(GET_FULL_CREDIT): ~crew~ctDirectors,ctWriters,ctComposers,ctProducers(Not in base page), ctActors
    //         ~description~ / ~category~ "keywords" / ~tagline~ / ~genre~
    //         If Not(GET_FULL_MPAA) ~mpaa~
    //         ~country~ / ~rdate~ in contry provider local IP geolocation
    //         If Not(GET_FULL_AKA) ~aka~.
    //         ~budget~ / ~money~ / ~studio~ "Production Co"
    //         If Not(GET_FULL_FEATURES) ~features~
  Var
      curPos,endPos,index:Integer;
     debug_pos1:Integer;
     StartPos:Integer;
     //Hours,Minutes:Integer;
      ItemValue,ItemValue0,ItemValue1,ItemValue2,ItemList,ImageFile:String;
     ItemValue00:String;
      titleValue:String;
     yearValue:String;
     seriesValue,yearsValue:String;
      Name,Role,PersonURL:String;
     ItemList2,ItemList12,day_s,month_s,year_s:String;
     //ItemList1,ItemList11:String;
      ItemArray:TWideArray;
  Begin
.
.
.
   //Go to "Tv Mode"    
   StartPos:=Pos('<h1 textlength="',HTML);
   if StartPos>0 then begin   
      ItemValue:=HTMLValue(HTML,StartPos,0,'<li role="presentation" class="ipc-inline-list__item">','releaseinfo?ref_=tt_ov_rdat');
      if ItemValue <> '' then LogMessage('      Get result Tv Mode1:'+ItemValue+'||');
      debug_pos1:=Pos('<a href="',ItemValue);
      if debug_pos1 >0 then ItemValue:=Copy(ItemValue,0,debug_pos1-1);
      //ItemValue:=StringReplace(ItemValue,'','',True,False,True);
      //ItemValue:=StringReplace(ItemValue,'</a>','',True,False,True);      
      AddCustomFieldValueByName('Tv',ItemValue);   
      if ItemValue <> '' then LogMessage('      Get result Tv Mode (CF~Tv~):'+ItemValue);
      if Pos('TV Mini Series',ItemValue)>0 then yearsValue:=yearsValue+'TV Mini Series ';
      if Pos('TV Series',ItemValue)>0 then yearsValue:=yearsValue+'TV Series ';
      if yearsValue <> '' then LogMessage('      Get result yearsValue:'+yearsValue);      
      //ItemValue1:=HTMLValue(HTML,StartPos,0,'<li role="presentation" class="ipc-inline-list__item','</ul>');
      ItemValue1:=HTMLValues(HTML,'<h1 textlength="','</ul>','"ipc-inline-list__item">','</',', ',StartPos);
      //ItemValue1:=HTMLValues2(HTML,'<h1 textlength="','</ul>','<li role="presentation" class="ipc-inline-list__item">','</li>',', ',StartPos);      
      AddCustomFieldValueByName('Tv2',ItemValue1);   
      if ItemValue1 <> '' then LogMessage('      Get result Tv Mode01:'+#13+ItemValue1+'||'+#13);      
   end else
      LogMessage('tv-metadata not found');         
   //Go to "Tv Mode" Series-year
   StartPos:=Pos('releaseinfo?ref_=tt_ov_rdat',HTML);
   if StartPos>0 then begin
      yearValue:=HTMLValue(HTML,StartPos,0,'</a>','</span></li><li role="presentation" class="ipc-inline-list__item"><a href="/title/');
      //AddCustomFieldValueByName('IMDB_year',yearValue);
      //AddCustomFieldValueByName('IMDB Year',yearValue);
      AddCustomFieldValueByName('IMDB_Series-year',yearValue);
      if yearsValue <> '' then seriesValue:=yearsValue+'('+yearValue+')' else seriesValue:='';
      AddCustomFieldValueByName('IMDB_Series-year1',seriesValue);
      if seriesValue <> '' then LogMessage('      Get result seriesValue:'+#13+seriesValue+'||'+#13);   
      if yearValue <> '' then LogMessage('      Get result Tv Mode (CF~IMDB_year~)+:'+yearValue);   
   end else
      LogMessage('tv-metadata-a not found');   
.
.
.
    //Get the original "Runtime" (in minutes) as ~length~ (in seconds) instead of the duration of the user movie copy                                        //WEB_SPECIFIC.   
    curPos:=Pos('<span class="ipc-metadata-list-item__label">Runtime</span>',HTML);                                        //WEB_SPECIFIC.
    If 0<curPos Then Begin 
        ItemValue1:=TextBetWeen(HTML,'<div class="ipc-metadata-list-item__content-container">','minutes</div></li>',false,curPos);  //Strings which opens/closes the data. WEB_SPECIFIC
        //ItemList:=ItemList+'Original Runtime: '+ItemValue1+' min.<br>';
        LogMessage('      Get result Original Runtime11:'+ItemValue1+'||');
      //If GET_FULL_FEATURES Then
      if ItemValue1 <> '' then
        AddFieldValueXML('length',IntToStr(60*StrToInt(ItemValue1))); //~length~ Value in seconds.
      if ItemValue1 <> '' then AddCustomFieldValueByName('Run time1',ItemValue1);
        //AddFieldValue(14,ItemValue1);  //Field number 14 = Duration, value in minutes
        if ItemValue1 <> '' then LogMessage('      Get result lenght011:'+ItemValue1+'||');
      //LogMessage('      Get result lenght012:'+HTMLValues(HTML,'<span class="ipc-metadata-list-item__label">Runtime</span>','</ul>','<li role="presentation" class="ipc-inline-list__item">','</li>',', ',endPos)+'||');      
        ItemValue00:=TextBetWeen(HTML,'<div class="ipc-metadata-list-item__content-container">','hour</div></li>',false,curPos);  //Strings which opens/closes the data. WEB_SPECIFIC   
      LogMessage('      Get result Original Runtime111:'+ItemValue00+'||');      
      if ItemValue00 <> '' then
      AddFieldValueXML('length',IntToStr(3600*StrToInt(ItemValue00))); //~length~ Value in seconds.
      if ItemValue00 <> '' then AddCustomFieldValueByName('Run time1',IntToStr(60*StrToInt(ItemValue00)));
      if ItemValue00 <> '' then LogMessage('      Get result Original Runtime111:'+ItemValue00+'||');
        if ItemValue00 <> '' then LogMessage('      Get result lenght0111:'+ItemValue00+'||');      
    End;
--- End quote ---

For a possible error in the code part for the series, you can also add it yourself or report the problem and I added it.

And this one.

The "runtime" and "IMDB_Series-year" 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.

Navigation

[0] Message Index

[#] Next page

Go to full version