English > Support

Personal Video Database 1.0.2.7 MOD

<< < (34/73) > >>

Ivek23:
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   
--- End quote ---


--- 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)

--- End quote ---

Ivek23:
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------------------------------------------------------------------
--- End quote ---

All these changes are included in IMDB_ [EN] [HTTPS] + script, which is attached.

Ivek23:
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.

Ivek23:
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
--- End quote ---

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.
--- End quote ---

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.
--- End quote ---

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.

VVV_Easy_Programing:
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.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version