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

0 Members and 2 Guests are viewing this topic.

Online Ivek23

  • Global Moderator
  • *****
  • Posts: 2704
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #40 on: September 08, 2018, 03:36:47 pm »
Is it normal that importing from IMDb is very slow and screen is flickering from quickly disappearing black windows... also importing does hang when I run it from C:\Program Files\... instead of a temporary directory?

Yes, because the external program must first download all the information from a webpage to a temp file so that it can then be added to the database for a particular movie. Because more than information for a particular movie on web pages and is written there, it takes longer for the external program to passes it, as previously mentioned.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline fmb64

  • Member
  • *
  • Posts: 14
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #41 on: September 09, 2018, 08:16:01 am »
Ok.

Is it possible to hide the flickering windows or run them minimized? Very annoying when you want wo work with another window/software while importing. Even when I switch to a full screen game, it jumps back to the desktop ;)

Also the PVD window gets bigger and overlaying the taskbar while importing.
PVD 1.0.2.7    Win10 x64

Offline VVV_Easy_Programing

  • Older Power User
  • *****
  • Posts: 199
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #42 on: September 09, 2018, 01:52:45 pm »
Quote
Is it possible to hide the flickering windows or run them minimized?
unfortunately not because the PVD makes the launch. The MOD tries to hide it and recover the focus of windows PVD, but it can not be done more.
Quote
Is it normal that importing from IMDb is very slow ...
As Ivek23 responded, the IMDB script can arrive to download to 6 pages per movie. In addition, IMDB increase the response time when it detects multiple queries of an IP user.
Have you tried the TheMovieDB script? This free provider is specially designed for this type of programs: download only the precise information in text mode, so it works very fast.

Offline VVV_Easy_Programing

  • Older Power User
  • *****
  • Posts: 199
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #43 on: September 09, 2018, 02:25:35 pm »
Ivek23 you had done an extraordinary work. It will take me some weeks to put in in a new MOD version.

I have one question in order to set un standart for ~genre~ / ~category~ / ~tags~. I try to summary:
~genre~ = Present as "genre" in IMDB, TheMovieDB, FilmAffinity,AllMovie
~tags~   = Present as "keywords" in IMDB, AllMovie, TheMovieDB
~category~ = Not present in IMDB neither TheMovieDB but
     FilmAffinity have the information "Genre1.Genre2 | Category1.Category2"
     AllMovie have the information Theme1 | Theme2 | Theme3 | Theme4 |
Are you agree?

I have other questions over the custom fields but I must study one by one.

Online Ivek23

  • Global Moderator
  • *****
  • Posts: 2704
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #44 on: September 11, 2018, 06:28:48 am »
Ivek23 you had done an extraordinary work. It will take me some weeks to put in in a new MOD version.

Thanks.

I have one question in order to set un standart for ~genre~ / ~category~ / ~tags~. I try to summary:
~genre~ = Present as "genre" in IMDB, TheMovieDB, FilmAffinity,AllMovie
~tags~   = Present as "keywords" in IMDB, AllMovie, TheMovieDB

Yes, correct reasoning.

~category~ = Not present in IMDB neither TheMovieDB but

The same for this.

     FilmAffinity have the information "Genre1.Genre2 | Category1.Category2"

For this, I can not say anything because I do not use it.

     AllMovie have the information Theme1 | Theme2 | Theme3 | Theme4 |

Yes, but there are several of these categories under different names. It will be necessary to list the names of these, so that I can answer this in more detail.

I have other questions over the custom fields but I must study one by one.

With questions on this problem, when you need it.
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 #45 on: September 13, 2018, 09:55:30 pm »
Attached the files and scripts with the next changelog:
IMDB_[EN][HTTPS]
        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: New script parameter PRESERVE-USER-MOVIE-CHARS = Preserve the user movie copy characteristics (length and languages channels) instead of the original runtime and languages.
           Ivek23,VVV: ParsePage_IMDBMovieTECHNICAL = Added compatibility with CustomFields ~ImdbTechSpecs~ (original PVD ~features~ can be disabled in the program check fields table)
TheMovieDB_[XX][API]
        V 1.0.0.1 (11/09/2018)  VVV: TheMovieDB "keywords" info goes to ~tags~ PVD field (Ivek23 suggestion). Added ~Updated~ field.
