//SCRIPT INFO================================================================================================== BlockOpen (*Following until 'SCRIPT CONSTANTS...' is documentation. Please see 'USER OPTIONS' in the body of the script. --------------------------------------------- AUTHORS: VVV_Easy Contact Web: http://contactbyweb.com/vvv-easy --------------------------------------------- CHANGE LOG :E V 1.4.2.0 (07/08/2021) Ivek23: Release new final IMDB_[EN][HTTPS] version Ivek23: ParsePage_IMDBMovieBASE = Corrected and fixed to the multiple parts (pieces) of code due to changes source code with IMDB new layout. See the forum post: http://www.videodb.info/forum_en/index.php/topic,4134.msg21434.html#msg21434 V 1.4.1.9.1 (22/07/2021) Ivek23: Test new IMDB_[EN][HTTPS]_RC1 version V 1.4.1.9 (19/07/2021) Ivek23: Test new IMDB_[EN][HTTPS]_RC version V 1.4.1.8 (06/07/2021) Ivek23: Test new IMDB_[EN] [HTTPS] _Test version V 1.4.1.7 (04/07/2021) Ivek23: Test new version V 1.4.1.5 (27/10/2020) Ivek23: ParsePage_IMDBMovieCREDIT (Full Cast and Crew section) = Corrected parts of the code. See the forum post: http://www.videodb.info/forum_en/index.php/topic,4134.msg21196.html#msg21196 V 1.4.1.4 (19/10/2020) Ivek23: ParsePage_IMDBMovieCREDIT (Full Cast and Crew section) = Corrected parts of the code. V 1.4.1.3 (01/05/2020) Ivek23: Added some new custom fields. Made many minor fixes in several pieces of code. See the forum post: http://www.videodb.info/forum_en/index.php/topic,4141.0.html V 1.4.1.2 (10/01/2020) Ivek23: Added "IMDb.com" url links for afrocuban request per forum post: http://www.videodb.info/forum_en/index.php/topic,4154.msg21035.html#msg21035. V 1.4.1.1 (20/06/2019) Ivek23: ParsePage_PLOTKEYWORDS small corrections and fix in the parts of the code 18-19/6/2019 forum alerts. V 1.4.1.0 (10/02/2019) Ivek23: Added ParsePage_PLOTSUMMARY.Ivek23 corrections and improvements since last version (see forum) V 1.4.0.0 (05/01/2019) Ivek23: Added ParsePage_PLOTKEYWORDS.Ivek23 corrections since last version (see forum). V 1.3.1.0 (22/11/2018) Ivek23: ParsePage_IMDBMovieAKA small change in the source code and was missing the name for the country. V 1.3.0.0 (28/10/2018) New parameter USE-SAVED-PVDCONFIG for avoid download page if the Overwrite Options of the Script in the pvdconf.ini are 'Do Nothing'. Remember that PDV only save the pvdconf.ini in exit. V 1.2.0.3 (20/10/2018) Improvement of search stored URL. Better script flow control. Only get FULL_AKA in MediaType='Movie'. More Ivek23 corrections. V 1.2.0.2 (07/10/2018) Managed IMDB url's not finish in BASE-URL-SUF='/' and principal page download errors. V 1.2.0.1 (19/09/2018) Ivek23: Corrected parts of the code 18-19/9/2018 forum alerts. Removed PRESERVE-PVD-DESCRIPTION-SETTING. V 1.2.0.0 (11/09/2018) VVV: PVdBScriptConfig.ini -> Bug corrected "GET-FULL-FEATURES" Ivek23: ParsePage_IMDBMovieCREDIT (Full Cast and Crew section) = Repaired pieces of code for transmitting actors information Ivek23: ParsePage_IMDBSearchTitle = Corrected missing posters in search movies results. Ivek23: ParsePage_IMDBMovieMPAA = Corrected parts of the code. Ivek23: ParsePage = Added compatibility with CustomFields ~IMDbID~, ~Updated~ (last needed because is not possible save in ~moddate~). Ivek23,VVV: ParsePage_IMDBMovieBASE = Corrected to the API evolution. Now get "keywords" in ~tags~ (not in ~category~). Get ~origlang~. Added compatibility with CustomFields ~Bottom 100~, ~Metascore~, ~User Reviews~ New script parameter PRESERVE-PVD-DESCRIPTION-SETTING = Avoid double use of ~description~ and ~comment~ using only the user check fields table selection otherwise try get "Storyline" and "plot_Summary". Ivek23,VVV: ParsePage_IMDBMovieTECHNICAL = Added compatibility with CustomFields ~ImdbTechSpecs~ (original PVD ~features~ can be disabled in the program check fields table) V 1.1.0.0 (08/08/2018) Ivek23,VVV: Movie Technical Specs page retreive in Features field (base page or full). V 1.0.0.2 (06/08/2018) VVV: Set the AddAward( ... Year ...) = EventYear (same in People script) V 1.0.0.1 (01/08/2018) VVV: Change values of CHEAT-PREFIX-URL and DUMMY-HTML-FILE. Little improvements. V 1.0.0.0 (20/05/2018) VVV: Initial public release --------------------------------------------- FIELD USE: The Personal Video DataBase field names in comments are enclosed in "~" so they are easier to find in the script. The WEB_SPECIFIC commentary points out the specific text for Web fields. Use Log PVdB debug Window for looking search errors. Important note: This scripts don't use the GET PVdB function for download page (this allows use HTTPS pages). For do that it use a specific program "PVdBDownPage" AutoHotKey script. You can get it from the authors page: http://vvveasy.altervista.org/personal-video-database/ NEEDED EXTERNAL FILES IN SCRIPTS FOLDER: • %Path%\PVdBDownPage.exe FOOTNOTES: 1.Control the use of standard fields using the "Overwrite Fields" plugin preferences in the main program PVD: Preferences > Plugins > 'Script Name' > Overwrite fields to control how these items are to be updated. 2.Hits for adapt the Script. 2.1. Search WEB_SPECIFIC comentary for adapt the specific Web text of fields. 2.2. Script execution: 0) Get results of "Obligatory callback Functions" 1) GetDownloadURL (Obligatory callback Functions) = This function should return URL that should be downloaded byd by the main application and then passed to the script’s ParsePage function as text. It may have several modes selon the Script mode (Global Var Mode = smSearch, smNormal, smFinished). 2) ParsePage (Obligatory callback Functions) = This function receives the text of the download web page passeded to the main application in the GetDownloadURL function. It has several modes selon the Script mode (Global Var Mode = smSearch, smNormal, smFinished). KNOWN ISSUES: 1. For compiling cuestions functions must be defined in the script before use (not in order of execution). 2. For the search texts for locating the fields in Web page Null '' value it's not valid. You must replaces all escaped HTML characters (like <>&") with normal characters (like <, >,$, "). 3. If desired, you needs Custom Fields ~IMDB_Votes~,~TOP_250~ for storing the number of votes and TOP250 IMDB list. 4. If not or bad MPAA USA then get Spain certification (if exist) and convert in USA-KODI values. If even this fails try to get of the "user" folders name. s try to get of the "user" folders name. 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 SCRIPT STRUCTURE: 1.Script data and user options constants 2.Some useful generic constants 3.Global variables 4.Obligatory PVD callback Functions GetScriptVersion, GetScriptName, GetScriptDesc, GetBaseURL, GetScriptLang, GetScriptType, GetCurrentMode, GetDownloadURL. (Note: ParsePage is at the end of the file for compiling cuestions). 5.Optional PVD callback Functions GetRatingName ,GetCodePage, GetDownloadMethod, GetPrefixMode; 6.User Functions an procedures (with their constans) 7.Obligatory PVD callback function ParsePage (at the end of the file for compiling cuestions) *) //SCRIPT INFO================================================================================================== BlockClose //SCRIPT CONSTANTS============================================================================================= BlockOpen Const //Script types----------------------------------------------------------------------------------------------------------- stMovies = 0; stPeople = 1; stPoster = 2; stScreenShots = 3; stCover = 4; //Script Obligatory Infos---------------------------------------------------------------------------------------------- SCRIPT_NAME = 'IMDB [EN][HTTPS]'; //The most complete information provider SCRIPT_DESC = 'IMDB download Movie info [EN]'; SCRIPT_VERSION = '1.4.2.0'; SCRIPT_TYPE = stMovies; SCRIPT_LANG = $09; //English //$0a es-Spanish $0c fr-French $09 en-English RATING_NAME = 'IMDB'; //PVD has ~imdbrating~ for this value CODE_PAGE = 65001; //28591=ISO 8859-1 Latin 1; Western European (ISO). Use: 65001=Unicode (UTF-8) | 0=for Autodetect Autodetect //Script Options------------------------------------------------------------------------------------------------------- //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_MPAA = True ; //Download Certification provider page for retreive the MPAA info. Otherwise only the info of the principal movie page. GET_FULL_AKA = True ; //Download 'Also Known As' provider page for retreive the info. Otherwise only the info of the principal movie page. GET_FULL_CREDIT = True ; //Download Cast or Credit provider page for retreive the info. Otherwise only the info of the principal movie page. PEOPLE_LIMIT = 25; //Limit of number of actors (cast) or of credits (crew) retrieved. GET_FULL_AWARDS = True ; //Download Awards provider page for retreive the info. Otherwise doesn't do nothingh because no info in the principal movie page. EVENTS_LIMIT = 100; //Limit of number of events (USA Academy Awards, Golden Globes, etc) to retrive awards. GET_FULL_FEATURES = True ; //Download Technical Specs for retreive the original movie features (Runtime, Sound Mix, Color, Aspect Ratio, etc). GET_FULL_PLOTKEYWORDS = True ; //Download Plot Keywords provider page for retreive the Plot Keywords info. Otherwise only the info of the principal movie page PLOTKEYWORDS_LIMIT = 100; //Limit of number of tags retrieved only when download Plot Keywords provider page. GET_FULL_PLOTSUMMARY = True ; //Download Plot provider page for retreive the Summaries info. Otherwise only the info of the principal movie page // GET_FULL_PLOT_SUMMARY = True ; //Set to False to not wanted to Download full synopsis for Plot provider page for retreive the Synopsis info in Comment box. GET_FULL_PLOT_SUMMARY = False ; //Set to True if to wanted to Download full synopsis for Plot provider page for retreive the Synopsis info in Comment box. // MAX_IMAGE_HEIGTH = 1200; //Heigth limit of the stored posters. MAX_IMAGE_HEIGTH = 500; //Heigth limit of the stored posters. //Process Data Config PRESERVE_PVD_DESCRIPTION_SETTING = True ; //Avoid double use of ~description~ and ~comment~ using only the user check fields table selection otherwise try get "plot_summary" //Process Behaviour Config BYPASS_SILENT = True ; //Ensure critical ShowMessage alerts bypassing Silent PVdB preferences CHECK_WEBSITE = False ; //Add to SearchResult List the true HTTPS links 'Just to check the website' with the browser POSTER_IN_SEARCH = True ;//Download and show movie posters in the list of the SearchResult SEARCH_ENGINE = True ; //If there isn't provider search results, try with Bing search engine INTERNET_TEST_ITERATIONS = 6; //Attempts before to alert user that not internet connection detected. Increase if the provider has low speed. //Script data------------------------------------------------------------------------------------------------------------ //Used Web URL BASE_URL_PRE = 'http://www.imdb.com/title/'; //The traditional BASE_URL_PREFIX used to get movie ID if the movie is stored for instance 'http://www.imdb.com/title/ tt0068646/'. BASE_URL_PRE_TRUE = 'https://www.imdb.com/title/'; //True actual link to movie ID 'httpS://www.imdb.com/title/ tt0068646/' BASE_URL_PERSON_PRE = 'http://www.imdb.com/name/'; //The traditional BASE_UR to person ID 'httpS://www.imdb.com/name/ nm0094036/' BASE_URL_PERSON_PRE_TRUE = 'https://www.imdb.com/name/'; //True actual link to person ID 'httpS://www.imdb.com/name/ nm0094036/' BASE_URL_SUF = '/'; //Suffix in the link after MovieID o PersonID 'http://www.imdb.com/title/ tt0068646 /' BASE_URL_IMAGE_PRE = 'http://ia.media-imdb.com/images/M/'; //IMDB posters format: Full image: 'https://ia.media-imdb.com/images/M/MV5BMTI2MjI4NTgyNF5BMl5BanBnXkFtZTcwOTM5NzQ5MQ@@.jpg. BASE_URL_IMAGE_PRE_TRUE = 'https://m.media-amazon.com/images/M/'; //Resized image: 'https://ia.media-imdb.com/images/M/MV5BMTI2MjI4NTgyNF5BMl5BanBnXkFtZTcwOTM5NzQ5MQ@@._V1_UY50_CR0,0,34,50_AL_.jpg // where the two last number are width and heigth BASE_URL_MPAA ='http://www.imdb.com/title/%IMDB_ID/parentalguide?ref_=tt_stry_pg#certification'; //Certification provider page. WEB_SPECIFIC. // BASE_URL_AKA ='https://www.imdb.com/title/%IMDB_ID/releaseinfo?ref_=tt_dt_dt#akas'; //Also Known As provider page. WEB_SPECIFIC. BASE_URL_AKA ='https://www.imdb.com/title/%IMDB_ID/releaseinfo?ref_=tt_dt_aka#akas'; //Also Known As provider page. WEB_SPECIFIC. BASE_URL_CAST ='https://www.imdb.com/title/%IMDB_ID/fullcredits?ref_=tt_cl_sm#cast'; //Cast provider page. WEB_SPECIFIC. BASE_URL_AWARDS='https://www.imdb.com/title/%IMDB_ID/awards?ref_=tt_awd'; //Awards provider page. WEB_SPECIFIC. BASE_URL_TECH='https://www.imdb.com/title/%IMDB_ID/technical?ref_=tt_spec'; //Technical Specifications provider page. WEB_SPECIFIC. BASE_URL_CONNECTIONS='https://www.imdb.com/title/%IMDB_ID/movieconnections/?tab=mc&ref_=tt_trv_cnn'; //Connections provider page. WEB_SPECIFIC. //BASE_URL_CONNECTIONS='https://www.imdb.com/title/%IMDB_ID/movieconnections?ref_=tt_trv_cnn'; //Connections provider page. WEB_SPECIFIC. BASE_URL_PLOTKEYWORDS='https://www.imdb.com/title/%IMDB_ID/keywords?ref_=tt_stry_kw'; //Plot KeyWords provider page. WEB_SPECIFIC. BASE_URL_PLOTSUMMARY='https://www.imdb.com/title/%IMDB_ID/plotsummary?ref_=tt_stry_pl'; //Plot provider page. WEB_SPECIFIC. //plotsummary?ref_=tt_ql_stry_2 BASE_URL_SEARCH_PROV ='https://www.imdb.com/search/title?title=%s&title_type=feature&release_date=%y,%y&view=simple'; //Search string for '%s' title and '%y' year. WEB_SPECIFIC //BASE_URL_SEARCH_PROV = 'https://www.imdb.com/search/title?title=%s&title_type=feature&release_date=%y,%y&countries=%C2%B7%C2%B7%C2%B7%C2%A0Common+Countries%C2%A0%C2%B7%C2%B7%C2%B7&languages=%C2%B7%C2%B7%C2%B7%C2%A0Common+Languages%C2%A0%C2%B7%C2%B7%C2%B7&view=simple' //Not used because not improvement results. WEB_SPECIFIC //BASE_URL_SEARCH_PROV = 'http://www.imdb.com/find?q=%s&s=tt&view=simple'; //Ivek23 proposition BASE_URL_PERSON_SEARCH_PROV ='https://www.imdb.com/search/name?name=%s&sort=starmeter+desc&ref_=rlm'; //Search string for '%s' name. WEB_SPECIFIC MAX_SEARCHLIST_HEIGTH = 200; //Heigth limit of the search list posters. BASE_URL_SEARCH_ENGI = 'http://www.bing.com/Search?q=%s%20+(%y)+site%3A%p'; // Search string: '%s' title , '%y' year and '%p' web information provider. //Download HTTPS needed parameters BASE_URL_ROUNDABOUT = 'ROUNDABOUT'; //Used for cheat GET PVdB funtion and rondabout the "https" fail. BASE_DOWNLOAD_FILE_NO_BOM = 'Tmp\downpage-UTF8_NO_BOM.htm'; //File to store curl page download in UTF8 without BOM and then it's not necesary use GET PVdB funtion to download. BASE_DOWNLOAD_FILE_IMAGE_NAME = 'Tmp\downimage-BIN'; //File to store curl image download in binary and then it's not necesary use GET PVdB funtion to download. CHEAT_PREFIX_URL = 'http://httpbin.org/response-headers?key='; //Working http URL used for cheat GET PVdB funtion when it returns for SearchList choice. DUMMY_HTML_FILE = 'portable.bat'; //Any existing PVdV file (little) not used. If adapted, it may external file 'C:\Windows\notepad.exe' //Script movie modes.---------------------------------------------------------------------------------------------------- smSearch = 0; //Entry mode and search list mode (AddSearchResult) smNormal = 1; //This scripts download with external program (not with GetDownloadURL) so it only make one pass to ParsePage for retrieve all info, credits, poster, etc. other field modes aren't necesary. //Movie PVdB fields in http://www.videodb.info/help/hlp_scripting.html#fields: //Certification (AddValueField): ~mpaa~ //Credits (AddMoviePerson): ~Directors~,~Writers~,~Composers~,~Photographers~,~Actors~,~Producer~.Same that smCast.hat smCast. //Votes (AddValueField): ~rating~,~imdbrating~,~orname~,~orating~ and related custom PVdB fields ~IMDB_Votes~,~TOP_250~,~FilmAffinity_Votes~. //Poster (AddValueImageURL): ~poster~,~screenshots~,~froncover~,~cdcover~ //Review (AddValueField): ~comment~,~tags~ //Awards (AddAwards). smSearchList = 8; //Used in ParsePage for demands download the https link returned by user in the window of (AddSearchResult)SearchResult) smFinished = 9; //For set script finish. //Parse results (return of Script)--------------------------------------------------------------------------------------- prError = 0; //An error acquired while processing data prFinished = 1; //Script has finished gathering data prList = 2; //A list of search results is available. Use with (AddSearchResult) prListImage = 3; //A list of image search results is available. Use with? prDownload = 4; //Another URL needs to be downloaded //Download methods------------------------------------------------------------------------------------------------------- dmGET = 0; dmPOST = 1; //Credits types---------------------------------------------------------------------------------------------------------- ctActors = 0; ctDirectors = 1; ctWriters = 2; ctComposers = 3; ctProducers = 4; //Image types------------------------------------------------------------------------------------------------------------ itPoster = 0; itScreenShot = 1; itFrontCover = 2; itDiscImage = 3; itPhoto = 4; //Field Overwrite Options position in pvdconf.ini------------------------------------------------------------------------ //0=Do nothing,1=Set if Empty,2=Overwrite. The Length of 'IMDB_[EN][HTTPS].psf=' is 21. opPoster = 87-21; opAKA = 24-21; opDirector = 76-21; opProducer = 79-21; opWriter = 77-21; opComposer = 78-21; opActors = 75-21; opMPAA = 27-21; opAwards = 85-21; opFeatures = 55-21; opConnections = 84-21; opEpisodes = 92-21; //SCRIPT CONSTANTS============================================================================================= BlockClose //SCRIPT GLOBAL VARIABLES=======================================================================================BlockOpen Var Mode:Byte; DownloadURL:String; StoredURL:String; MediaType:String; //'Movie''TVEpisode' PVDConfigOptions:String; //SCRIPT GLOBAL VARIABLES=======================================================================================BlockClose //OBLIGATORY CALLBACK FUNCTIONS=================================================================================BlockOpen Function GetScriptVersion:String; //BlockOpen Begin Result:=SCRIPT_VERSION; End; //BlockClose Function GetScriptName:String; //BlockOpen Begin Result:=SCRIPT_NAME; End; //BlockClose Function GetScriptDesc:String; //BlockOpen Begin Result:=SCRIPT_DESC; End; //BlockClose Function GetBaseURL:AnsiString; //BlockOpen Begin Result := BASE_URL_ROUNDABOUT; //Used for cheat GET PVdB funtion and rondabout the "https" fail. End; //BlockClose Function GetScriptLang:Cardinal; //BlockOpen Begin Result:=SCRIPT_LANG; End; //BlockClose Function GetScriptType:Byte; //BlockOpen Begin Result:=SCRIPT_TYPE; End; //BlockClose Function GetCurrentMode:Byte; //BlockOpen Begin Result:=Mode; End; //BlockClose Function GetDownloadURL:AnsiString; //BlockOpen Var curPos:Integer; ScriptPath,MovieID:String; Begin LogMessage('Function GetDownloadURL BEGIN======================|'); LogMessage('Global Var-Mode|'+IntToStr(Mode)+'|'); LogMessage('Global Var-DownloadURL|'+DownloadURL+'|'); //Comprobation of needed external files. ScriptPath:=GetAppPath+'Scripts\'; If Not(FileExists(ScriptPath+'PVdBDownPage.exe')) Then Begin ShowMessage ('This script needs the external file for work.'+Chr(13)+'• PVdBDownPage.exe'+Chr(13)+'Read script text for futher information',SCRIPT_NAME); Mode:=smFinished; Result:=''; //If error returns empty string exit; End; If (Mode=smSearch) Then Begin //Get stored URL if exist. StoredURL:=GetFieldValueXML('url'); LogMessage('Stored URL is:'+StoredURL+'||'); //Standarize the URL StoredURL:=LowerCase(StoredURL); StoredURL:=StringReplace(StoredURL,'https','http',True,True,False); StoredURL:=StringReplace(StoredURL,' ',BASE_URL_SUF,True,True,False)+BASE_URL_SUF; //Asure that the URLs always finish BASE_URL_SUF (even in the last position //Get IMDB ID if exist. curPos:=Pos(BASE_URL_PRE,StoredURL); If 0Go to function ParsePage for parse the film information Result:=GetAppPath+DUMMY_HTML_FILE; //Any existing little file for cheating PVdB automatic download (little).). LogMessage('Function GetDownloadURL END====================== with Mode='+IntToStr(Mode)+' Result='+Result+'|'); exit; End Else Begin //The movie URL not exist, search mode needed. Download the search page. //ShowMessage('No IMDB URL.',SCRIPT_NAME); LogMessage(' No IMDB URL.'); Mode:=smSearch; //->Go to function ParsePage for search the URL (in this funtion you can't not use user funtions)ntions) DownloadURL:=''; //Has not movie URL. Result:=GetAppPath+DUMMY_HTML_FILE; //Any existing little file for cheating PVdB automatic download (little).). LogMessage('Function GetDownloadURL END====================== with Mode='+IntToStr(Mode)+' Result='+Result+'|'); exit; //Go to the End; End; //Not other modes working needs in this function. //smNormal = 1; //This scripts download with external program (not with GetDownloadURL) so it only make one pass to ParsePage for retrieve all info, credits, poster, etc. other field modes aren't necesarye pass to ParsePage for retrieve all info, credits, poster, etc. other field modes aren't necesary //smSearchList = 8; //Used in ParsePage for demands download the https link returned by user in the window of (AddSearchResult)(AddSearchResult) Result:=GetAppPath+DUMMY_HTML_FILE; //Any existing little file for cheating PVdB automatic download (little). LogMessage('Function GetDownloadURL END====================== with Mode='+IntToStr(Mode)+' Result='+Result+'|'); exit; End; //BlockClose Function GetRatingName:String; //BlockOpen Begin Result:=RATING_NAME; End;//BlockClose Function GetCodePage:Cardinal; //BlockOpen Begin Result:=CODE_PAGE; End; //BlockClose //OBLIGATORY CALLBACK FUNCTIONS=================================================================================BlockClose //USER FUNCTIONS AND PROCEDURES=================================================================================BlockOpen Function DownloadPage(URL:AnsiString):String; //BlockOpen //Returns the URL page text. If error returns empty string Var i:Integer; ScriptPath,WebText:String; Begin LogMessage(Chr(9)+Chr(9)+'Function DownloadPage BEGIN======================|'); LogMessage(Chr(9)+Chr(9)+'Global Var-DownloadURL|'+DownloadURL+'|'); LogMessage(Chr(9)+Chr(9)+' Local Var-URL|'+URL+'|'); ScriptPath:=GetAppPath+'Scripts\'; //LogMessage(Chr(9)+Chr(9)+' Local Var-ScriptPath|'+ScriptPath+'|'); //Delete the ancient dowloaded page file. Needed for wait to curl download included in PowerShell command. While FileExists(ScriptPath+BASE_DOWNLOAD_FILE_NO_BOM) Do Begin FileExecute('cmd.exe', '/C del "'+ScriptPath+BASE_DOWNLOAD_FILE_NO_BOM+'"'); LogMessage(Chr(9)+Chr(9)+' Waiting 1s for delete:'+ScriptPath+BASE_DOWNLOAD_FILE_NO_BOM); wait (1000); End; //Download the URL page. LogMessage(Chr(9)+Chr(9)+' Download with PVdBDownPage in file:|'+ScriptPath+BASE_DOWNLOAD_FILE_NO_BOM+' the information of:|'+URL+'||'); FileExecute(ScriptPath+'PVdBDownPage.exe', '"'+URL+'" "'+ScriptPath+BASE_DOWNLOAD_FILE_NO_BOM+'"'); //Wait download finish and exist the downloaded page. i:=0; // INTERNET_TEST_ITERATIONS While Not(FileExists(ScriptPath+BASE_DOWNLOAD_FILE_NO_BOM)) Do Begin LogMessage(Chr(9)+Chr(9)+' Waiting 2s for exists of:'+ScriptPath+BASE_DOWNLOAD_FILE_NO_BOM); wait (2000); 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; End; LogMessage(Chr(9)+Chr(9)+' Now present complete page file: '+ScriptPath+BASE_DOWNLOAD_FILE_NO_BOM); WebText:=FileToString(ScriptPath+BASE_DOWNLOAD_FILE_NO_BOM); WebText:=ConvertEncoding(WebText, 65001); //65001 utf-8 Unicode (UTF-8) ---> https://msdn.microsoft.com/en-us/library/dd317756(VS.85).aspxbrary/dd317756(VS.85).aspx //LogMessage(Chr(9)+Chr(9)+' Local Var-WebText|'+WebText+'|'); //Debug statement Result:=WebText; //Some download data comprobations. if (Pos('404 Not Found',Result)>0) then begin //Banned IP. WEB_SPECIFIC. If BYPASS_SILENT Then ShowMessage('The URL is not in use (404 Not Found).'+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)+' 404 Not Found|'); Result:=''; //Fatal error End; if (Pos('404 Error - IMDb',Result)>0) then begin //Banned IP. WEB_SPECIFIC. If BYPASS_SILENT Then ShowMessage('The URL is not in use (404 Error - IMDb).'+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)+' 404 Error - IMDb|'); Result:=''; //Fatal error End; if (Pos('Page not found',Result)>0) then begin //Banned IP. WEB_SPECIFIC. If BYPASS_SILENT Then ShowMessage('The URL is not in use (Page not found).'+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)+' Page not found|'); Result:=''; //Fatal error 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(URL:AnsiString;OutPutFile:AnsiString):Integer; //BlockOpen //Returns 1 or 0 if the downloaded image file exists in Exit. Var i:Integer; ScriptPath:String; Begin LogMessage(Chr(9)+Chr(9)+'Function DownloadImage BEGIN======================|'); LogMessage(Chr(9)+Chr(9)+'Global Var-DownloadURL|'+DownloadURL+'|'); LogMessage(Chr(9)+Chr(9)+' Local Var-URL|'+URL+'|'); LogMessage(Chr(9)+Chr(9)+' Local Var-OutPutFile|'+OutPutFile+'|'); ScriptPath:=GetAppPath+'Scripts\'; //Delete the ancient dowloaded page file. Needed for wait to curl download included in PowerShell command. While FileExists(OutPutFile) Do Begin FileExecute('cmd.exe', '/C del "'+OutPutFile+'"'); LogMessage(Chr(9)+Chr(9)+' Waiting 1s for delete:'+OutPutFile); wait (1000); End; //Download the URL page. LogMessage(Chr(9)+Chr(9)+' Download with PVdBDownPage in file:|'+OutPutFile+' the information of:|'+URL+'||'); FileExecute(ScriptPath+'PVdBDownPage.exe', '"'+URL+'" "'+OutPutFile+'"'); //Wait download finish and exist the downloaded page. i:=0; // INTERNET_TEST_ITERATIONS While Not(FileExists(OutPutFile)) Do Begin LogMessage(Chr(9)+Chr(9)+' Waiting 2s for exists of:'+OutPutFile); wait (2000); i:=i+1; If i=INTERNET_TEST_ITERATIONS Then Begin //In the images download the scritp can not ask to the user for internet conexion because perhaps the file doesn't exist. LogMessage(Chr(9)+Chr(9)+'Function DownloadImage END with NOT file downloaded ===============|'); Result:=0; exit; End; End; LogMessage(Chr(9)+Chr(9)+' Now present complete page file: '+OutPutFile); Result:=1; LogMessage(Chr(9)+Chr(9)+'Function DownloadImage END======================|'); exit; End; //BlockClose Function TextBetWeenFirst(_HTML:string;_ABegin,_AEnd:String):String; //BlockOpen //Returns the first extract part of a given _HTML between _Abegin and _AEnd and removes all tags from the result substring. //In order to avoid set the Pos variable in TextBetween Var _Pos:Integer; Begin _Pos:=0; Result:=TextBetWeen(_HTML,_ABegin,_AEnd,false,_Pos); Exit; End; //BlockClose Function RemoveTagsEx(AText:String):String; //BlockOpen //Ivek23 function for get faster the PLOTKEYWORDS script Var B,E:Integer; Begin Result:=AText; B:=PosFrom('
',Result); End; End; //BlockClose Function HTMLValue(HTML:string;StartPos,EndPos:Integer;StartValue,EndValue:string):String; //BlockOpen Var ValueStart,ValueEnd:Integer; Begin ValueStart:=PosFrom(StartValue,HTML,StartPos); if (ValueStart>0) and ((ValueStart Finish) If ((Pos(BASE_URL_PRE, HTML)>0) Or (Pos(BASE_URL_PRE_TRUE, HTML)>0)) Then Begin //Not movie URL found. WEB_SPECIFIC LogMessage(' BASE_URL_PRE results detectes.'); ItemList:=TextBetWeenFirst(HTML,'
    '); //String which opens-closes thesearch List results. WEB_SPECIFIC curPos:=PosFrom('
  1. ',ItemList,curPos); //String which opens the Web result Movie info (Poster and details text). WEB_SPECIFIC While (0','',false,curPos); //String which opens-closes the Web result Movie link. WEB_SPECIFIC //LogMessage(' Parse Results ItemValue:'+ ItemValue+'||'); endPos:=LastPos('(', ItemValue); //Not use curPos for not loosing text position when searching in ItemValue If (0',ItemList,curPos); //String which opens the Web result HTML file data. WEB_SPECIFIC End; AddSearchResult('','','','',''); AddSearchResult(' -- Bing Search -- ','','','',''); Result:=prList; //Don't work with Preferences/Plugings/Silent Mode. LogMessage(' After parsing Bing search Movies go to choose List Results'); LogMessage('Function ParsePage_BingSearch END=====================||'); Exit; End Else Begin if BYPASS_SILENT then ShowMessage('Not results even with Bing search engine.'+Chr(13)+'Try again or make an advanced search out of the script.'+Chr(13)+'Write the movie URL (http) in the PVdB manually (remember separated by spaces) and run again.',SCRIPT_NAME); Result:=prError; LogMessage(' Not results|'); LogMessage('Function ParsePage_BingSearch END=====================||'); Exit; End; End; //BlockClose Function ParsePage_IMDBSearchTitle(HTML:String):Cardinal; //BlockOpen //Returns: // Result:=prDownload; (Global var DownloadURL=IMDB page) if there is one results. // Result:=prList; if there are several results. (Don't work with Preferences/Plugings/Silent Mode). // Result:=prError; If not results Var curPos,ResultsNumber:Integer; ItemValue,ImageFile:String; Title,Year,MovieURL,PreviewURL:String; Begin LogMessage('Function ParsePage_IMDBSearchTitle BEGIN======================|'); LogMessage('Global Var-Mode|'+IntToStr(Mode)+'|'); LogMessage('Global Var-DownloadURL|'+DownloadURL+'|'); If (Pos('No results',HTML)<>0) Then Begin //WEB_SPECIFIC LogMessage(' No Movies results'); Result:=prError; End Else Begin LogMessage(' Parsing search Movies results'); curPos:=Pos('
    ',HTML); //String which opens the Web Search List data. WEB_SPECIFIC //Get first item ResultsNumber:=0; curPos:=PosFrom('
    ',HTML,curPos); //String which opens the Web Result List data. WEB_SPECIFIC While curPos>0 Do Begin ResultsNumber:=ResultsNumber+1; LogMessage(' Parsing search movie results in '+IntToStr(curPos)+' ...'); curPos:=PosFrom('
    ',HTML,curPos); //String which opens the Web URL+Title+URL+PreviewURL data. WEB_SPECIFIC //Get PreviewURL If POSTER_IN_SEARCH Then begin ItemValue:=TextBetWeen(HTML,'loadlate="','"',false,curPos); //Strings which opens/closes the data. WEB_SPECIFIC If (Pos('https://m.media-amazon.com/images/G/01/imdb/images/',ItemValue)>0) Then Begin PreviewURL:=TextBetWeenFirst(ItemValue,'https://m.media-amazon.com/images/G/01/imdb/images/','.'); //Get poster code. Strings which opens/closes the data. WEB_SPECIFIC If (Length(PreviewURL)>0) then begin PreviewURL:='https://m.media-amazon.com/images/G/01/imdb/images/' + PreviewURL //Base poster URL without '.jpg'. WEB_SPECIFIC ImageFile:=GetAppPath+'Scripts\'+BASE_DOWNLOAD_FILE_IMAGE_NAME+'-SearchResult-'+IntToStr(ResultsNumber)+'-.jpg' // Avoid HTTPS redirection: Download https image to file OutPutFile= If (1=DownloadImage(PreviewURL + '._V1_UY' + IntToStr(MAX_SEARCHLIST_HEIGTH) + '_.jpg',ImageFile)) then begin //Dowload in the selected user max size. WEB_SPECIFIC LogMessage(' Parse Results PreviewURL:'+PreviewURL + '._V1_UY' + IntToStr(MAX_SEARCHLIST_HEIGTH) + '_.jpg'+'||'); PreviewURL:=ImageFile; //Pass the downloaded file to PVD end else if (1=DownloadImage(PreviewURL +'.jpg',ImageFile)) then begin //Dowload in the web base size. WEB_SPECIFIC LogMessage(' Parse Results PreviewURL:' + PreviewURL + '.jpg'+'||'); PreviewURL:=ImageFile; //Pass the downloaded file to PVD end; end; end; If (Pos(BASE_URL_IMAGE_PRE_TRUE,ItemValue)>0) Then Begin PreviewURL:=TextBetWeenFirst(ItemValue,BASE_URL_IMAGE_PRE_TRUE,'.'); //Get poster code. Strings which opens/closes the data. WEB_SPECIFIC If (Length(PreviewURL)>0) then begin PreviewURL:=BASE_URL_IMAGE_PRE_TRUE + PreviewURL //Base poster URL without '.jpg'. WEB_SPECIFIC ImageFile:=GetAppPath+'Scripts\'+BASE_DOWNLOAD_FILE_IMAGE_NAME+'-SearchResult-'+IntToStr(ResultsNumber)+'-.jpg' // Avoid HTTPS redirection: Download https image to file OutPutFile= If (1=DownloadImage(PreviewURL + '._V1_UY' + IntToStr(MAX_SEARCHLIST_HEIGTH) + '_.jpg',ImageFile)) then begin //Dowload in the selected user max size. WEB_SPECIFIC LogMessage(' Parse Results PreviewURL:'+PreviewURL + '._V1_UY' + IntToStr(MAX_SEARCHLIST_HEIGTH) + '_.jpg'+'||'); PreviewURL:=ImageFile; //Pass the downloaded file to PVD end else if (1=DownloadImage(PreviewURL +'.jpg',ImageFile)) then begin //Dowload in the web base size. WEB_SPECIFIC LogMessage(' Parse Results PreviewURL:' + PreviewURL + '.jpg'+'||'); PreviewURL:=ImageFile; //Pass the downloaded file to PVD end; end; end; end; //Get MovieURL (Always must it has) MovieURL:=TextBetWeen(HTML,'','<',false,curPos); //Strings which opens/closes the data. WEB_SPECIFIC LogMessage(' Parse Results Title:'+Title+'||'); //Get Year curPos:=PosFrom('',HTML,curPos); //Strings which opens/closes the data. WEB_SPECIFIC Year:=IntToStr(StrToInt(Copy(HTML,curPos-5,4))); //5=length of "yyyy)" LogMessage(' Parse Results in Year:'+Year+'||'); AddSearchResult(Title,'',Year,MovieURL,PreviewURL); //Just to check the website (Only to check the web page) not PVdB valid result. if CHECK_WEBSITE then AddSearchResult(' '+#8729+' Just to check the website: '+StringReplace(MovieURL,CHEAT_PREFIX_URL,'',True,False,False),'','',StringReplace(MovieURL,CHEAT_PREFIX_URL,'',True,False,False),''); curPos:=PosFrom('
    ',HTML,curPos) //String which opens the Web Result item List data. WEB_SPECIFIC End; If ResultsNumber=1 Then Begin DownloadURL:=StringReplace(MovieURL,CHEAT_PREFIX_URL,'',True,False,False); //Eliminate the CHEAT_PREFIX_URL for get the true movie link DownloadURL:=StringReplace(DownloadURL,'http:','https:',True,True,False); //The direct url needed (no https redirection) Result:=prDownload; //One result in the DownloadURL. LogMessage(' After parsing search Movies, only one result detected'); End Else Begin Result:=prList; //Don't work with Preferences/Plugings/Silent Mode. LogMessage(' After parsing search Movies go to choose List Results'); End; End; LogMessage('Function ParsePage_IMDBSearchTitle END=====================||'); Exit; End; //BlockClose 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; StartPos,Hours,Minutes:Integer; ItemValue1,ItemValue,ItemList,ImageFile:String; //ItemValue0,ImageFiles: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) // (* *) //Get ~MID ID:~ and ~NUM ID::~ AddCustomFieldValueByName('MID ID:',GetFieldValueXML('mid')); LogMessage(' ** Movie MID ID: '+GetFieldValueXML('mid')+' **'); if GetFieldValueXML('num') <> '0' then AddCustomFieldValueByName('NUM ID:',GetFieldValueXML('num')); if GetFieldValueXML('num') <> '0' then LogMessage(' * Movie NUM ID: '+GetFieldValueXML('num')+' ||'); //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,''+'||'); If (Length(ItemList)>0) Then Begin //Get ~title~ titleValue:=TextBetWeenFirst(ItemList,'","name":"','","'); //Strings which opens/closes the data. WEB_SPECIFIC If titleValue = '0' then titleValue:=''; //If titleValue = '' then titleValue:=TextBetWeenFirst(ItemList,'

    ','<'); //Strings which opens/closes the data. WEB_SPECIFIC AddFieldValueXML('title',titleValue); AddCustomFieldValueByName('Title',titleValue); //AddCustomFieldValueByName('Localized title',titleValue); LogMessage(' Get result title:'+titleValue+'||'); //Get ~origtitle~ ItemValue:=TextBetWeenFirst(ItemList,'","name":"','","'); //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); AddCustomFieldValueByName('Origtitle',ItemValue); LogMessage(' Get result origtitle:'+ItemValue+'||'); //Get ~alternatetitle~ ItemValue:=TextBetWeenFirst(ItemList,'","alternateName":"','","'); //Strings which opens/closes the data. WEB_SPECIFIC AddCustomFieldValueByName('Localized title',ItemValue); if ItemValue <> '' then LogMessage(' Get result alternatetitle:'+ItemValue+'||'); ItemValue:=TextBetWeenFirst(ItemList,'","@type":"','","'); //Strings which opens/closes the data. WEB_SPECIFIC MediaType:=StringReplace(ItemValue,'TVSeries','TV Series',True,False,True); MediaType:=StringReplace(ItemValue,'TVEpisode','TV Episode',True,False,True); AddCustomFieldValueByName('IMDB_Movietype',MediaType); if ItemValue <> '' then 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+'||'); //(* ItemValue:=TextBetWeenFirst(ItemList,BASE_URL_IMAGE_PRE_TRUE,'.'); //Get poster code. Strings which opens/closes the data. WEB_SPECIFIC LogMessage(' Get result poster000: '+ItemValue+' ||'); 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 LogMessage(' Get result poster00: '+ItemValue+' ||'); 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: ' + #13 + 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 poster0: ' + #13 + ItemValue + '.jpg'+' ||'); end; End; //*) //ItemValue1:=TextBetWeenFirst(ItemList,'"datePublished": "','-'); ItemValue1:=TextBetWeenFirst(ItemList,',"datePublished":"','-'); //ItemValue1:=TextBetWeenFirst(ItemList,'},"datePublished":"','-'); AddFieldValueXML('year',ItemValue1); if ItemValue1 <> '' then LogMessage(' Get result year01:'+ItemValue1+'||'); //ItemValue:=TextBetWeenFirst(ItemList,'"datePublished": "','",'); //Strings which opens/closes the data. WEB_SPECIFIC 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); AddCustomFieldValueByName('IMDB Votes',ItemValue); 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 ItemValue:=TextBetWeenFirst(ItemList,'"worstRating":1,"ratingValue":','},"'); //Strings which opens/closes the data. WEB_SPECIFIC //ItemValue:=FloatToStr((StrToFloat(ItemValue) * 1)); AddFieldValueXML('imdbrating',ItemValue); AddCustomFieldValueByName('IMDB Rating',ItemValue); AddCustomFieldValueByName('IMDBRating',ItemValue); if ItemValue <> '' then LogMessage(' Get result ratingValue ~imdbrating~ (CF~IMDB Rating~~IMDBRating~): '+ItemValue+' ||'); End; //Get ~TOP_250~ curPos:=Pos('data-testid="award_top-rated">Top rated movie #',HTML); //WEB_SPECIFIC. If 0Top rated movie #','

    ',false,curPos); //Strings which opens/closes the data. WEB_SPECIFIC AddCustomFieldValueByName('TOP_250',ItemValue); LogMessage(' Get result TOP_250:'+ItemValue+'||'); End; //Get ~Bottom 100~ curPos:=Pos('Bottom rated movie #',HTML); //WEB_SPECIFIC. If 0Bottom rated movie #','
    ',false,curPos); //Strings which opens/closes the data. WEB_SPECIFIC AddCustomFieldValueByName('Bottom 100',ItemValue); LogMessage(' Get result Bottom_100 (CF~Bottom 100~):'+ItemValue+'||'); End; //Get ~Metascore~ curPos:=Pos('">',HTML,EndPos)+Length('">'); EndPos:=PosFrom('Metascore
  2. ',HTML,curPos)+2; ItemValue:=RemoveTags(Copy(HTML,curPos,endPos-curPos),false); ItemValue:=StringReplace(ItemValue,'0 '' then AddCustomFieldValueByName('Metascore',FloatToStr((StrToFloat(ItemValue) * 1))); if ItemValue <> '' then LogMessage(' Get result Metascore (CF~Metascore~):'+ItemValue+'||'); End; //Get Cast. GET_FULL_CREDIT = False only the info of the principal movie page. If Not(GET_FULL_CREDIT) Then Begin //Get ~crew~ctDirectors,ctWriters,ctComposers,ctProducers //Go to "Director:" or "Directors:" ~crew~ctDirectors curPos:=Pos('
