Author Topic: Personal Video Database 1.0.2.7 MOD  (Read 284163 times)

0 Members and 10 Guests are viewing this topic.

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2736
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #160 on: January 21, 2019, 03:19:51 pm »
Notes for Ivek23:
  • Not included the parameter GET_PLOTKEYWORDS_LIMIT=False because is redundant with PLOTKEYWORDS_LIMIT set in a big number
  • Not included the script part "Connections" as suggested (but we can include it with parameter GET_CONNECTIONS=False)
That's OK.

Notes for Ivek23:
  • Corrected: "curPos:=curPos+43;" by "curPos:=curPos+45;" in order to get the good year (at least in Amadeus movie)
  • Not included the code part of Post:
I will explain this below.

Notes for Ivek23:
  • Not included the code part of Post:

       ImageFile:=TextBetWeenFirst(ItemList,'"image": "','._V1_.jpg",')+'._V1_UY'+IntToStr(MAX_IMAGE_HEIGTH)+'_.jpg';
       AddImageURL(itPoster,ImageFile);
       LogMessage('      Get result poster:' + ImageFile +'||');
       ItemValue1:=TextBetWeenFirst(ItemList,'"datePublished": "','-');
       //AddFieldValueXML('year',ItemValue1);
        LogMessage('      Get result year01:'+ItemValue1+'||');


    because is not needed for download the poster and the AddFieldValueXML is after // (commentary) and ItemValue1 is not more used
It can be added there, it works. I added it for updating another IMDb script, where I used it and works the same way as here. But it does not need to be updated every time, when the next time they will encounter new changes to the source code for the IMDb website.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2736
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #161 on: January 21, 2019, 03:30:30 pm »
IMDB_ [EN] [HTTPS]

New added:

Quote
  5. Cast & Crew field info names:   
   •   Directed by
   •   Writing Credits  // NO (WGA)
   •   Cast (in credits order)  // Only data info in normal Actors field
   •   Produced by
   •   Music by
   •   Cinematography by  // NO
   •   Film Editing by  // NO
   •   Casting By  // NO
   •   Production Design by  // NO
   •   Art Direction by  // NO
   •   Set Decoration by  // NO
   •   Costume Design by  // NO
   •   Production Management  // NO
   •   Second Unit Director or Assistant Director  // NO 
   •   Special Effects by  // NO
   •   Visual Effects by  // NO
   •   Casting Department  // NO
   •   Location Management  // NO
   •   Music Department  // NO
   •   Thanks
Quote
  GET_CREW_CREDIT  = False ;  //Download Cast and Credit provider page for retreive the some credits (crew) info. Otherwise set to False to only the Directors, Writers, Composers, Producers, Cinematography and Thanks info of the Cast and Credit provider page. 
  //GET_CREW_CREDIT  = True ;  //Download Cast and Credit provider page for retreive the some credits (crew) info. Otherwise set to False to only the Directors, Writers, Composers, Producers, Cinematography and Thanks info of the Cast and Credit provider page.
Works in IMDB_ [EN] [HTTPS] _ (Cast & Crew) script.
Quote
  GET_FULL_PLOTSUMMARY  = True ;  //Download Plot provider page for retreive the Summaries info. Otherwise only the info of the principal movie page

Modified:

Function ParsePage_IMDBMovieBASE
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;
      ItemValue1,ItemValue0,ItemValue,ItemList,ImageFile:String;
      titleValue:String;
      Name,Role,PersonURL:String;
      ItemArray:TWideArray;
  Begin
    LogMessage('Function ParsePage_IMDBMovieBASE BEGIN======================|');
    Result:=prFinished;  //It will change to prError if any big problem with exit;  //**// (* *)
    //Because the script don't retreives the data in the page order a token search for the first curPos position or block select is mandatory
    //Get ~title~, ~year~, ~origtitle~, ~poster~
    //Get all "raw" title summary (in raw because we need the hidden links, we avoid "complete" token in strings which opens/closes)
    ItemList:=TextBetWeenFirst(HTML,'<div class="title_block"','div class="plot_summary_wrapper">'); //WEB_SPECIFIC.
   //LogMessage('      Get result ItemList:'+#13+ItemList+'||');   
    If (Length(ItemList)>0) Then Begin
        //Get ~title~
        titleValue:=TextBetWeenFirst(ItemList,'<h1 class="">','<');       //Strings which opens/closes the data. WEB_SPECIFIC
        If titleValue = '0' then titleValue:='';
        If titleValue = '' then titleValue:=TextBetWeenFirst(ItemList,'<h1 class="long">','<');       //Strings which opens/closes the data. WEB_SPECIFIC
        AddFieldValueXML('title',titleValue);
        LogMessage('      Get result title:'+titleValue+'||');   
        //First normal kind get of ~year~
        ItemValue:=TextBetWeenFirst(ItemList,'<span id="titleYear">(',')</span>            </h1>');                                 //Strings which opens/closes the data. WEB_SPECIFIC      
        AddFieldValueXML('year',ItemValue);
        LogMessage('      Get result normal year:'+ItemValue+'||');
      //Second kind of get of ~year~
      endPos:=PosFrom('title="See more release dates" >',ItemList,curPos);
        curPos:=PosFrom('title="See more release dates" >',ItemList,endPos);
      endPos:=PosFrom(' (',ItemList,curPos);
      if (EndPos < 1) OR (EndPos > PosFrom('</a>            </div>',ItemList,curPos)) then
      EndPos := PosFrom('</a>            </div>',ItemList,curPos);
      curPos:=endPos-4;
      ItemValue0:=Copy(ItemList,curPos,4);
      LogMessage('      Get result second kind of year 0:'+ItemValue0+'||');
        if ItemValue0 <> '' then AddFieldValueXML('year',ItemValue0);
        if ItemValue0 <> '' then LogMessage('      Get result second kind of year:'+ItemValue0+'||');      
        //Second kind of get of ~year~ or for series
        endPos:=PosFrom('title="See more release dates" >',ItemList,curPos);
        curPos:=PosFrom('title="See more release dates" >',ItemList,endPos);   
        endPos:=PosFrom('</a>            </div>',ItemList,curPos);
      curPos:=curPos+43;
        ItemValue1:=Copy(ItemList,curPos,4);
        LogMessage('      Get series result for series year:'+ItemValue1+'||');
        //ItemValue1:=StringReplace(ItemValue1,'/a> ','',True,False,True);
        if ItemValue1 <> '' then AddFieldValueXML('year',ItemValue1);
        if ItemValue1 <> '' then LogMessage('      Get series result for series year2:'+ItemValue1+'||');

        //Get ~origtitle~
        ItemValue:=TextBetWeenFirst(ItemList,'<div class="originalTitle">','<');          //Strings which opens/closes the data. WEB_SPECIFIC
        If (Length(ItemValue)=0) Then ItemValue:=titleValue;                           //Provider hides the original title if same that title. WEB_SPECIFIC
        AddFieldValueXML('origtitle',ItemValue);
        LogMessage('      Get result origtitle:'+ItemValue+'||');
        ItemValue:=TextBetWeenFirst(ItemList,BASE_URL_IMAGE_PRE_TRUE,'.');                 //Get poster code. Strings which opens/closes the data. WEB_SPECIFIC
        If ((Length(ItemValue)>0) and Not(USE_SAVED_PVDCONFIG and (Copy(PVDConfigOptions,opPoster,1)='0'))) then begin  //The Poster will be saved in PVDthen begin
            ItemValue:=BASE_URL_IMAGE_PRE_TRUE + ItemValue;                             //Base poster URL without '.jpg'. WEB_SPECIFIC
            ImageFile:=GetAppPath+'Scripts\'+BASE_DOWNLOAD_FILE_IMAGE_NAME+'-Poster.jpg'
            // Avoid HTTPS redirection: Download https image to file  OutPutFile=
            If (1=DownloadImage(ItemValue + '._V1_UY' + IntToStr(MAX_IMAGE_HEIGTH) + '_.jpg',ImageFile)) then begin  //Dowload in the selected user max size. WEB_SPECIFIC
                AddImageURL(itPoster,ImageFile);    //Get the photo from a file even if the next line we log the true URL.
                LogMessage('      Get result poster:'+ItemValue + '._V1_UY' + IntToStr(MAX_IMAGE_HEIGTH) + '_.jpg'+'||');
            end else if (1=DownloadImage(ItemValue +'.jpg',ImageFile)) then begin  //Dowload in the web base size. WEB_SPECIFIC
                AddImageURL(itPoster,ImageFile);    //Get the photo from a file even if the next line we log the true URL.
                LogMessage('      Get result poster:' + ItemValue + '.jpg'+'||');
            end;
        End;
    End;

Now I've updated the year code. For users who want to update information for series, adds the year correctly to the database.