FilmAffinity_[XX][HTTPS]
            V 4.0.0.4 (11/09/2018) VVV: Added ~Updated~ field

Some commentaries:
It will be added the custom field ~Updated~(Short text)  to the standard database because the PVD give problems with the ~moddate~ but the other custom fields, even if the scripts write the information, will not be added because are provider oriented.
There are two database uses:
1) the use at the same time of ~description~ and ~comments~
2) set the original lengh movie and lenguage that over the user file movie copy
that are not standart. Now there is two script parameters to allow the user this behavior.

Ivek23, may you test the script in order to verify if it work as you expect even with your custom fields?
When all work I' ll publish a new MOD version. Please, as me if you have any doubt.  ;D

Online Ivek23

  • Global Moderator
  • *****
  • Posts: 2704
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #46 on: September 14, 2018, 07:20:05 am »
Ivek23, may you test the script in order to verify if it work as you expect even with your custom fields?

I will test, it will take a few days or a week or two, all depends on my free time, which unfortunately I do not have much at the moment. It can also be anything sooner, we will see, because I have found some more errors that I have repaired and checked if they work properly.
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 #47 on: September 16, 2018, 08:28:04 am »
Today the scripts configuration parameters are hardcode in the script. This is not a good practice (and BTW is the reason why PVD must restart after use **** Scripts Configuration ****).

In the pluging system there are two funtions (CanConfig, Configure) in order to activate and use de 'Configure Selected pluging' buttom (the "Tool" buttom, at right of the 'Import name', between 'Launch Import' buttom and 'Set Overview Options') (see Programming own plugins).

Somebody know how do that for the Scripts?

Offline fmb64

  • Member
  • *
  • Posts: 14
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #48 on: September 16, 2018, 03:34:46 pm »
Quote
Is it possible to hide the flickering windows or run them minimized?
unfortunately not because the PVD makes the launch. The MOD tries to hide it and recover the focus of windows PVD, but it can not be done more.
What about (maybe optionally) not recovering the focus of the PVD window, maybe one can work with another software without the flickering and even not jumping out of a full screen game. ;)
Quote
Have you tried the TheMovieDB script? This free provider is specially designed for this type of programs: download only the precise information in text mode, so it works very fast.
Ok, this seems to be an nice alternative.

It imports a screenshot of the movie, how to disable this?

Please add a german version of the script - I copied the english one and modified it, works  :)
PVD 1.0.2.7    Win10 x64

Offline VVV_Easy_Programing

  • Older Power User
  • *****
  • Posts: 199
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #49 on: September 18, 2018, 08:34:46 am »
Quote
Please add a german version of the script - I copied the english one and modified it, works  :)
Great new to have a German user.
It's true that TMDB have a german version but I don't know german. But don't worry I'd prepared the scripts for easy translation: I use a txt file with the first line in english and the second in the 'foreign' language.
I'd done the draft of german translation with Google attached. May you correct those files in order to incorporate to the MOD version?
BTW, if there is other 'foreign' person with other language need all help are welcome.

Quote
It imports a screenshot of the movie, how to disable this?
There are two way to control the saved of information in the PVD database.
1) The PVD standard with the 'Set Overwrite Options for the selected plugin' (the "Calendar" button, at right of the script 'Import name').
2) The custom fields and others aren't included in this option so the scripts have hardcode parameters that now are easily changed launching the first script '**** Scripts Configuration ****' (you must have selected one movie or one person).
This is the way to disable the screenshot save:
a) Launch the PVD MOD Configuration Script:



b) With this the PDV MOD Script Configuration windows opens. In the wanted script sheet, Enable or disable your preference (Screenshot with a horizontal blue arrow)



c) Saved it (vertical blue arrow)

BTW you can activate or deactivate a script checking the Active box (green circle)

Quote
What about (maybe optionally) not recovering the focus of the PVD window, ...
This isn't easy because PVD interacts with the focus but I have understood your request: To work with PVD in second plane completely.
With this information I'll try to do something if possible.
« Last Edit: September 18, 2018, 10:01:51 am by VVV_Easy_Programing »

