Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - VVV_Easy_Programing

Pages: [1]
1
Scripts and Templates / Some usefull SQL scripts in PVD
« on: January 28, 2017, 08:10:45 pm »
Hello,
there are sometimes that the script is not a good tool for arrange PVD. Happily we have the possibility of use SQL scripts.

First you must start  PVD in Debug Mode (viddb.exe -debug) and then you have in Menu->Help->SQL where you can run a SQL Script (tick the box if the script have several lines).

I publish two examples easy to understand:
1) Now I have problems with IMDB[EN] and the original title (give me a false string 'var ....'). I can solve easily the problem running:
                  update MOVIES set "origtitle"="title" where "origtitle"='var ue_t0=window.ue_t0||+new Date();';
or
                  update MOVIES set "origtitle"="title" where SUBSTR("origtitle",1,3) = 'var';

2) Some strange chars appears in the people IMDB url. I use:
                  update PEOPLE set "url"=replace("url",'?ref_=tt_ov_dr', '/');
                  update PEOPLE set "url"=replace("url",'?ref_=tt_ov_wr', '/');

I anime to all to publish here their own SQL scripts for PVD.

2
Hello,
it's really difficult to find scripts for retrieve information for people.
Well, I make a little one which get the basic info (photo included) in Spanish (but easy to adapt for English or French, see down) from TheMovieDB.
It has an important feature: Store the URL of the person photo in ~transname~ for send to KODI in a Template (see in the forum)..

---------------------------------------------
SCRIPT:     TheMovieDB_[ES]_People
API URL:    http://docs.themoviedb.apiary.io/
CO-AUTHORS: VVV
Contact Web: http://contactbyweb.com/vvv-easy
---------------------------------------------
CHANGE LOG (15/01/2017):
            v 0.1.0.0   VVV: initial release