Quote
    //Get ~script info~
    //Get ~rdate~ in contry provider local IP geolocation. See: http://sobizarre-en.blogspot.fr/2014/12/how-to-easily-defeat-imdb-geolocation.html
    //Get ~imdbrating~, ~IMDB_Votes~ (Two tries)
    ItemList:=TextBetWeenFirst(HTML,'<script type="application/ld+json"','}</script>'); //WEB_SPECIFIC.
    If (Length(ItemList)>0) Then Begin
      ItemValue:=TextBetWeenFirst(ItemList,'"@type": "','",');   //Strings which opens/closes the data. WEB_SPECIFIC      
      ItemValue:=StringReplace(ItemValue,'TVSeries','TV Series',True,False,True);
      ItemValue:=StringReplace(ItemValue,'TVEpisode','TV Episode',True,False,True);      
      //AddCustomFieldValueByName('IMDBMovietype',ItemValue);
      //LogMessage('      Get result MediaType (CF~IMDBMovietype~):'+ItemValue+'||');
      MediaType:=StringReplace(ItemValue,'TVSeries','TV Series',True,False,True);
      MediaType:=StringReplace(ItemValue,'TVEpisode','TV Episode',True,False,True);               
      AddCustomFieldValueByName('IMDB_Movietype',MediaType);
      LogMessage('      Get result MediaType (CF~IMDB_Movietype~):'+MediaType+'||');
      ItemValue:=TextBetWeenFirst(ItemList,'"contentRating": "','",');   //Strings which opens/closes the data. WEB_SPECIFIC
      AddCustomFieldValueByName('IMDB_MPAA',ItemValue);                                 
      if ItemValue <> '' then LogMessage('      Get result ContentRating (CF~IMDB_MPAA~):'+ItemValue+'||');
   ImageFile:=TextBetWeenFirst(ItemList,'"image": "','._V1_.jpg",')+'._V1_UY'+IntToStr(MAX_IMAGE_HEIGTH)+'_.jpg';
   AddImageURL(itPoster,ImageFile);
   LogMessage('      Get result poster:' + ImageFile +'||');
   ItemValue1:=TextBetWeenFirst(ItemList,'"datePublished": "','-');
   //AddFieldValueXML('year',ItemValue1);
    LogMessage('      Get result year01:'+ItemValue1+'||');

      ItemValue:=TextBetWeenFirst(ItemList,'"datePublished": "','",');   //Strings which opens/closes the data. WEB_SPECIFIC
        ItemValue:=StringReplace(ItemValue,'-01','-1',True,False,True);
        ItemValue:=StringReplace(ItemValue,'-02','-2',True,False,True);
        ItemValue:=StringReplace(ItemValue,'-03','-3',True,False,True);
        ItemValue:=StringReplace(ItemValue,'-04','-4',True,False,True);
        ItemValue:=StringReplace(ItemValue,'-05','-5',True,False,True);
        ItemValue:=StringReplace(ItemValue,'-06','-6',True,False,True);
        ItemValue:=StringReplace(ItemValue,'-07','-7',True,False,True);
        ItemValue:=StringReplace(ItemValue,'-08','-8',True,False,True);
        ItemValue:=StringReplace(ItemValue,'-09','-9',True,False,True);
      if ItemValue <> '' then LogMessage('      Get result ReleaseDatePublished: '+ItemValue+' ||');      
      if ItemValue <> '' then begin
            ExplodeString(ItemValue,ItemArray,'-');
            ItemValue:=ItemArray[2]+'.'+ ItemArray[1]+'.'+ItemArray[0];
         AddFieldValueXML('rdate',ItemValue);   
         AddCustomFieldValueByName('IMDB Release Date',ItemValue);   
            if ItemValue <> '' then LogMessage('      Get result DatePublished ~rdate~ (CF~IMDB Release Date~):'+ItemValue+'||');      
      End;
      ItemValue:=TextBetWeenFirst(ItemList,'"ratingCount": ',',');   //Strings which opens/closes the data. WEB_SPECIFIC
      AddCustomFieldValueByName('IMDB_Votes',ItemValue);      
      if ItemValue <> '' then LogMessage('      Get result ratingCount (~IMDB_Votes~): '+ItemValue+' ||');   
      ItemValue:=TextBetWeenFirst(ItemList,'"ratingValue": "','"');   //Strings which opens/closes the data. WEB_SPECIFIC
      AddFieldValueXML('imdbrating',ItemValue);
      AddCustomFieldValueByName('IMDB Rating',ItemValue);
      AddCustomFieldValueByName('IMDBRating',ItemValue);
      if ItemValue <> '' then LogMessage('      Get result ratingValue ~imdbrating~ (CF~IMDB Rating~~IMDBRating~): '+ItemValue+' ||');         
    End;

Notes for Ivek23:
  • Not included the code part of Post:

       ImageFile:=TextBetWeenFirst(ItemList,'"image": "','._V1_.jpg",')+'._V1_UY'+IntToStr(MAX_IMAGE_HEIGTH)+'_.jpg';
       AddImageURL(itPoster,ImageFile);
       LogMessage('      Get result poster:' + ImageFile +'||');
       ItemValue1:=TextBetWeenFirst(ItemList,'"datePublished": "','-');
       //AddFieldValueXML('year',ItemValue1);
        LogMessage('      Get result year01:'+ItemValue1+'||');


    because is not needed for download the poster and the AddFieldValueXML is after // (commentary) and ItemValue1 is not more used
It can be added there, it works. I added it for updating another IMDb script, where I used it and works the same way as here. But it does not need to be updated every time, when the next time they will encounter new changes to the source code for the IMDb website.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2736
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #162 on: January 21, 2019, 04:12:37 pm »
IMDB_ [EN] [HTTPS] script

Modified:


Quote
    //Get "plot_summary" as ~comment~ (In the PVD check fields table selection only ~description~ can be checked for overwrite but the user can change the config and
    // write ~description~ in ~comment~ so with the script parameter we Avoid double use of ~description~ and ~comment~.
    If Not(PRESERVE_PVD_DESCRIPTION_SETTING) Then Begin
        curPos:=Pos('<div class="plot_summary',HTML);                                 //WEB_SPECIFIC.   
        If 0<curPos then begin
            curPos:=Pos('<div class="summary_text">',HTML);                                 //WEB_SPECIFIC.
            If 0<curPos Then Begin
                ItemValue:=TextBetWeen(HTML,'<div class="summary_text','</div>',false,curPos);   //Strings which opens/closes the data. WEB_SPECIFIC
                curPos:=Pos('  <a href="',ItemValue);
                If 0<curPos then ItemValue:=Copy(ItemValue,0,curPos-1);
                ItemValue:=StringReplace(ItemValue,',            ',', ',True,False,True);
                ItemValue:=StringReplace(ItemValue,'            ',' ',True,False,True);
                ItemValue:=StringReplace(ItemValue,'        ',' ',True,False,True);
                ItemValue:=StringReplace(ItemValue,'Add a Plot »','',True,False,True);
                ItemValue:=StringReplace(ItemValue,'See full summary »','',True,False,True);
                ItemValue:=StringReplace(ItemValue,'">','',True,False,True);
                curPos:=Pos('var ue_t0=ue_t0||+new Date();var ',ItemValue);
                If 0<curPos then ItemValue:=Copy(ItemValue,0,curPos-1);
                //AddFieldValueXML('comment',ItemValue);
                LogMessage('      Get result "Plot_summary" as ~comment~:'+ItemValue+'||');
            End;
        End;   
    End;
Now the plot_summary info on the primary IMDb page will no longer be written to the comment field, although you will make changes to the PVD settings.

Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2736
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #163 on: January 21, 2019, 04:13:59 pm »
IMDB_ [EN] [HTTPS] script

ParsePage_IMDBMovieCREDIT

New added and modified:


Quote
Function ParsePage_IMDBMovieCREDIT(HTML:String):Cardinal; //BlockOpen
    //Returns:
    //     Result:=prFinished; Script has finished gathering data
    //     Result:=prError; If żany big problem? with exit;
    //Retrieve: ~crew~ctDirectors,ctWriters,ctComposers,ctProducers
    //          ~actors~ ctActors
  Var
    curPos,endPos,index:Integer;
   debug_pos1:Integer;
    ItemValue,ItemList:String;
    Name,Role,PersonURL:String;
   ItemValue14:String;
   Fullinfo,Directors,Writers,Composers,Producers:String;   

  Begin
    LogMessage('Function ParsePage_IMDBMovieCREDIT BEGIN=====================||');
    Result:=prFinished;  //It will change to prError if any big problem with exit;
  //Get Full Cast & Crew   
   curPos:=Pos('<h1 class="header">Full Cast & Crew</h1>',HTML);
   If 0<curPos Then Begin   
      EndPos:=curPos;
      ItemValue:=HTMLValues2(HTML,'<h1 class="header">Full Cast & Crew</h1>','<h2>See also</h2>','<h4 ','</h4>','<br>   •   ',EndPos);  //WEB_SPECIFIC.
      If ItemValue <> '' then ItemValue:='<link url="'+GetFieldValueXML('url')+'fullcredits">Full Cast&Crew info names</link><br>   •   '+ItemValue;
      AddCustomFieldValueByName('Cinema1',ItemValue);
      LogMessage('      Get result Movie Full Cast & Crew Credits:'+ItemValue+'||');
   End;      
   
  //Get ~crew~ctDirectors,ctWriters,ctComposers,ctProducers
   Fullinfo:='';
    //Go to "Directed by" ~crew~ctDirectors
    curPos:=Pos('<h4 class="dataHeaderWithBorder">Directed by',HTML);                     //Strings start which opens the block content data. WEB_SPECIFIC   
    If 0<curPos Then Begin
      curPos:=PosFrom('</h4>',HTML,curPos);                                              //Strings end which opens the block content data.  WEB_SPECIFIC
      curPos:=curPos+Length('</h4>');                                                    //Strings end which opens the block content data.  WEB_SPECIFIC
      //Get all "raw" crew summary (in raw because we need the hidden person links) May one person or severals in the ~crew~ n the ~crew~
      endPos:=PosFrom('</table>',HTML,curPos);                                             //Strings which opens/closes the data. WEB_SPECIFIC
      ItemList:=Copy(HTML,curPos,endPos-curPos);
      //LogMessage('           Parse results ('+IntToStr(curPos)+','+IntToStr(endPos)+') complex ItemList:'+ItemList+'||');
      curPos:=Pos('<td class="name">',ItemList)                                         //String which opens the subList data. WEB_SPECIFIC
      index:=1;
      While curPos>0 Do Begin
         If (index>PEOPLE_LIMIT) Then break;     //Limited depassed.
         //Get PersonURL (Always must it has)
         PersonURL:=BASE_URL_PERSON_PRE + TextBetWeen(ItemList,'<a href="/name/','/',false,curPos) + BASE_URL_SUF;     //Strings which opens/closes the data. WEB_SPECIFIC
         LogMessage('      Parse Results PersonURL:'+PersonURL+'||');         
         //Get Name (Always must it has)
         Name:=TextBetWeen(ItemList,'> ','</a>',false,curPos);                                 //Strings which opens/closes the data. WEB_SPECIFIC     
         LogMessage('      Parse Results Name:'+Name+'||');
         //Get Role: PVD don't save Role in crew people but is added for Ivek23 as LogMessage compatibility
            Role:=TextBetWeen(ItemList,'<td ','</td>',false,curPos);                             //Strings which opens/closes the data. WEB_SPECIFIC
         LogMessage('      Parse Results Role1:'+Role+'||');
         Role:=StringReplace(Role,'class="credit">','',True,False,True);
         Role:=StringReplace(Role,'colspan="2">','',True,False,True);
         Role:=StringReplace(Role,'            (uncredited)','(uncredited)',True,False,True);
         LogMessage('      Parse Results Role:'+Role+'||');

         AddMoviePerson(Name,'','',PersonURL,ctDirectors);
         //LogMessage('      Get results Director:#'+IntToStr(index)+'|'+Name+'|'+PersonURL+'||ctDirectors');
         if Directors <> '' then Directors:=Directors+#13;
         if PersonURL <> '' then Directors:=Directors+'<link url="'+PersonURL+'">'+Name+'</link>'+'          ';
         if Role <> '' then Directors:=Directors+Role;         
         LogMessage('      Get results Directors:#'+IntToStr(index)+'|'+Name+'|'+Role+'|'+PersonURL+'||ctDirectors');

         curPos:=PosFrom('<td class="name">',ItemList,curPos)                                            //String which opens the subList data. WEB_SPECIFIC
         index:=index+1;
      End;
    End;
   If Directors <> '' then fullinfo:=fullinfo+'Directed:'+'<br>'+Directors+'<br><br>';
    //Go to "Writer:" or "Writers:" ~crew~ctWriters
   curPos:=Pos('<h4 class="dataHeaderWithBorder">Writing Credits',HTML);
   If 0<curPos Then Begin   
      curPos:=PosFrom('</h4>',HTML,curPos);                                              //Strings end which opens the block content data.  WEB_SPECIFIC
      curPos:=curPos+Length('</h4>');                                                    //Strings end which opens the block content data.  WEB_SPECIFIC
      //Get all "raw" crew summary (in raw because we need the hidden person links) May one person or severals in the ~crew~
      endPos:=PosFrom('</table>',HTML,curPos);                                             //Strings which opens/closes the data. WEB_SPECIFIC
      ItemList:=Copy(HTML,curPos,endPos-curPos);
      //LogMessage('           Parse results ('+IntToStr(curPos)+','+IntToStr(endPos)+') complex ItemList:'+ItemList+'||');
      curPos:=Pos('<td class="name">',ItemList)                                            //String which opens the subList data. WEB_SPECIFIC
      index:=1;
      While curPos>0 Do Begin
         If (index>PEOPLE_LIMIT) Then break;     //Limited depassed.
         //Get PersonURL (Always must it has)
         PersonURL:=BASE_URL_PERSON_PRE + TextBetWeen(ItemList,'<a href="/name/','/',false,curPos) + BASE_URL_SUF;     //Strings which opens/closes the data. WEB_SPECIFIC
         LogMessage('      Parse Results PersonURL:'+PersonURL+'||');         
         //Get Name (Always must it has)
         Name:=TextBetWeen(ItemList,'> ','</a>',false,curPos);                                 //Strings which opens/closes the data. WEB_SPECIFIC
         LogMessage('      Parse Results Name:'+Name+'||');
            //Get Role: PVD don't save Role in crew people but is added for Ivek23 as LogMessage compatibility
         Role:=TextBetWeen(ItemList,'<td class="credit">','</td>',false,curPos);                    //Strings which opens/closes the data. WEB_SPECIFIC
         Role := StringReplace(Role,') and',') ',True,False,True);
         Role := StringReplace(Role,') &',') ',True,False,True);
         Role := StringReplace(Role,'novel &','novel ',True,False,True);
         Role := StringReplace(Role,'screenplay &','screenplay ',True,False,True);
         Role := StringReplace(Role,'script &','script ',True,False,True);
         //Role := StringReplace(Role,'story &','story ',True,False,True);
         //Role := StringReplace(Role,'&',' ',True,False,True);
         if Pos('and',Role) = 1 then Delete(Role, 1, 3);
         if Pos('&',Role) = 1 then Delete(Role, 1, 2);
         if Pos('story and',Role) = 1 then Delete(Role, 7, 3);
         //Role:=StringReplace(Role,'            ','          ',True,False,True);         
         LogMessage('      Parse Results Role:'+Role+'||');      
      
         AddMoviePerson(Name,'','',PersonURL,ctWriters);
         //LogMessage('      Get results Writer:#'+IntToStr(index)+'|'+Name+'|'+PersonURL+'||ctWriters');
         if Writers <> '' then Writers:=Writers+#13;
         if PersonURL <> '' then Writers:=Writers+'<link url="'+PersonURL+'">'+Name+'</link>'+'          ';
         if Role <> '' then Writers:=Writers+Role;                  
         LogMessage('      Get results Writers:#'+IntToStr(index)+'|'+Name+'|'+Role+'|'+PersonURL+'||ctWriters'); 
         curPos:=PosFrom('<td class="name">',ItemList,curPos)     //String which opens the subList data. WEB_SPECIFIC
         index:=index+1;
      End;
    End;
   If Writers <> '' then fullinfo:=fullinfo +'Writing Credits:'+'<br>'+Writers+'<br><br>';
    //Go to "Producers" ~crew~ctProducers
   curPos:=Pos('<h4 class="dataHeaderWithBorder">Produced by',HTML);
   If 0<curPos Then Begin
      curPos:=PosFrom('</h4>',HTML,curPos);                                              //Strings end which opens the block content data.  WEB_SPECIFIC
      curPos:=curPos+Length('</h4>');                                                    //Strings end which opens the block content data.  WEB_SPECIFIC
      //Get all "raw" crew summary (in raw because we need the hidden person links) May one person or severals in the ~crew~
      endPos:=PosFrom('</table>',HTML,curPos);                                             //Strings which opens/closes the data. WEB_SPECIFIC
      ItemList:=Copy(HTML,curPos,endPos-curPos);
      //LogMessage('           Parse results ('+IntToStr(curPos)+','+IntToStr(endPos)+') complex ItemList:'+ItemList+'||');;
      curPos:=Pos('<td class="name">',ItemList)                                               //String which opens the subList data. WEB_SPECIFIC
      index:=1;
      While curPos>0 Do Begin
         If (index>PEOPLE_LIMIT) Then break;     //Limited depassed.
         //Get PersonURL (Always must it has)
         PersonURL:=BASE_URL_PERSON_PRE + TextBetWeen(ItemList,'<a href="/name/','/',false,curPos) + BASE_URL_SUF;     //Strings which opens/closes the data. WEB_SPECIFIC
         LogMessage('      Parse Results PersonURL:'+PersonURL+'||');         
         //Get Name (Always must it has)
         Name:=TextBetWeen(ItemList,'> ','</a>',false,curPos);                                 //Strings which opens/closes the data. WEB_SPECIFIC
         LogMessage('      Parse Results Name:'+Name+'||');
            //Get Role: PVD don't save Role in crew people but is added for Ivek23 as LogMessage compatibility
         Role:=TextBetWeen(ItemList,'<td class="credit">','</td>',false,curPos);                    //Strings which opens/closes the data. WEB_SPECIFIC
         LogMessage('      Parse Results Role:'+Role+'||');

         AddMoviePerson(Name,'','',PersonURL,ctProducers);
         //LogMessage('      Get results Producers:#'+IntToStr(index)+'|'+Name+'|'+PersonURL+'||ctProducers');
         if Producers <> '' then Producers:=Producers+#13;
         if PersonURL <> '' then Producers:=Producers+'<link url="'+PersonURL+'">'+Name+'</link>'+'          ';
         if Role <> '' then Producers:=Producers+Role;         
         LogMessage('      Get results Producers:#'+IntToStr(index)+'|'+Name+'|'+Role+'|'+PersonURL+'||ctProducers'); 

         curPos:=PosFrom('<td class="name">',ItemList,curPos)                                                   //String which opens the subList data. WEB_SPECIFIC
         index:=index+1;
      End;   
    End;
   If Producers <> '' then fullinfo:=fullinfo +'Produced:'+'<br>'+Producers+'<br><br>';
    //Go to "Music" ~crew~ctComposers
   curPos:=Pos('<h4 class="dataHeaderWithBorder">Music by',HTML);
   If 0<curPos Then Begin
      curPos:=PosFrom('</h4>',HTML,curPos);                                              //Strings end which opens the block content data.  WEB_SPECIFIC
      curPos:=curPos+Length('</h4>');                                                    //Strings end which opens the block content data.  WEB_SPECIFIC
      //Get all "raw" crew summary (in raw because we need the hidden person links) May one person or severals in the ~crew~
      endPos:=PosFrom('</table>',HTML,curPos);                                             //Strings which opens/closes the data. WEB_SPECIFIC
      ItemList:=Copy(HTML,curPos,endPos-curPos);
      //LogMessage('           Parse results ('+IntToStr(curPos)+','+IntToStr(endPos)+') complex ItemList:'+ItemList+'||');List+'||');
      curPos:=Pos('<td class="name">',ItemList)                                               //String which opens the subList data. WEB_SPECIFIC
      index:=1;
      While curPos>0 Do Begin
         If (index>PEOPLE_LIMIT) Then break;     //Limited depassed.
         //Get PersonURL (Always must it has)
         PersonURL:=BASE_URL_PERSON_PRE + TextBetWeen(ItemList,'<a href="/name/','/',false,curPos) + BASE_URL_SUF;     //Strings which opens/closes the data. WEB_SPECIFIC
         LogMessage('      Parse Results PersonURL:'+PersonURL+'||');         
         //Get Name (Always must it has)
         Name:=TextBetWeen(ItemList,'> ','</a>',false,curPos);                                 //Strings which opens/closes the data. WEB_SPECIFIC         
         LogMessage('      Parse Results Name:'+Name+'||');
            //Get Role: PVD don't save Role in crew people but is added for Ivek23 as LogMessage compatibility
         Role:=TextBetWeen(ItemList,'<td class="credit">','</td>',false,curPos);                    //Strings which opens/closes the data. WEB_SPECIFIC
         LogMessage('      Parse Results Role:'+Role+'||');
         AddMoviePerson(Name,'',Role,PersonURL,ctComposers);
         //LogMessage('      Get results Composers:#'+IntToStr(index)+'|'+Name+'|'+PersonURL+'||ctComposers');
         if Composers <> '' then Composers:=Composers+#13;
         if PersonURL <> '' then Composers:=Composers+'<link url="'+PersonURL+'">'+Name+'</link>'+'          ';
         if Role <> '' then Composers:=Composers+Role;
         LogMessage('      Get results Composers:#'+IntToStr(index)+'|'+Name+'|'+Role+'|'+PersonURL+'||ctComposers'); 

         curPos:=PosFrom('<td class="name">',ItemList,curPos)                                                   //String which opens the subList data. WEB_SPECIFIC
         index:=index+1;
      End;
    End;
   If Composers <> '' then fullinfo:=fullinfo +'Music:'+'<br>'+Composers+'<br><br>';
    //Get  to "Cast" ~actors~ ctActors
    //Go Cast list
    curPos:=Pos('<table class="cast_list">',HTML);                                     //Strings start which opens the block content data. WEB_SPECIFIC
    curPos:=curPos+Length('<table class="cast_list">');                                //Strings end which opens the block content data.  WEB_SPECIFIC
    //Get all "raw" crew summary (in raw because we need the hidden person links) May one person or severals in the ~crew~
    endPos:=PosFrom('</div>',HTML,curPos);                                             //Strings which opens/closes the data. WEB_SPECIFIC
    ItemList:=Copy(HTML,curPos,endPos-curPos);
    //LogMessage('           Parse results ('+IntToStr(curPos)+','+IntToStr(endPos)+') complex ItemList:'+ItemList+'||');
    curPos:=Pos('<td class="primary_photo">',ItemList)                               //String which opens the subList data. WEB_SPECIFIC
    index:=1;
    While curPos>0 Do Begin
        If (index>PEOPLE_LIMIT) Then break;     //Limited depassed.
        //Get PersonURL (Always must it has)
        PersonURL:=BASE_URL_PERSON_PRE + TextBetWeen(ItemList,'<a href="/name/','/',false,curPos) + BASE_URL_SUF; //Strings which opens/closes the data. WEB_SPECIFIC
        LogMessage('      Parse Results PersonURL:'+PersonURL+'||');         
        //Get Name (Always must it has)
        Name:=TextBetWeen(ItemList,'> ','</a>',false,curPos);                             //Strings which opens/closes the data. WEB_SPECIFIC      
        LogMessage('      Parse Results Name:'+Name+'||');
        //Get Role
        Role:=TextBetWeen(ItemList,'<td class="character">','</td>',false,curPos);                    //Strings which opens/closes the data. WEB_SPECIFIC         
        LogMessage('      Parse Results Role:'+Role+'||');
      Role:=StringReplace(Role,'       (',' (',True,False,True);
      Role:=StringReplace(Role,'(uncredited)                    ','(uncredited) • ',True,False,True);
      Role:=StringReplace(Role,')                    ',') ',True,False,True);
      Role:=StringReplace(Role,' /              ',' - ',True,False,True);
      Role:=StringReplace(Role,'         / ...                    ',' • ',True,False,True);
      Role:=StringReplace(Role,'                  ',' • ',True,False,True);      
      Role:=StringReplace(Role,'      (uncredited)',' (uncredited)',True,False,True);
      LogMessage('      Parse Results Role_1:'+Role+'||');      
        AddMoviePerson(Name,'',Role,PersonURL,ctActors);
        LogMessage('      Get results cast:#'+IntToStr(index)+'|'+Name+'|'+Role+'|'+PersonURL+'||ctActors');                                               
        curPos:=PosFrom('<td class="primary_photo">',ItemList,curPos);                                  //String which opens the Web Result item List data. WEB_SPECIFIC
        index:=index+1;
    End;   
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2736
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #164 on: January 21, 2019, 04:15:52 pm »
IMDB_ [EN] [HTTPS] script