Offline fmb64

  • Member
  • *
  • Posts: 14
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #50 on: September 18, 2018, 02:53:36 pm »
That’s very cool to interact with the programmer to help improving the software. :)

Quote
Great new to have a German user.

Yes, in fact Swiss user but no matter  ;)

I corrected the german translation, it is a bit difficult because I think the English is not perfect, too   ;) ;)

Quote
There are two way to control the saved of information in the PVD database.

Thank you very much, now I got it how to configure the script.

The launch of the configuration script does not work if PVD is stored in a path containing spaces (for example "D:\Personal Video Database")   see attached error. (how to embed the screenshot?)

On "Save Config" PVD restarts with the sample movie database instead of the last I had open.

BTW, the duration of the movie is imported to 'Features' instead of 'Duration'.

Quote
This isn't easy because PVD interacts with the focus but I have understood your request: To work with PVD in second plane completely.
With this information I'll try to do something if possible.

That would be awesome, because I still prefer iMDb (a little bit)   :)
« Last Edit: September 18, 2018, 02:58:44 pm by fmb64 »
PVD 1.0.2.7    Win10 x64

Online Ivek23

  • Global Moderator
  • *****
  • Posts: 2704
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #51 on: September 18, 2018, 03:24:41 pm »
BTW, the duration of the movie is imported to 'Features' instead of 'Duration'.

Yes, this is a mistake that will be corrected in the next IMDB_ [EN] [HTTPS] script version. Within a few days, the patches will be posted from my site (I need to do some tests because I've fixed the errors) in this topic and then the new IMDB_ [EN] [HTTPS] script version will be published.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline fmb64

  • Member
  • *
  • Posts: 14
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #52 on: September 18, 2018, 04:11:56 pm »
Yes, this is a mistake that will be corrected in the next IMDB_ [EN] [HTTPS] script version.

Thanks guys, I really appreciate your work for keeping this software alive.  :)
PVD 1.0.2.7    Win10 x64

Online Ivek23

  • Global Moderator
  • *****
  • Posts: 2704
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #53 on: September 18, 2018, 04:36:19 pm »
IMDB_ [EN] [HTTPS] script

Quote
//Download methods-------------------------------------------------------------------------------------------------------
  dmGET           = 0;
  dmPOST          = 1;
//Movie fields----------------------------------------------------------------------------------------------------------
  mfURL         = 0;
  mfTitle      = 1;
  mfOrigTitle   = 2;
  mfAka         = 3;
  mfYear         = 4;
  mfGenre      = 5;
  mfCategory      = 6;
  mfCountry      = 7;
  mfStudio      = 8;
  mfMPAA         = 9;
  mfRating      = 10;   //This is 'Additional rating', not 'Rating'
  mfTags         = 11;
  mfTagline      = 12;
  mfDescription   = 13;
  mfDuration      = 14;
  mfFeatures      = 15;

//Credits  types----------------------------------------------------------------------------------------------------------

This part of the code is required because otherwise the movie duration will not be added to the database. This part of the code is needed because of these two parts of the code in the script.

The first is for the following part:


Quote
    //Get the original "Runtime" (in minutes) as ~length~ instead of the duration of the user movie copy
    If Not(PRESERVE_USER_MOVIE_CHARS) Then Begin
        curPos:=Pos('<h4 class="inline">Runtime:</h4>',HTML);                                      //WEB_SPECIFIC.
        If 0<curPos Then Begin 
            ItemValue:=TextBetWeen(HTML,'M">',' min</time>',false,curPos);  //Strings which opens/closes the data. WEB_SPECIFIC
            //ItemList:=ItemList+'Original Runtime: '+ItemValue+' min.<br>';
            //LogMessage('      Get result Original Runtime_1:'+ItemValue+'||');
            //AddFieldValueXML('length',ItemValue);
            AddFieldValue(mfDuration,ItemValue);      
            LogMessage('      Get result lenght:'+ItemValue+'||');
        End;
    End;

The second is for Function ParsePage_IMDBMovieTECHNICAL:

Quote
Function ParsePage_IMDBMovieTECHNICAL(HTML:String):Cardinal; //BlockOpen
    //Returns:
    //     Result:=prFinished; Script has finished gathering data
    //     Result:=prError; If żany big problem? with exit
    //Retrieve: ~features~
  Var
    //curPos:Integer;
    curPos,endPos:Integer;
    ItemValue,ItemList:String;     
  Begin
    LogMessage('Function ParsePage_IMDBMovieTECHNICAL BEGIN=====================||');
    Result:=prFinished;  //It will change to prError if any big problem with exit; 
    //Get "Technical Specifications" info
    curPos:=Pos('<h1 class="header">Technical Specifications</h1>',HTML);
    if (curPos=0) then Exit;
    EndPos:=curPos; 
    //Get "Runtime" info
    curPos:=Pos('<td class="label"> Runtime </td>',HTML);                                      //WEB_SPECIFIC.
   If 0<curPos Then Begin 
      ItemValue:=TextBetWeen(HTML,' (',' min)',false,curPos);  //Strings which opens/closes the data. WEB_SPECIFIC
        LogMessage('      Get result lenght from Runtime:'+ItemValue+'||');
        If ItemValue <> '' then begin       
    //Get the original "Runtime" (in minutes) as ~length~ instead of the duration of the user movie copy
            If Not(PRESERVE_USER_MOVIE_CHARS) Then Begin 
                AddFieldValue(mfDuration,ItemValue);
                //AddFieldValueXML('length',ItemValue);
                LogMessage('      Get result lenght from Original Runtime:'+ItemValue+'||');
            End;
            //ItemList:=ItemList+'Runtime_1'+'<br>'+ItemValue+'<br><br>';
        End;
    End;                 
    //Get "Runtime" info
    ItemValue:=HTMLValues2(HTML,'Runtime','</tr>','<td>','</tr>','<br><br>',EndPos);
    ItemValue:=StringReplace(ItemValue,'                                ','<br>',True,False,True);
    ItemValue:=StringReplace(ItemValue,'                      ','<br>',True,False,True);
    ItemValue:=StringReplace(ItemValue,'          ','',True,False,True);
    If ItemValue <> '' then LogMessage('      Get result Runtime:'+ItemValue+'||');
    if ItemValue <> '' then ItemList:=ItemList+'Runtime'+'<br>'+ItemValue+'<br><br>';   
       
    //Get "Sound Mix" info

Here it is necessary to add a part of the code for  // Get "Runtime" info as I added it here because otherwise it will not correctly transfer the information for "Runtime".
« Last Edit: September 18, 2018, 04:38:28 pm by Ivek23 »
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Online Ivek23

  • Global Moderator
  • *****
  • Posts: 2704
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #54 on: September 18, 2018, 05:56:46 pm »
IMDB_ [EN] [HTTPS] script

A minor correction for ParsePage_IMDBSearchTitle code, where repeatedly did not show all hits when searching for results or did not show the year when movie release.


Quote
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;
     endPos:Integer;
      ItemValue,ImageFile:String;
      Title,Year,MovieURL,PreviewURL:String;
  Begin
.
.
.
            //Get MovieURL  (Always must it has)
            MovieURL:=TextBetWeen(HTML,'<a href="/title/','/',false,curPos);               //Strings which opens/closes the data. WEB_SPECIFIC
            MovieURL:= BASE_URL_PRE+MovieURL+BASE_URL_SUF;
            LogMessage('      Parse Results URL:'+MovieURL+'||');
            //If true HTPPS link PVdB gives "Socket Error # 11001"
            //If ancient http, get redirected and give "IOHandler value is not valid
            //If invalid url, "HTTP/1.1 400 Bad Request"               
            MovieURL:=CHEAT_PREFIX_URL+MovieURL;                 //'Cheat' URL for avoid HTTPS issue in GET return.
            LogMessage('      Parse Results CHEAT URL:'+MovieURL+'||');
            //Get Title (Always must it has)
            Title:=TextBetWeen(HTML,'>','<',false,curPos);                               //Strings which opens/closes the data. WEB_SPECIFIC
            LogMessage('      Parse Results Title:'+Title+'||');
            //Get Year
            //Year:=TextBetWeen(HTML,'(',')',false,curPos);                               //Strings which opens/closes the data. WEB_SPECIFIC
            endPos:=PosFrom('</span>',HTML,curPos);
            curPos:=endPos-5;
            Year:=IntToStr(StrToInt(Copy(HTML,curPos,4)));

            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('<div class="lister-item mode-simple">',HTML,curPos)          //String which opens the Web Result item List data. WEB_SPECIFIC
        End;