',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+'||'); //LogMessage(' Parse results ('+IntToStr(curPos)+','+IntToStr(endPos)+') complex ItemList:'+ItemList+'||'); curPos:=Pos('" class="ipc-image" loading="',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) ItemValue:=TextBetWeen(ItemList,'
',false,curPos); //Strings which opens/closes the data. WEB_SPECIFIC Name:=Trim(StringReplace(Name,'>','',True,False,True)); //Get Role YES: PVD save Role in cast (actors) people (Not always has link) Role:=TextBetWeen(ItemList,'',false,curPos); //Strings which opens/closes the data. WEB_SPECIFIC Role:=Trim(StringReplace(Role,'>','',True,False,True)); //Role:=StringReplace(Role,Chr(13),'',True,False,True); //Role:=StringReplace(Role,' ','',True,False,True); AddMoviePerson(Name,'',Role,PersonURL,ctActors); LogMessage(' Get results cast:#'+IntToStr(index)+'|'+Name+'|'+Role+'|'+PersonURL+'||ctActors'); curPos:=PosFrom('" class="ipc-image" loading="',ItemList,curPos); //String which opens the Web Result item List data. WEB_SPECIFIC index:=index+1; End; End; //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('','

',false,curPos); //AddFieldValueXML('comment',ItemValue); LogMessage(' AVOIDED ALWAYS: Get result "Plot_summary" as ~comment~:'+#13+ItemValue+'||'); End; End; //Get "Storyline" as ~description~ curPos:=Pos('

Storyline

',HTML); //WEB_SPECIFIC. If 0Storyline','
',false,curPos); //Strings which opens/closes the data. WEB_SPECIFIC ItemValue:=StringReplace(ItemValue, 'Edit', '', true, false, true); //Cleaning. WEB_SPECIFIC. ItemValue:=StringReplace(ItemValue, 'Industry information at your fingertips', '', true, false, true); //Cleaning. WEB_SPECIFIC. ItemValue:=StringReplace(ItemValue, 'Some parts of this page won'+#39+'t work property. Please reload or try later.', '', true, false, true); //Cleaning. WEB_SPECIFIC. curPos:=Pos('—',ItemValue); //WEB_SPECIFIC. If 0