//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 : V 1.0.0.0 (20/06/2020) Ivek23: 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. 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 = 'ĘčíîĎîčńę[HTTPS]'; //The most complete information provider SCRIPT_DESC = 'ĘčíîĎîčńę.Ru download Movie info [RU]'; SCRIPT_VERSION = '1.1.0.0'; SCRIPT_TYPE = stMovies; SCRIPT_LANG = $19; //Russian //$0a es-Spanish $0c fr-French $09 en-English $19 ru-Russian RATING_NAME = 'ĘčíîĎîčńę.Ru'; //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 1251=ANSI Cyrillic; Cyrillic (Windows) //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. 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. MAX_IMAGE_HEIGTH = 1200; //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 CHECK_WEBSITE = True ; //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.kinopoisk.ru/'; //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.kinopoisk.ru/'; //True actual link to movie ID 'httpS://www.imdb.com/title/ tt0068646/' BASE_URL_PERSON_PRE = 'http://www.kinopoisk.ru/name/'; //The traditional BASE_UR to person ID 'httpS://www.imdb.com/name/ nm0094036/' BASE_URL_PERSON_PRE_TRUE = 'https://www.kinopoisk.ru/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'; //IMDB posters format: Full image: 'https://ia.media-imdb.com/images/M/MV5BMTI2MjI4NTgyNF5BMl5BanBnXkFtZTcwOTM5NzQ5MQ@@.jpg. BASE_URL_IMAGE_PRE_TRUE = 'https'; //Resized image: 'https://ia.media-imdb.com/images/M/MV5BMTI2MjI4NTgyNF5BMl5BanBnXkFtZTcwOTM5NzQ5MQ@@._V1_UY50_CR0,0,34,50_AL_.jpg https://st.kp.yandex.net/images/ // where the two last number are width andheigth //Cast provider page. WEB_SPECIFIC. BASE_URL_AWARDS='https://www.kinopoisk.ru/film/%KINOPOISK_ID/awards/'; //Awards provider page. WEB_SPECIFIC. BASE_URL_SEARCH_PROV ='https://www.kinopoisk.ru/index.php?level=7&from=forma&result=adv&m_act%5Bfrom%5D=forma&m_act%5Bwhat%5D=content&m_act%5Bfind%5D=%s'; //Search string for '%s' title and '%y' year. WEB_SPECIFIC 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 = 52; //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://www.jsontest.com/'+' '; //Working http URL used for cheat GET PVdB funtion when it returns for SearchList choice. 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; //Movie Fields to Receive types---------------------------------------------------------------------------------------------------------- gfID = 1; gfTitle = 2; gfOrigTitle = 3; gfAka = 4; gfYear = 5; gfMPAA = 6; gfURL = 8; gfIMDBRating = 9; gfORating = 11; gfScriptName = 12; // gfRatingName gfTagLine = 14; gfDescription = 15; gfDateAdded = 17; gfResolution = 21; gfTypeCarrier = 32; gfGenre = 44; gfCountry = 45; gfCategory = 46; gfActors = 47; gfDirector = 53; gfScenario = 54; gfComposer = 55; gfProducer = 56; gfTags = 0; gfStudio = 0; gfActor = 0; gfFirstWorld = 0; gfBudget = 0; gfMoneyWorld = 0; //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; convertlink,newLinkFormat, createLink, formattedTime, miniPoster, LongDate, loadFee, loadExtraRole, simpleTitle, transRusOrigTitle, formattedURL, addLikeFilms2Links, needPreviewInSearch, makeStudiosIsStandard, effectStudiosIsStandard, saleStudiosIsStandard, managerIsProducer : Boolean; szPosterX, szPosterY, nationality, RusNames, ShowPersonAs, maxOpinion, maxOpinionURL, maxCharInOpinion, maxPersons, placeTimeSerial, maxStudios, maxStudiosInCat, optURL, optOrigTitle, optTitle, optAka, optYear, optCountry, optTagline, optGenre, optBudgetM, optMoneyWorldM, optFirstWorldM, optMPAA, optDescription, optRating, optRatingIMDB, optMoneyUSA, optMoneyRUS, optMoneyOther, optViewers, optBudgetU, optMarketing, optMoneyWorldU, optFirstRUS, optReleaseDVD, optReleaseBD, optTime, optFirstWorldU, optTop250, optCategory, optOpinion, optPrognosRating, optDoYouKnow, optDirector, optActor, optProducer, optScenario, optComposer, optOperator, optDouble, optManager, optDirectorDouble, optDesign , optEditor , optActorDouble , optSites, optMakeStudio, optEffectStudio, optSaleStudio, optStudio, optTags, optConnection, optAward, optMoreAwards, optKinoCritic, optReview, optEpisode, optTimeSerial, optPosters, optCost, optLimitedWeekend, optFirstWeekend, optMaxCinema, optLimitedShow, optGeneralShow, optEndShow, optTimeShow, optNetAvails, optSoundtrack, optVersion, pgDoYouKnow, pgPersons, pgSites, pgStudio, pgWords, pgList, pgAwards, pgKinoCritic, pgReview, pgSeasons, pgPosters, pgTake, pgSoundtrack, Delay, optVotesIMDB, optVotesKinopoisk : Integer; ListDelim, ListSign, russianCountry, ufPrefix, ufPostfix, login, password, EmptyCategory, ufBudget, ufMarketing, ufMoneyUSA, ufMoneyRus, ufMoneyOther, ufMoneyWorld, ufViewers, ufFirstWorld, ufFirstRUS, ufReleaseDVD, ufReleaseBD, ufTime, ufTimeSerial, ufTop250, ufDoYouKnow, ufOperator, ufManager, ufDouble, ufDirectorDouble, ufSites, ufMakeStudio, ufEffectStudio, ufSaleStudio, ufKinoCritic, ufReview, ufMoreAwards, ufOpinion, ufPrognosRating, ufCost, ufLimitedWeekend, ufFirstWeekend, ufMaxCinema, ufLimitedShow, ufGeneralShow, ufEndShow, ufTimeShow, ufNetAvails, ufSoundtrack, ufVersion, ufVotesIMDB, ufVotesKinopoisk : String; // Resha 15.09.2014 { optReleaseBDDateOnly : Integer; // } Resha ztt : integer; Const Disabled = 0; // Опция включена, поле обновляется Enabled = 1; // Опция отключена, поле не обновляется Empty = 2; // Обновляется только пустое поле (действует на опции, помеченные +e) const mcDebug = 0; // Уникальные символы при парсинге // Заполнены и вынесены в константы не все mcSearchOk = '