For ~ Metascore: ~ information must be all part of the code because the web pages share different parts of the source code for Metascore data.

Quote
    //~Metascore:~
    curPos := PosFrom('> <div class="metacriticScore score_favorable titleReviewBarSubItem">',HTML,EndPos);
    if curPos>0 then begin
        curPos:=curPos+Length('> <div class="metacriticScore score_favorable titleReviewBarSubItem">');      
        EndPos:=PosFrom('</span>',HTML,curPos);
        ItemValue:=RemoveTags(Copy(HTML,curPos,endPos-curPos+2),false);
        ItemValue:=StringReplace(ItemValue,'0</',',0',True,False,True);
        ItemValue:=StringReplace(ItemValue,'1</',',1',True,False,True);
        ItemValue:=StringReplace(ItemValue,'2</',',2',True,False,True);
        ItemValue:=StringReplace(ItemValue,'3</',',3',True,False,True);
        ItemValue:=StringReplace(ItemValue,'4</',',4',True,False,True);
        ItemValue:=StringReplace(ItemValue,'5</',',5',True,False,True);
        ItemValue:=StringReplace(ItemValue,'6</',',6',True,False,True);
        ItemValue:=StringReplace(ItemValue,'7</',',7',True,False,True);
        ItemValue:=StringReplace(ItemValue,'8</',',8',True,False,True);
        ItemValue:=StringReplace(ItemValue,'9</',',9',True,False,True);
        AddCustomFieldValueByName('Metascore',FloatToStr((StrToFloat(ItemValue) * 1)));
        LogMessage('      Get result custom field Metascore_0:'+ItemValue+'||');
    End;   

    //Get ~Metascore~
    curPos:=PosFrom('> <div class="metacriticScore score_unfavorable titleReviewBarSubItem">',HTML,EndPos);
    if curPos>0 then begin
        curPos:=curPos+Length('> <div class="metacriticScore score_unfavorable titleReviewBarSubItem">');
        EndPos:=PosFrom('</span>',HTML,curPos);
        ItemValue:=RemoveTags(Copy(HTML, curPos,endPos-curPos+2),false);
        ItemValue:=StringReplace(ItemValue,'0</',',0',True,False,True);
        ItemValue:=StringReplace(ItemValue,'1</',',1',True,False,True);
        ItemValue:=StringReplace(ItemValue,'2</',',2',True,False,True);
        ItemValue:=StringReplace(ItemValue,'3</',',3',True,False,True);
        ItemValue:=StringReplace(ItemValue,'4</',',4',True,False,True);
        ItemValue:=StringReplace(ItemValue,'5</',',5',True,False,True);
        ItemValue:=StringReplace(ItemValue,'6</',',6',True,False,True);
        ItemValue:=StringReplace(ItemValue,'7</',',7',True,False,True);
        ItemValue:=StringReplace(ItemValue,'8</',',8',True,False,True);
        ItemValue:=StringReplace(ItemValue,'9</',',9',True,False,True);
        AddCustomFieldValueByName('Metascore',FloatToStr((StrToFloat(ItemValue) * 1)));
        LogMessage('      Get result custom field Metascore:'+ItemValue+'||');
    End;
    //~Metascore:~
    curPos := PosFrom('> <div class="metacriticScore score_mixed titleReviewBarSubItem">',HTML,EndPos);
    if curPos>0 then begin
        curPos:=curPos+Length('> <div class="metacriticScore score_mixed titleReviewBarSubItem">');      
        EndPos:=PosFrom('</span>',HTML,curPos);
        ItemValue:=RemoveTags(Copy(HTML,curPos,endPos-curPos+2),false);
        ItemValue:=StringReplace(ItemValue,'0</',',0',True,False,True);
        ItemValue:=StringReplace(ItemValue,'1</',',1',True,False,True);
        ItemValue:=StringReplace(ItemValue,'2</',',2',True,False,True);
        ItemValue:=StringReplace(ItemValue,'3</',',3',True,False,True);
        ItemValue:=StringReplace(ItemValue,'4</',',4',True,False,True);
        ItemValue:=StringReplace(ItemValue,'5</',',5',True,False,True);
        ItemValue:=StringReplace(ItemValue,'6</',',6',True,False,True);
        ItemValue:=StringReplace(ItemValue,'7</',',7',True,False,True);
        ItemValue:=StringReplace(ItemValue,'8</',',8',True,False,True);
        ItemValue:=StringReplace(ItemValue,'9</',',9',True,False,True);
        AddCustomFieldValueByName('Metascore',FloatToStr((StrToFloat(ItemValue) * 1)));
        LogMessage('      Get result custom field Metascore_1:'+ItemValue+'||');
    End;
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Online Ivek23

  • Global Moderator
  • *****
  • Posts: 2704
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #55 on: September 18, 2018, 06:20:23 pm »
IMDB_ [EN] [HTTPS] script