ParsePage_IMDBMovieCREDIT

Part 2:

New added and modified:


Quote
Function ParsePage_IMDBMovieCREDIT(HTML:String):Cardinal; //BlockOpen
    //Returns:
    //     Result:=prFinished; Script has finished gathering data
    //     Result:=prError; If żany big problem? with exit;
    //Retrieve: ~crew~ctDirectors,ctWriters,ctComposers,ctProducers
    //          ~actors~ ctActors
  Var
    curPos,endPos,index:Integer;
   debug_pos1:Integer;
    ItemValue,ItemList:String;
    Name,Role,PersonURL:String;
   ItemValue14:String;
   Fullinfo,Directors,Writers,Composers,Producers:String;   

  Begin
    LogMessage('Function ParsePage_IMDBMovieCREDIT BEGIN=====================||');
    Result:=prFinished;  //It will change to prError if any big problem with exit;
.
.
.
   //Get to "Others Crew"
    //Go Others Crew list
   //~Cinematography~
   ItemValue:='';
   curPos:=Pos('<h4 class="dataHeaderWithBorder">Cinematography by',HTML);
   If 0<curPos Then Begin
      curPos:=PosFrom('</h4>',HTML,curPos);
      curPos:=curPos+Length('</h4>');
      endPos:=PosFrom('</table>',HTML,curPos);
      ItemList:=Copy(HTML,curPos,endPos-curPos);
      //LogMessage('           Parse results ('+IntToStr(curPos)+','+IntToStr(endPos)+') complex ItemList:'+ItemList+'||');
      curPos:=Pos('<td class="name">',ItemList);
      index:=1;
      While curPos>0 Do Begin
         PersonURL:=BASE_URL_PERSON_PRE + TextBetWeen(ItemList,'<a href="/name/','/',false,curPos) + BASE_URL_SUF;
         //LogMessage('      Parse Results PersonURL:'+PersonURL+'||');         
         Name:=TextBetWeen(ItemList,'> ','</a>',false,curPos);
         //LogMessage('      Parse Results Name:'+Name+'||');
         Role:=TextBetWeen(ItemList,'<td class="credit">','</td>',false,curPos);
         //LogMessage('      Parse Results Role:'+Role+'||');   
         if ItemValue <> '' then ItemValue:=ItemValue+#13;
         if PersonURL <> '' then ItemValue:=ItemValue+'<link url="'+PersonURL+'">'+Name+'</link>'+'          ';
         if Role <> '' then ItemValue:=ItemValue+Role;
         //AddCustomFieldValueByName('Cinema',ItemValue);   
         //if ItemValue <> '' then Fullinfo:=Fullinfo+'Cinematography:<br>'+ItemValue+'<br><br>';
         LogMessage('      Get results Cinematography by:#'+IntToStr(index)+'|'+Name+'|'+Role+'|'+PersonURL+'||');                                               
         curPos:=PosFrom('<td class="name">',ItemList,curPos);
         index:=index+1;
      End;   
   End;
   If ItemValue <> '' then Fullinfo:=Fullinfo+'Cinematography:<br>'+ItemValue+'<br><br>';       
   //~Thanks~
   ItemValue14:='';
   curPos:=Pos('<h4 class="dataHeaderWithBorder">Thanks',HTML);
   If 0<curPos Then Begin
      curPos:=PosFrom('</h4>',HTML,curPos);
      curPos:=curPos+Length('</h4>');
      endPos:=PosFrom('</table>',HTML,curPos);
      ItemList:=Copy(HTML,curPos,endPos-curPos);
      //LogMessage('           Parse results ('+IntToStr(curPos)+','+IntToStr(endPos)+') complex ItemList:'+ItemList+'||');
      curPos:=Pos('<td class="name">',ItemList);
      index:=1;
      While curPos>0 Do Begin
         PersonURL:=BASE_URL_PERSON_PRE + TextBetWeen(ItemList,'<a href="/name/','/',false,curPos) + BASE_URL_SUF;               
         //LogMessage('      Parse Results PersonURL:'+PersonURL+'||');
         Name:=TextBetWeen(ItemList,'> ','</a>',false,curPos);
         //LogMessage('      Parse Results Name:'+Name+'||');
         Role:=TextBetWeen(ItemList,'<td class="credit">','</td>',false,curPos);
         //LogMessage('      Parse Results Role:'+Role+'||');   
         //if ItemValue14 <> '' then ItemValue14:=ItemValue14+#13;
         if ItemValue14 <> '' then ItemValue14:=ItemValue14+#32#32;   
         If Pos('the producers wish to thank',Role) OR Pos('special thanks',Role) OR Pos('thanks',Role) < 1 then   
         if PersonURL <> '' then ItemValue14:=ItemValue14+'<link url="'+PersonURL+'">'+Name+'</link>'+'          ';            
         debug_pos1:=Pos('the producers wish to thank',Role);
            If debug_pos1 >0 then Role:=Copy(Role,0,debug_pos1-1);
         debug_pos1:=Pos('very special thanks',Role);
            If debug_pos1 >0 then Role:=Copy(Role,0,debug_pos1-1);            
         debug_pos1:=Pos('special thanks',Role);
            If debug_pos1 >0 then Role:=Copy(Role,0,debug_pos1-1);
         debug_pos1:=Pos('thanks',Role);
            If debug_pos1 >0 then Role:=Copy(Role,0,debug_pos1-1);            
         if Role <> '' then ItemValue14:=ItemValue14+Role;
         ItemValue14:=StringReplace(ItemValue14,'      <link url="',#13+'<link url="',True,False,True);
         LogMessage('      Get results Thanks:#'+IntToStr(index)+'|'+Name+'|'+Role+'|'+PersonURL+'||');            
         curPos:=PosFrom('<td class="name">',ItemList,curPos);    
         index:=index+1;
      End;   
   End;   
   If ItemValue14 <> '' then Fullinfo:=Fullinfo+'Thanks:<br>'+ItemValue14;      
   if (Length(Fullinfo)>0) then begin
        AddCustomFieldValueByName('Cinema',Fullinfo);
        LogMessage('      Get result Movie Others Crew:'+Fullinfo+'||');
    End;

    LogMessage('Function ParsePage_IMDBMovieCREDIT END=====================||');
  End; //BlockClose
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2736
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #165 on: January 21, 2019, 04:34:30 pm »
IMDB_ [EN] [HTTPS]  script

New added:


Quote
Function ParsePage_IMDBMoviePLOTSUMMARY(HTML:String):Cardinal; //BlockOpen
    //Returns:
    //     Result:=prFinished; Script has finished gathering data
    //     Result:=prError; If żany big problem? with exit
    //Retrieve: PLOTSUMMARY~
  Var
    //curPos:Integer;
    curPos,endPos:Integer;
   ItemValue,ItemList:String;
   Category,Name:String;
  Begin
    LogMessage('Function ParsePage_IMDBMoviePLOTSUMMARY BEGIN=====================||');
    Result:=prFinished;  //It will change to prError if any big problem with exit;
   // ~Plot~ info
    curPos:=Pos('<h1 class="header">Plot</h1>',HTML);
    if (curPos=0) then Exit;
    EndPos:=curPos;   
   //Get "Plot" info
   //If Pos('<h1 class="header">Plot</h1>',HTML)>0 Then Begin
   curPos:=Pos('<h1 class="header">Plot</h1>',HTML);
   If 0<curPos Then Begin   
      EndPos:=curPos;   
      Category:=TextBetween(HTML,'<h1 class="header">','</h1>',True,curPos);
      LogMessage('      Get result Category:'+Category+'||');
      Name:=TextBetween(HTML,'<div class="ipl-itemcount-header">','</ul>',True,curPos);
      LogMessage('      Get result Name:'+Name+'||');
      Name:=StringReplace(Name,'                Jump to:         ',#13#160#160#160#160#9679#160#160,True,False,True);
      //if Name <> '' then Name:=#160#160#160#9679#160#160#160+Name;
      if Name <> '' then Name:=#160#160#160#160+Name;
      LogMessage('      Get result Name1:'+Name+'||');
      AddCustomFieldValueByName('Plot Summary','<link url="'+GetFieldValueXML('url')+'plotsummary">'+Category+' Summary</link>'+Name);      
   End;      
   // ~Plot Summary~
   If (Pos('It looks like we don'+Chr(39)+'t have any Summaries for this title yet.',HTML)>0) then Exit;   
   //Get "Summaries" info (~Comment~)
   If Pos('<h1 class="header">Plot</h1>',HTML)>0 Then Begin
      curPos:=Pos('<h1 class="header">Plot</h1>',HTML);
      EndPos:=curPos;   
      ItemValue:=HTMLValues2(HTML,'Plot','See also','<li class="ipl-zebra-list__item" id="summary','</p>','<br><br>-------<br><br>',EndPos);   
      ItemValue:=StringReplace(ItemValue,'<a href='+Chr(39),'<link url="'+GetFieldValueXML('url'),True,False,True);
      ItemValue:=StringReplace(ItemValue,'?ref_='+Chr(39)+'>',+'">',True,False,True);
      ItemValue:=StringReplace(ItemValue,'</a>','</link>',True,False,True);         
      AddFieldValueXML('comment',ItemValue);
      LogMessage('      Get result ItemValue (~Comment~):'+ItemValue+'||');   
   End;   
   // ~Plot~ info ~Plot Summary~
    curPos:=Pos('<div id="pagecontent" class="pagecontent">',HTML);
    curPos:=PosFrom('<section class="article listo">',HTML,curPos);
    curPos:=curPos+Length('<div id="content-2-wide" class="redesign">');
    endPos:=PosFrom('</section>',HTML,curPos);
    ItemList:=Copy(HTML,curPos,endPos-curPos);   
   //LogMessage('           Parse results ('+IntToStr(curPos)+','+IntToStr(endPos)+') complex ItemList:'+ItemList+'||');         
    LogMessage('Function ParsePage_IMDBMoviePLOTSUMMARY END=====================||');
  End; //BlockClose   

Quote
//USER FUNCTIONS AND PROCEDURES==================================================================================BlockClose
//OBLIGATORY CALLBACK PRINCIPAL FUNCTION=========================================================================BlockOpen
Function ParsePage(HTML:String;URL:AnsiString):Cardinal; //BlockOpen
  Var
    MovieID,titleValue,yearValue:String;
    ResultTmp:Cardinal;
    Date:String;
    Fullinfo,Movie_URL,IMDB_URL: String;
    DateParts: TWideArray;
  Begin
    LogMessage('Function ParsePage BEGIN======================|');
    LogMessage('Global Var-Mode|'+IntToStr(Mode)+'|');
    LogMessage('Global Var-DownloadURL|'+DownloadURL+'|');
    LogMessage('      Local Var-URL|'+URL+'|');
.
.
.
    //Parse Plot Keywords provider page = BASE_URL_PLOTKEYWORDS---------------------------------------------------------------------------
        If GET_FULL_PLOTKEYWORDS Then Begin
            DownloadURL:=StringReplace(BASE_URL_PLOTKEYWORDS,'%IMDB_ID',MovieID,True,True,False);
            HTML:=DownloadPage(DownloadURL);  //True page for parsing
            HTML:=HTMLToText(HTML);
            ResultTmp:=ParsePage_IMDBMoviePLOTKEYWORDS(HTML);
         //AddCustomFieldValueByName('Download_URL','<link url="'+DownloadURL+'">IMDB PLOTKEYWORDS</link>  ');
            If Not(ResultTmp=prFinished) then Result:=ResultTmp;
        End;      
    //Parse Plotsummary provider page =  BASE_URL_PLOTSUMMARY---------------------------------------------------------------------------
        If GET_FULL_PLOTSUMMARY Then Begin
            DownloadURL:=StringReplace(BASE_URL_PLOTSUMMARY,'%IMDB_ID',MovieID,True,True,False);
            HTML:=DownloadPage(DownloadURL);  //True page for parsing
            HTML:=HTMLToText(HTML);
            ResultTmp:=ParsePage_IMDBMoviePLOTSUMMARY(HTML);
         AddCustomFieldValueByName('Plotsummary_URL','<link url="'+DownloadURL+'">IMDB_PLOTSUMMARY</link>');
            If Not(ResultTmp=prFinished) then Result:=ResultTmp;
        End;         
    //Date ~Updated~ (choose simple or verbose version)
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2736
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #166 on: January 21, 2019, 04:41:04 pm »
IMDB_ [EN] [HTTPS] script

Modified:


Quote
//USER FUNCTIONS AND PROCEDURES==================================================================================BlockClose
//OBLIGATORY CALLBACK PRINCIPAL FUNCTION=========================================================================BlockOpen
Function ParsePage(HTML:String;URL:AnsiString):Cardinal; //BlockOpen
  Var
    MovieID,titleValue,yearValue:String;
    ResultTmp:Cardinal;
    Date:String;
   Fullinfo,Movie_URL,IMDB_URL: String;
    DateParts: TWideArray;
  Begin
.
.
.
//Parse with the Movie URL 'smNormal'------------------------------------------------------------------------------------
    If (Mode=smNormal) Then Begin
        //Get the script Overwrite Options saved in pvdconf.ini (Remember that PVD only save the options on exit)
        //0=Do nothing,1=Set if Empty,2=Overwrite
        PVDConfigOptions:=TextBetWeenFirst(FileToString(GetAppPath+'pvdconf.ini'),'IMDB_[EN][HTTPS].psf=',Chr(13));
            //LogMessage('Stored Script PVDConfigOptions is:'+PVDConfigOptions+'||');
            //LogMessage('The Script option of position '+ IntToStr(opPoster) +' is:'+Copy(PVDConfigOptions,opPoster,1)+'||');
        Result:=prFinished;  //It will change to prError if any big problem with exit; 
        //Information in several page. Needs Provider MovieID
        MovieID:=TextBetWeenFirst(DownloadURL,BASE_URL_PRE_TRUE,BASE_URL_SUF);
        LogMessage('  ParsePage mode smNormal|'+IntToStr(Mode)+'|. Getting provider data for MovieID|'+ MovieID +'|');
        AddCustomFieldValueByName('IMDbID',MovieID);
        LogMessage('      Get result IMDbID (CF~IMDbID~):'+MovieID+'||');
        //Get ~url~
        if (0=Pos(BASE_URL_PRE,StoredURL)) then begin   //Write the url if not exists
            AddFieldValueXML('url',StringReplace(DownloadURL,BASE_URL_PRE_TRUE,BASE_URL_PRE,True,False,False));
            LogMessage('      Get result url:'+StringReplace(DownloadURL,BASE_URL_PRE_TRUE,BASE_URL_PRE,True,False,False)+'||');
        end;
        //Get ~IMDb Movie Url~       
        Movie_URL:=StringReplace(DownloadURL,BASE_URL_PRE_TRUE,BASE_URL_PRE,True,False,False);
        LogMessage('      Get result Movie_url: '+Movie_URL+' ||');
        Fullinfo:='';
      //Fullinfo:=Fullinfo+'<link url="'+Movie_UR+'">Maindetails</link>  ';
        Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'">MainPage</link>  ';
        Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'reference">Reference</link>  ';
        Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'fullcredits">Full Cast&Crew</link>  ';
        Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'awards">Awards</link>  ';
        Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'releaseinfo">ReleaseDates</link>  ';
        //Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'technical">TechnicalSpecs</link>  ';
      Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'technical">TechSpecs</link>  ';
        Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'parentalguide">ParentsGuide</link>  ';   
        Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'keywords">PlotKeywords</link>  ';
        Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'plotsummary">PlotSummary</link>  ';
        Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'locations">FilmLocations</link>  ';   
        Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'taglines">Taglines</link>  ';
        Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'companycredits">CompanyCredits</link>  ';
        Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'movieconnections">Connections</link>  ';
        Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'soundtrack">Soundtracks</link>  ';
        //Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'externalsites">Miscellaneous</link>  ';
      Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'externalsites">MiscSites</link>  ';
      Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'externalsites#photos">MiscPhoto</link>  ';
        Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'mediaindex">PhotoGallery</link>  ';
      //Fullinfo:=Fullinfo+'<link url="'+Movie_URLL+'externalsites#misc">MiscSites</link>  ';
      //Fullinfo:=Fullinfo+'<link url="'+Movie_URL+'externalsites#photos">MiscPhoto</link>  ';
        If Fullinfo <> '' then IMDB_URL:=Fullinfo;
        If IMDB_URL <> '' then AddCustomFieldValueByName('IMDb Movie Url',IMDB_URL);
        LogMessage('      Get result Fullinfo-IMDB_URL (CF~IMDb Movie Url~ ):'+#13+IMDB_URL+'||');
   
    //Parse principal provider page = BASE_URL_PRE_TRUE------------------------------------------------------------------

All these changes are included in IMDB_ [EN] [HTTPS] + script, which is attached.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2736
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #167 on: January 21, 2019, 05:00:47 pm »
IMDB_[EN][HTTPS] (Plotsummary) script

An IMDB_ [EN] [HTTPS] (Plotsummary) script for full download of Plotsummary information was made.

Plotsummary information is transferred to the comment field.

IMDB_ [EN] [HTTPS] (Plotsummary) script is attached.


You can also find more information about Custom Fields in the IMDB_ [EN] [HTTPS] (Plotsummary) script Possibles improving Custom Fields working in MOD version.
« Last Edit: January 21, 2019, 05:05:25 pm by Ivek23 »
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2736
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #168 on: January 21, 2019, 06:40:03 pm »
IMDB_[EN][HTTPS]_(Cast&Crew) script

Something has already been described for Cast & Crew downloading information on this link.
http://www.videodb.info/forum_en/index.php/topic,4134.msg20881.html#msg20881
http://www.videodb.info/forum_en/index.php/topic,4134.msg20883.html#msg20883

and
http://www.videodb.info/forum_en/index.php/topic,4134.msg20884.html#msg20884

IMDB_ [EN] [HTTPS]+ script has the default downloading the following information.

   •   Directed by
   •   Writing Credits  // NO (WGA)
   •   Cast (in credits order)  // Only data info in normal Actors field
   •   Produced by
   •   Music by
   •   Cinematography by
   •   Thanks


Here are some more details, which are only possible with IMDB_ [EN] [HTTPS] _ (Cast & Crew) script.


Quote
  5. Cast & Crew field info names:   
   •   Directed by
   •   Writing Credits  // NO (WGA)
   •   Cast (in credits order)  // Only data info in normal Actors field
   •   Produced by
   •   Music by
   •   Cinematography by
   •   Film Editing by
   •   Casting By
   •   Production Design by
   •   Art Direction by
   •   Set Decoration by
   •   Costume Design by
   •   Production Management
   •   Second Unit Director or Assistant Director 
   •   Special Effects by
   •   Visual Effects by
   •   Casting Department
   •   Location Management
   •   Music Department
   •   Thanks

IMDB_[EN][HTTPS]_(Cast&Crew) script has the default settings for downloading the following information.

Default settings
Quote
  //GET_CREW_CREDIT  = False ;  //Download Cast and Credit provider page for retreive the some credits (crew) info. Otherwise set to False to only the Directors, Writers, Composers, Producers, Cinematography and Thanks info of the Cast and Credit provider page. 
  GET_CREW_CREDIT  = True ;  //Download Cast and Credit provider page for retreive the some credits (crew) info. Otherwise set to False to only the Directors, Writers, Composers, Producers, Cinematography and Thanks info of the Cast and Credit provider page.
  GET_FULL_CREW_CREDIT  = False ;  //Download Cast and Credit provider page for retreive the more  some credits (crew) info. Otherwise set to False to only the Directors, Writers, Composers, Producers and Cinematography + (GET_CREW_CREDIT = True) info of the Cast and Credit provider page.

IMDB_ [EN] [HTTPS]+ script downloading the following information.
   •   Directed by
   •   Writing Credits  // NO (WGA)
   •   Cast (in credits order)  // Only data info in normal Actors field
   •   Produced by
   •   Music by
   •   Cinematography by
   •   Thanks


IMDB_ [EN] [HTTPS] _ (Cast & Crew) script also has the default downloading the following information.

   •   Film Editing by
   •   Casting By
   •   Production Design by
   •   Art Direction by
   •   Set Decoration by
   •   Costume Design by
   •   Production Management
   •   Second Unit Director or Assistant Director


IMDB_ [EN] [HTTPS] _ (Cast & Crew) script has default blocked settings for downloading the following information.

   •   Special Effects by
   •   Visual Effects by
   •   Casting Department
   •   Location Management
   •   Music Department


To have unblocked settings for downloading the following information, change the blocked settings in IMDB_ [EN] [HTTPS] _ (Cast & Crew) script as shown below.

Default settings
Quote
  //GET_CREW_CREDIT  = False ;  //Download Cast and Credit provider page for retreive the some credits (crew) info. Otherwise set to False to only the Directors, Writers, Composers, Producers, Cinematography and Thanks info of the Cast and Credit provider page. 
  GET_CREW_CREDIT  = True ;  //Download Cast and Credit provider page for retreive the some credits (crew) info. Otherwise set to False to only the Directors, Writers, Composers, Producers, Cinematography and Thanks info of the Cast and Credit provider page.
  GET_FULL_CREW_CREDIT  = True ;  //Download Cast and Credit provider page for retreive the more  some credits (crew) info. Otherwise set to False to only the Directors, Writers, Composers, Producers and Cinematography + (GET_CREW_CREDIT = True) info of the Cast and Credit provider page.

Then, IMDB_ [EN] [HTTPS] _ (Cast & Crew) script will download all of the possible information described.

   •   Directed by
   •   Writing Credits  // NO (WGA)
   •   Cast (in credits order)  // Only data info in normal Actors field
   •   Produced by
   •   Music by
   •   Cinematography by
   •   Film Editing by
   •   Casting By
   •   Production Design by
   •   Art Direction by
   •   Set Decoration by
   •   Costume Design by
   •   Production Management
   •   Second Unit Director or Assistant Director 
   •   Special Effects by
   •   Visual Effects by
   •   Casting Department
   •   Location Management
   •   Music Department
   •   Thanks


Custom fields are Cinema and Cinema1.

]IMDB_[EN][HTTPS]_(Cast&Crew) script is attached.


You can also find more information about Custom Fields in the IMDB_ [EN] [HTTPS] _ (Cast & Crew) script in Possibles improving Custom Fields working in MOD version.

Notification:

IMDB_ [EN] [HTTPS] _ (Cast & Crew) script should only be a secondary script for those users whose interest in this information is.
« Last Edit: January 30, 2019, 08:29:57 pm by Ivek23 »
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline VVV_Easy_Programing

  • Older Power User
  • *****
  • Posts: 199
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #169 on: February 10, 2019, 11:25:10 am »
Attached temporal Acumulative Scripts Patch date: 2019.02.10 (to copy in PVD folder for overwriting the existing files).

Changelog:
        IMDB_[EN][HTTPS]
                  V 1.4.1.0 (10/02/2019) Ivek23: Added ParsePage_PLOTSUMMARY.Ivek23 corrections and improvements since last version (see forum)
        IMDB_People_[EN][HTTPS]
                 V 1.3.1.0 (10/02/2019) Ivek23: Ivek23 corrections and improvements since last version (see forum)

Notes for Ivek23:
I have tried to include all the fixes and improvements in this patch except the alternative scripts, for example IMDB_[EN][HTTPS]_(Cast&Crew) script.
I think that you are better positioned to decide the evolution of the script because I only use TheMovieDb and FilmAffinity, then in the future, please, change the versions of the main IMDB scripts (IMDB_[EN][HTTPS] and IMDB_People_[EN][HTTPS]) and I will include its in the MOD version same as you publish it.
The alternative scripts can be left in the forum only for interested people.

Tell me if you are agreee and if something is wrong in the patch. Thank you for your hard and good work.
« Last Edit: February 10, 2019, 11:44:50 am by VVV_Easy_Programing »

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2736
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #170 on: February 10, 2019, 06:35:24 pm »
IMDB_People_[EN][HTTPS]

Why is not an added code for alternative names for people?
Why is not an added code for filmography for people?

If the code for both of them is added, IMDB_People_ [EN] [HTTPS] script will download all the information and will be the right and complete replacement for the IMDB People plugin.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2736
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #171 on: February 10, 2019, 06:59:29 pm »
IMDB_ [EN] [HTTPS] script

The alternative scripts can be left in the forum only for interested people.

I agree with this proposal.

Alternatives IMDB_ [EN] [HTTPS] scripts for interested people will be available in the future in a new topic, where they will be all descriptions for them. In this topic, however, any errors and descriptions of possible corrections for them will still be reported.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2736
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #172 on: February 14, 2019, 08:22:33 am »
IMDB_ [EN] [HTTPS] script

Tell me if you are agreee and if something is wrong in the patch. Thank you for your hard and good work.

As soon as I've done some tests quickly, IMDB_ [EN] [HTTPS] script works fine and can be added to the new MOD version.

Notes for Ivek23:
I have tried to include all the fixes and improvements in this patch except the alternative scripts, for example IMDB_[EN][HTTPS]_(Cast&Crew) script.

OK.

I think that you are better positioned to decide the evolution of the script because I only use TheMovieDb and FilmAffinity, then in the future, please, change the versions of the main IMDB scripts (IMDB_[EN][HTTPS] and IMDB_People_[EN][HTTPS]) and I will include its in the MOD version same as you publish it.

I agree. Once the code changes and it will be necessary to fix it in the scripts, I will do it and post it on the forum. If there is a need to change something in scripts for better optimization of the scripts, you will also be welcome with your help.

Tell me if you are agreee and if something is wrong in the patch. Thank you for your hard and good work.

Thank you. I will continue to work as much as I can and it will be in my power.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline VVV_Easy_Programing

  • Older Power User
  • *****
  • Posts: 199
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #173 on: February 14, 2019, 12:15:59 pm »
IMDB_People_[EN][HTTPS]

Why is not an added code for alternative names for people?
Why is not an added code for filmography for people?

If the code for both of them is added, IMDB_People_ [EN] [HTTPS] script will download all the information and will be the right and complete replacement for the IMDB People plugin.


I don't know …. I probably got lost among the different post of modifications. Sorry.
Can you help me by indicating the code to add or pointing to the posts where they are?

Or if the people script with the "+" of the post: http://www.videodb.info/forum_en/index.php/topic,4134.msg20878.html#msg20878
is the last and good versión I can publish in the MOD version adding one GET_FULL_FILMOGRAPHY parameter for the people that doesn't want download this information.

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2736
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #174 on: February 14, 2019, 05:58:42 pm »
IMDB_People_[EN][HTTPS] script

Or if the people script with the "+" of the post: http://www.videodb.info/forum_en/index.php/topic,4134.msg20878.html#msg20878
is the last and good versión I can publish in the MOD version adding one GET_FULL_FILMOGRAPHY parameter for the people that doesn't want download this information.

Yes, this is the latest good version, which works. You can add a GET_FULL_FILMOGRAPHY parameter. It starts at the end of the photo code and the beginning of the Award code.
Does not add with this part of the code:

Quote
(*
   //~Filmography Composer - Soundtrack~
   If Pos('<h2>Filmography</h2>', HTML) > 0 Then Begin
   curPos:=Pos('<h2>Filmography</h2>',HTML);
      If curPos>0 Then Begin
         EndPos:=curPos;
         curPos:=Pos('<h2>Filmography</h2>', HTML);
         curPos:=PosFrom('<a name="soundtrack">Soundtrack</a> ',HTML,curPos);
         curPos:=curPos+Length('<a name="soundtrack">Soundtrack</a> ');
         endPos:=PosFrom('<div id="filmo-head',HTML,curPos);
         if (EndPos < 1) OR (EndPos > PosFrom('</div>    <script>',HTML,curPos)) then
         endPos:=PosFrom('</div>    <script>',HTML,curPos);
         ItemList:=Copy(HTML,curPos,endPos-curPos);
         //LogMessage('           Parse results ('+IntToStr(curPos)+','+IntToStr(endPos)+') complex ItemList:'+ItemList+'||');
         curPos:=Pos('" id="soundtrack-tt',ItemList);
            Year:=TextBetWeen(ItemList,'<span class="year_column">','</span>',false,curPos);
            LogMessage('      Parse Results Year:'+Year+'||');
            If curPos>0 Then Begin
            curPos:=Pos('<b><a href="/title/',ItemList);       
            index:=1;
            While curPos>0 Do Begin
               //MovieURL:=TextBetWeen(ItemList,'<b><a href="/title/','?ref_=nm_flmg_act',false,curPos);
               MovieURL:='http://www.imdb.com/title/'+TextBetWeen(ItemList,'<b><a href="/title/','?ref_=_',false,curPos);
               LogMessage('      Parse Results MovieURL:'+MovieURL+'||');
               Title:=TextBetWeen(ItemList,'>','</a></b>',false,curPos);
               LogMessage('      Parse Results Title:'+Title+'||');            
               AddPersonMovie(Title,'','',Year,MovieURL,ctComposers);
               LogMessage('      Get results Composers:#'+IntToStr(index)+'|'+Title+'|'+MovieURL+'||ctComposers');
               Year:=TextBetWeen(ItemList,'<span class="year_column">','</span>',false,curPos);
               LogMessage('      Parse Results Year:'+Year+'||');            
               curPos:=PosFrom('<b><a href="/title/',ItemList,curPos);   
               index:=index+1;
            End;   
            curPos:=Pos('" id="soundtrack-tt',ItemList);
         End;
      End;
   End;  *)
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline VVV_Easy_Programing

  • Older Power User
  • *****
  • Posts: 199
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #175 on: February 17, 2019, 09:21:28 pm »
Attached temporal Acumulative Scripts Patch date: 2019.02.17 (to copy in PVD folder for overwriting the existing files).

Changelog:
        IMDB_People_[EN][HTTPS]
                 V 1.3.2.0 (17/02/2019) Ivek23: Added saving more infos: Filmography, Alternate Names, etc. Set by default PHOTO-URL-IN-TRANSNAME=False

Notes for Ivek23:
GET_FULL_FILMOGRAPHY parameter is not needed because PVD has it in the 'Set Overwrite Options for the selected plugin'.
I'd tried Alternate Name with Charles Chaplin  https://www.imdb.com/name/nm0000122/ and the script doesn't got it (even looking in the Log window).
If you find the good code, please upload it with next version number 1.3.3.0

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2736
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #176 on: February 22, 2019, 07:54:41 am »
Notes for Ivek23:
GET_FULL_FILMOGRAPHY parameter is not needed because PVD has it in the 'Set Overwrite Options for the selected plugin'.

Exactly, it's true.

Notes for Ivek23:
I'd tried Alternate Name with Charles Chaplin  https://www.imdb.com/name/nm0000122/ and the script doesn't got it (even looking in the Log window).

It worked without a problem with me. I added another part of the new code, which also works properly.
The old part of the code that works with me
Quote
   //~Alternate Names~
   curPos:=Pos('<div id="details-akas" class="see-more inline canwrap">',HTML);
   If curPos>0 Then Begin
      EndPos:=curPos;
      ItemValue1:=HTMLValues2(HTML,'<h4 class="inline">Alternate Names:','</div>','</h4>','</div>','<br>',EndPos);
      //ItemValue1:=HTMLValues(HTML,'Alternate Names:','</div>','</h4>','</div>','<br>',EndPos); //
      //ItemValue1:=TextBetween(HTML,'<h4 class="inline">Alternate Names:</h4>','</div>',True,curPos);
      LogMessage('    *    Parse Results AltNames01:'+ItemValue1+'||');
      ItemValue1:=StringReplace(ItemValue1,' | ','<br>',True,False,True);
      //ItemValue1:=StringReplace(ItemValue1,' | ',#13,True,False,True);   
      //if Pos(', ', ItemValue1) = 1 then Delete(ItemValue1,1,2);
      If ItemValue1 <> '' then AddFieldValueXML('AltNames',ItemValue1);
      LogMessage('      Parse Results AltNames02:'+ItemValue1+'||');
   End;
The new part of the code, which also works with me
Quote
   //~Alternate Names~
   EndPos:=PosFrom('<div id="details-akas" class="see-more inline canwrap">',HTML,EndPos);
   curPos:=PosFrom('<h4 class="inline">Alternate Names:</h4>',HTML,EndPos);
   EndPos:=PosFrom('</div>',HTML,curPos);
   ItemValue:=TextBetween(HTML,'<h4 class="inline">Alternate Names:</h4>','</div>',True,curPos);
   LogMessage('    *    Parse Results AltNames0:'+ItemValue+'||');
   ItemValue:=StringReplace(ItemValue,' | ','<br>',True,False,True);
   //ItemValue:=StringReplace(ItemValue,' | ',',  ',True,False,True);
   //If Pos(', ',ItemValue) = 1 then Delete(ItemValue,1,2);
   If ItemValue <> '' then AddFieldValueXML('AltNames',ItemValue);
   LogMessage('      Parse Results AltNames:'+ItemValue+'||');

Notes for Ivek23:
If you find the good code, please upload it with next version number 1.3.3.0

A new version of IMDB_People_ [EN] [HTTPS] script will be uploaded in a few days, at least I hope it will. I do not have much time to test IMDB_People_ [EN] [HTTPS] script, if everything works fine because I found some code errors for filmography of people.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline VVV_Easy_Programing

  • Older Power User
  • *****
  • Posts: 199
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #177 on: February 23, 2019, 08:18:11 am »
Thank you, Ivek23.
I stay tuned in order to update with it the MOD version.

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2736
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #178 on: March 01, 2019, 08:54:27 pm »
IMDB_People_ [EN] [HTTPS] script
    V 1.3.3.0 (01/03/2019)


Some code corrections:
Quote
Function DownloadPage(URL:AnsiString):String; //BlockOpen
//Returns the URL page text. If error returns empty string
  Var
    i:Integer;
    ScriptPath,WebText:String;
    Begin
.
.
.
         i:=i+1;
         If i=INTERNET_TEST_ITERATIONS Then Begin
            if 2=MessageBox('Too many faulty attempts to internet connection.'+Chr(13)+ 'Retry or Cancel?',SCRIPT_NAME,5) then begin
               LogMessage(Chr(9)+Chr(9)+'Function DownloadPage END with NOT INTERNET connection ===============|');
               Result:='';
               Exit;
            End;
            i:=0;
         End;
.
.
.
    if (Pos('405 Method not allowed',Result)>0) then begin  //Banned IP. WEB_SPECIFIC.
        If BYPASS_SILENT Then ShowMessage('The URL has HTTP method problems (405 Method not allowed).'+Chr(13)+'Go to the provider web in order to in order to'+Chr(13)+'find the good page',SCRIPT_NAME);
        LogMessage(Chr(9)+Chr(9)+'      405 Method not allowed|');
        Result:=''; //Fatal error
    End;
    if (Pos('Too many request',Result)>0) then begin  //Banned IP. WEB_SPECIFIC.
        If BYPASS_SILENT Then ShowMessage('The provider has banned your IP (Too many request).'+Chr(13)+'Go to the provider web and resolve the captcha in order to'+Chr(13)+'demostrate you are not a robot',SCRIPT_NAME);
        LogMessage(Chr(9)+Chr(9)+'      Banned IP|');
        Result:=''; //Fatal error
    End;
    LogMessage(Chr(9)+Chr(9)+'Function DownloadPage END======================|');
    exit;
  End; //BlockClose
Function DownloadImage

Lots of fixes of Filmography code and added code for Genres links in the Comment box.
Quote
   //Get ~Genre index URL~
   //http://www.imdb.com/filmosearch?sort=moviemeter&explore=genres&role=nm0000122&ref_=nm_ql_flmg_5
   EndPos:=Pos('class="link" ><span class="ghost">by</span> Genre</a>',HTML);
   If endPos>0 Then Begin
      ItemValue0:='<link url="http://www.imdb.com/filmosearch?sort=moviemeter&explore=genres&role='+PersonID+'&ref_=nm_ql_flmg_5">Genres</link>';
      If ItemValue0 <> '' then ItemList:=ItemList+#13+ItemValue0;
      LogMessage('      Parse Results Genre URL:'+ItemValue0+'||');
   End;

A new code has also been added to download information for genres in the Genres field.

Quote
//Retreive Data Config
  USE_SAVED_PVDCONFIG  = True ;  //Use the Overwrite Options of the script saved in pvdconf.ini for avoid download not used pages. Remember PVD only save in exit.
  GET_FULL_BIO  = True ;  //Download Biography provider page for retreive the info. Otherwise only the info of the principal movie page.
   GET_FULL_GENRES  = True ;  //Download Genres provider page for retreive the info. Otherwise only the info of the principal movie page.
Quote
Function ParsePage_IMDBPeopleGENRES(HTML:String):Cardinal; //BlockOpen
    //Returns:
    //     Result:=prFinished; Script has finished gathering data
    //     Result:=prError; If żany big problem? with exit;
    //Retrieve: ~genres~ Genres from "Genres" IMDB section
  Var
    curPos,endPos:Integer;
    ItemValue:String;
  Begin
    LogMessage('Function ParsePage_IMDBPeopleGENRES BEGIN=====================||');       
    Result:=prFinished;  //It will change to prError if any big problem with exit;
   //http://www.imdb.com/filmosearch?sort=moviemeter&explore=genres&role=nm0000122&ref_=nm_ql_flmg_5
   //Get ~Genres~
   If Pos('<strong>Genres</strong>',HTML)>0 Then Begin
      curPos:=Pos('<strong>Genres</strong>',HTML);
      EndPos:=curPos;
      ItemValue:=HTMLValues2(HTML,'<fieldset data-join="and" name="genres">','</fieldset>','<span class="faceter-facet-text">','</span>',', ',EndPos);            
      AddFieldValueXML('genre',ItemValue);    
      curPos:=EndPos;
      LogMessage('      Get result Genres (from People Genres):'+ItemValue+'||');
   End;   
    LogMessage('Function ParsePage_IMDBMovieGENRES END=====================||');
  End; //BlockClose

Minor correction also Bio Codes.

IMDB_People_ [EN] [HTTPS] script is attached.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline webmasterone

  • Member
  • *
  • Posts: 3
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #179 on: March 06, 2019, 03:25:26 pm »
Hallo
first of all, thanks for this grat job
i discovered it only now
i used pdv in the past, but were passed to "Ant Movie Catalog" when pvd stopped to work corrrectly

i would like to make you 2 question:

1) is there a localized version of PVD in Italian ? if not, is there a way to contribute to create it ?
2) i would like to have the search script work for italian movie (so to add also [IT] language to script, but i don't know what to do.

can you kindly help me ?