---------------------------------------------
FIELD USE:
  This is a script designed to be easy to understand and to adapt. For this reason may be missing some fields and
  the programming may not be smart. It's a only "One Pass" Script and get data in API SEQUENTIAL ORDER.
  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.
  (Due a PVdB "GET" scripts funtions seems doesn't work with 'https' URL de v.0.2.0.0 works with API web dialog.
   See 'TheMovieDB_[ES]' script for no API (take information direct from web page) scraper.)
  If desired (PHOTO_URL_IN_TRANSNAME=True), it use the Field ~transname~ for storing the URL to the person photo, for send to KODI in a Template.   
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 &lt;&gt;&amp;&quot;) with normal characters (like <, >,$, ").
  3. It's a only "One Pass" Script: It DOES NOT makes several calls to the main program to scrape information from various pages of
     the movie in the same site. It only do that for searching mode in a movie list results.
  4. It has a Rondabout in BASE_URL (BASE_URL_TRUE,BASE_URL_RONDABOUT) for "cheat" GET PVdB funtion and rondabout the "https" fail.
  5. Get the ~orating~ (Popularity). It's not documented in PVB Scripting Manual and in the script don't work even working in the skin.
  5. In People database, PVdB don't download automaticaly the photo like in Movie database but using ListSearch it do.
     Set PHOTO_DWN_RONDABOUT  = True to activate the the ImageListSearch as RONDABOUT for download Photos. Because there is not choice (because its
     only one photo) normaly it download without asking but if PVdB begin to ask then with PVdB preference/Plugin/Silent Enable would be
     more confortable for large databases.
---------------------------------------------
//User Options
  BYPASS_SILENT        = False; //Set to True to ensure ShowMessage alerts (then bypass Silent PVdB preferences)
  PHOTO_DWN_RONDABOUT  = True;  (*Set to True to activate the the ImageListSearch as RONDABOUT for download Photos.
                                  Because there is not choice (because its only one photo) normaly it download without asking but if PVdB begin to ask then
                                  with PVdB preference/Plugin/Silent Enable would be more confortable for large databases.*)
  PHOTO_URL_IN_TRANSNAME = True; //Set to False to disable to avoid use the Field ~transname~ for storing the URL to the person photo, for send to KODI in a Template.

  LANG_API_STR         = '&language=es';                                  //WEB_SPECIFIC
  //LANG_API_STR       = '&language=en';                                  //WEB_SPECIFIC
  //LANG_API_STR       = '&language=fr';                                  //WEB_SPECIFIC

(Edito: New version down)

3
Hello,
I have seen some parts of my scripts are used for more web's scripts. This is welcome.
So I'll add some personal scripts for anyone may used code or ideas for their programs.
But there are not well documented and I can not promise support.

MPAA_IMDB_Recover.psf
Need: I have my movies into folders by age classification and I need the classification MPAA format to display in the skin of XBMC.
Problem to solve: IMDB returns clasification of the country of the IP user. Sometimes it not have the MPAA. There are several formats.
Script Features: Corrects the information of an already traced movie. Using DUMMY_SEARCH_STR file (prevents access to Web). Search in website if necessary. Writes classification according folder if no Web information.

Several_File_Infos.psf
Need: Pass language and codec from filename to PVdB. Check that the year of the file name is the same as the movie information
Problem to solve: Pass that data to XBMC. And check the information.
Script Features: Use movie file fields not significant ('Location' and 'rip') for that, this is coordinated with the template "XBMC Easy_MOD.ptm". Using DUMMY_SEARCH_STR file (avoid access to Web).

FilmAffinity_New_Releases.psf
Need: Search in FilmAffinity DVD rental films the movies with a rating higher of 6 and number of votes greater than 2000.
Problem to solve: Select from a web list and then gets information (for instance, number of votes) of those movies.
Characteristics of Script: A script of multiple passes. Search the list page (stored in the first access) and while the list is parsed, gets the pages from the good movies to get more information (searches similar to "FilmAffinity_[ES]_2014"). All is saved to a file. If GET_ONLY_NOT_PVdB = True, gets only the movies not present in PVdB (but PVdb_CSVDB_FILE is needed). Although not very smart, use global variables for better understanding.

FilmAffinity+IMDB_Rating_Renovate.psf
Need: Renew the ratings of PVD movies.
Problem to solve: Do with minimum download.
Characteristics of Script: A script of multiple passes. Search the saved movie URL and parse the movie page geting the ratings of IMDB and FilmAffinity.


Note: The scripts updates of "FilmAffinity_New_Releases.psf" and "FilmAffinity+IMDB_Rating_Renovate.psf" continue in the topic:
Script: FilmAffinity [ES] 2014 (Easy Script) http://www.videodb.info/forum_en/index.php/topic,3876.0.html

I hope this post can help someone.

PVdB is a very good program. Flexible and complete.
It's a shame so little forum movement  :'(. Thanks Ivek23  ;).
Nostra, Rick.ca we miss you, we are lost without you  ;D.

4
Attached the Rosetta Stone of "Personal Video Database", "XBMO NFO files" and "MovieInfo file of TViXie" to anyone who wants to develop their own templates (Note: In Excel 2010 and CSV commas delimited file formats).

5
Scripts and Templates / Script: TheMovieDB [ES] (Easy API Script)
« on: January 19, 2014, 11:19:11 am »
I attached my script to scrape the information of the web TheMovieDB in Spanish. It is made on the basis of 'FilmAffinity [ES] 2014' script with some improvements.
If you want to try use the name of movies in Spanish  "La vida de Pi"="Life of Pi" (finds at first) or "Padrino"="Godfather" to search by list (the script no handles advanced search).
On the other hand I tried to make it as easy as possible to understand for subsequent public use. It also includes an example so that it can adapt. I copy the introduction of Script:
"  This is a script designed to be easy to understand and to adapt. For this reason may be missing some fields and
  the programming may not be smart. It's a only "One Pass" Script and get data in WEB SECUENTIAL ORDER.
  The Personal Video Data field names in comments are enclosed in "~" so they are easier to find in the script.
  The WEB_SPECIFIC comentary points out the specific text for Web fields.
  Use with your editor's search function to find applicable code sections and adapt script."

(Edito: New version down)

6
People using one of the media players TViX, NMT (Popcorn Hour, etc ...), Western Digital WD TV HD Player, Mede8er or Dune need a background image to browse movies on the player.
Even if you want to browse your movies quickly with explorer have an image with the record of the movie is very comfortable
TViXie http://www.tvixie.com/ is a program that is designed for that but has no function database although it has a good GUI editor of templates .
With the PVD export Template attached and renaming the exported images at TViXie equivalents (front_cover.tvixie, fanart.tvixie) with RenameMaster you can transfer information from Personal Video Database to TViXie .

Note: A humble request, if PVD could exploit the format of TViXie Templates for HTML export would not need to do this step and could exploit TViXie GUI editor for PVD. (I tried to do a translator TViXie XLM -> PVD HTML template but i do not have enough knowledge of htlm).

7
Scripts and Templates / Script: FilmAffinity [ES] (Easy Script)
« on: January 17, 2014, 06:29:06 pm »
I attached my script to scrape the information of the web Spanish FilmAffinity. If you want to try use the name of movies in Spanish  "La vida de Pi"="Life of Pi" (finds at first) or "Padrino"="Godfather" to search by list (the script no handles advanced search).
On the other hand I tried to make it as easy as possible to understand for subsequent public use. It also includes an example so that it can adapt. I copy the introduction of Script:
"  This is a script designed to be easy to understand and to adapt. For this reason may be missing some fields and
  the programming may not be smart. It's a only "One Pass" Script and get data in WEB SECUENTIAL ORDER.
  The Personal Video Data field names in comments are enclosed in "~" so they are easier to find in the script.
  The WEB_SPECIFIC comentary points out the specific text for Web fields.
  Use with your editor's search function to find applicable code sections and adapt script."
 (Edito: New version down)

Pages: [1]
anything