Full Cast and Crew section

For directors, you also need to add a snippet of code in order for the data to be downloaded correctly.


Quote
    //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 (Remember index begin in 0).
         //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,ctDirectors);
         LogMessage('      Get results Director:#'+IntToStr(index)+'|'+Name+'|'+PersonURL+'||ctDirectors'); 
         curPos:=PosFrom('<td class="name">',ItemList,curPos)                                            //String which opens the subList data. WEB_SPECIFIC
         index:=index+1;
      End;
    End;

For Function ParsePage_IMDBMovieMPAA is also a small correction.

Quote
Function ParsePage_IMDBMovieMPAA(HTML:String):Cardinal; //BlockOpen
    //Returns:
    //     Result:=prFinished; Script has finished gathering data
    //     Result:=prError;  If any big problem? with exit
    //Retrieve: ~MPAA~
  Var
    curPos:Integer;
    mpaaValue:String;
  Begin
.
.
.
   mpaaValue:=StringReplace(mpaaValue,'update: ','',False,False,True);                         //Cleanig value. WEB_SPECIFIC
    curPos:=Pos('Edit',mpaaValue);                               //WEB_SPECIFIC.
    If 0<curPos then mpaaValue:=Copy(mpaaValue,0,curPos-1);   

    If (mpaaValue='Approved') Then mpaaValue:='Rated G';
.
.
.
    AddFieldValueXML('mpaa',mpaaValue);
    LogMessage('      Get result MPAA='+mpaaValue+'||');
    LogMessage('Function ParsePage_IMDBMovieMPAA END=====================||');
  End; //BlockClose

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


Online Ivek23

  • Global Moderator
  • *****
  • Posts: 2704
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #56 on: September 18, 2018, 06:28:33 pm »
Yes, this is a mistake that will be corrected in the next IMDB_ [EN] [HTTPS] script version.

Thanks guys, I really appreciate your work for keeping this software alive.  :)

Welcome.

I tried and posted corrections. If I find anything else, I'll post it later.
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 #57 on: September 18, 2018, 08:12:10 pm »
Script Movie Configuration bug for http://vvveasy.altervista.org/wp-content/uploads/2018/08/PVD_0.9.9.21_MOD-V.2018.08.08.zip
The launch of the configuration script does not work if PVD is stored in a path containing spaces (for example "D:\Personal Video Database")   see attached error.

Thanks both. I have not understood the first time. Corrected in the attached patch that oame with the TheMovie [DE] scripts too.
NOT YET the Ivek23 alerts corrected in this patch.

Two questions to Ivek23 about duration info.
1) What is the diference between  "AddFieldValueXML('length',ItemValue);" and "AddFieldValue(mfDuration,ItemValue); " with "mfDuration = 14;"
2) PVD have a command "Re-read file information" in order to fill the next fields:

Is this Duration yours field? In your PVD version is not it ~length~?
a) If yes, I have added a new script parameter in order to preserve it for the user with a movie file copy
     PRESERVE_USER_MOVIE_CHARS = True ; //Preserve the user movie copy characteristics (length and languages channels) instead of the original runtime and languages.
b) If not What PVD field is? I don't be able to find it in my PVD database or in the forum documentation and it overwrites the .

« Last Edit: September 18, 2018, 09:28:48 pm by VVV_Easy_Programing »

Online Ivek23

  • Global Moderator
  • *****
  • Posts: 2704
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #58 on: September 19, 2018, 01:57:41 pm »
Two questions to Ivek23 about duration info.
1) What is the diference between  "AddFieldValueXML('length',ItemValue);" and "AddFieldValue(mfDuration,ItemValue); " with "mfDuration = 14;"

Otherwise, this means the same and the same normal field in the PVD database, but in IMDB_ [EN] [HTTPS] script example "AddFieldValueXML (" length ", ItemValue);" does not transfer any length or duration of a movie. It's completely different with "AddFieldValue (mfDuration, ItemValue);" which transfers the length or duration of a movie website, so it's necessary "mfDuration = 14;" he also needs it.

If already IMDB_ [EN] [HTTPS] script is being edited to work, it is also right that this part of the code is also edited in order to work properly. This is about certain PVD users, who use multiple databases in order to choose the information they want.

My example of how I use the length or duration of a movie in the database:

I am using one database with information about a specific movie such as length and
similar to the movies folder stored in the archive on external disks. In the rest of the database, for example, I have, for example, saved only the length of the movie, which information is downloaded from the web site using plug-ins or scripts.

2) PVD have a command "Re-read file information" in order to fill the next fields:

Is this Duration yours field? In your PVD version is not it ~length~?
a) If yes, I have added a new script parameter in order to preserve it for the user with a movie file copy
     PRESERVE_USER_MOVIE_CHARS = True ; //Preserve the user movie copy characteristics (length and languages channels) instead of the original runtime and languages.

I've already answered partially. Of course, all this is stated in my database and is true, but not for everyone.

PRESERVE_USER_MOVIE_CHARS = True; keeps the length of the film.

PRESERVE_USER_MOVIE_CHARS = True; however, it is not true for the original language because this is a particularly normal field in the database. The Original Language field always downloaded the information for the original language from the website (with IMDB only the first written language, which is very much often English language). There is only a language box, but it does not have a direct link to the original language field.

b) If not What PVD field is? I don't be able to find it in my PVD database or in the forum documentation and it overwrites the .

"length" is the XML mark for the duration field and is in the skins (find it there), the Duration record is for a length - "length" field and it is visible in the PVD database.

Recommendation:

This option  PRESERVE_USER_MOVIE_CHARS = True;  it would be necessary to define for the time and separately for the language, so that each user can decide on his own data for which information he will keep and what information he will replace with other data.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Online Ivek23

  • Global Moderator
  • *****
  • Posts: 2704
    • View Profile
Re: Personal Video Database 1.0.2.7 MOD
« Reply #59 on: September 19, 2018, 03:38:32 pm »
IMDB_ [EN] [HTTPS] script

// Get ~ imdbrating ~, ~ IMDB_Votes ~ code has been changed again and now the code again works as it worked on 2018.08.08, when the last PVD_1.0.2.7_MOD-V.2018.08.08 was created.

Quote
    //Get ~imdbrating~, ~IMDB_Votes~
    curPos:=Pos('<span itemprop="ratingValue">',HTML);                      //WEB_SPECIFIC.
    If 0<curPos Then Begin                         
       ItemValue:=TextBetWeen(HTML,'<span itemprop="ratingValue">','<',false,curPos);   //Strings which opens/closes the data. WEB_SPECIFIC
       ItemValue:=StringReplace(ItemValue,',','.',True,True,False);                           //Decimal comma spanish separator to point english separator.
       AddFieldValueXML('imdbrating',ItemValue);
       LogMessage('      Get result imdbrating:'+ItemValue+'||');
       ItemValue:=TextBetWeen(HTML,'<span class="small" itemprop="ratingCount">','</span>',false,curPos);   //Strings which opens/closes the data. WEB_SPECIFIC
       ItemValue:=StringReplace(ItemValue,'.','',True,True,False);            //Remove thousand point spanish separator.
       ItemValue:=StringReplace(ItemValue,',','',True,True,False);            //Remove thousand comma english separator.
       AddCustomFieldValueByName('IMDB_Votes',ItemValue);
       LogMessage('      Get result IMDB_Votes:'+ItemValue+'||');
    End;

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


 

anything