You are here

Local MDB database

14 posts / 0 new
Last post
myraspxbmc
Offline
Joined: 1 year
Last seen: 9 months
Local MDB database

Is possible to write a MDB ini file for local database storage?

The idea is to have a “xml” file with some data to be parse from some programs, or a lot, something like:

Local database storage:

LocalDatabase.ini

LocalDatabase.xml

For search we can use title match…

Then in local database some fields:

<?xml version="1.0" encoding="UTF-8"?>

<tv generator-info-name="WebGrab+Plus/w MDB &amp; REX Postprocess -- version V1.56.28 -- Jan van Straaten" generator-info-url="http://www.webgrabplus.com">

   <programme>

 <title lang="xx"> </title>

  <credits>

      <director>blah</director>

      <actor>a</actor>

      <actor>b</actor>

    </credits>

 < category ></ category >

    <video>

      <aspect>16:9</aspect>

    </video>

    <rating system="MPAA">

      <value>PG</value>

      <icon src="http://www.webgrabplus.com/pg_symbol.png" />

    </rating>

    <star-rating>

      <value>3/3</value>

    </star-rating>

  </programme>

</tv>

Will be cool…

 

 

Blackbear199
Offline
Joined: 2 years
Last seen: 6 hours

i dont think i would go the mdb way as it uses custom stuff for select/matches specific to mdb.

i think i could do it with a modified fixed.ini though.

you would add your entry to you webgrab++.config.xml like this(as a normal fixed.ini entry)..

<channel update="f" site="fixed" site_id="00:00-23:59##title:Full Day Show####" xmltv_id="Movie Name">Movie Name</channel>

then with the fixed.ini we read the start/stop and the title and then search the database.xml for a match and get the details

using index_urlshow {file://..} for the details page.

if you could crate a small database for a few programs i could make the changes.

also this can already be done using fixed.ini but the entries all have to be done manually.read the fixed_info.txt file for the fixed.ini

you could also do multiple databases,example movies,series,italy,hungary,ect

this makes finding the data faster but even as 1 huge file it still be pretty fast as the database is a local file.

 

 

myraspxbmc
Offline
Joined: 1 year
Last seen: 9 months

Great !!!

I will do some example database from 1 channel query.

Stay tune.. :)

myraspxbmc
Offline
Joined: 1 year
Last seen: 9 months

If I understand you right you mean something like this:

Please correct if I’m wrong… :)

Quote:

telenovelas.pt.ini

"todo do"
telenovelas.pt.xml:

<channel update="f" site="fixed" site_id="14:45-16:00##title:Laços de Sangue####" xmltv_id="Laços de Sangue">Laços de Sangue</channel>
<channel update="f" site="fixed" site_id="19:15-19:57##title:Sassaricando####" xmltv_id="Sassaricando">Sassaricando</channel>
<channel update="f" site="fixed" site_id="21:45-22:30##title:Amor Maior####" xmltv_id="Amor Maior">Amor Maior</channel>

database.xml:

<xmltv_id="Laços de Sangue">
 <title lang="pt">Laços de Sangue</title>
  <credits>
      <director>Pedro Lopes</director>
      <actor>Diana Chaves</actor>
      <actor>Joana Santos</actor>
    </credits>
 <category>Telenovela</category>
    <video>
    <aspect>16:9</aspect>
    </video>
    <rating system="PT">
      <value>12AP</value>
      <icon src="http://www.webgrabplus.com/local/12ap.png" />
    </rating>
    <star-rating>
      <value></value>
    </star-rating>
<imdb_id>
      <value>tt1700448</value>
</imdb_id>
</xmltv_id>

<xmltv_id="Amor Maior">
    <title lang="pt">Amor Maior</title>
<credits>
      <director>Inês Gomes</director>
      <actor>Sara Matos</actor>
      <actor>Catarina Rebelo</actor>
      <actor>Inês Castel-Branco</actor>
</credits>
    category>Telenovela</category>
<video>
    <aspect>16:9</aspect>
</video>
    <rating system="PT">
<value>12AP</value>
<icon src="http://www.webgrabplus.com/local/12ap.png" />
    </rating>
<star-rating>
    <value></value>
</star-rating>
<imdb_id>
      <value>tt5845202</value>
</imdb_id>
</xmltv_id>

<xmltv_id="Sassaricando">
    <title lang="pt">Sassaricando</title>
<credits>
      <director>Teresa Lampreia</director>
      <actor>Tatá Werneck</actor>
      <actor>Mariana Ximenes</actor>
      <actor>Agatha Moreira</actor>
</credits>
    category>Telenovela</category>
<video>
    <aspect>16:9</aspect>
</video>
    <rating system="PT">
<value>12AP</value>
<icon src="http://www.webgrabplus.com/local/12ap.png" />
    </rating>
<star-rating>
    <value></value>
</star-rating>
<imdb_id>
      <value>tt2362064</value>
</imdb_id>
</xmltv_id>

</tv>

Blackbear199
Offline
Joined: 2 years
Last seen: 6 hours

no.. for your data base entry you posted above(first post),example..

also put everything in one database file,i think its easier this way.

<programme>
    <title lang="en">Get Santa</title>
    <desc lang="en">An ex-convict trying to reconnect with his son discovers Santa Claus hiding in his garden shed, having crashed his new sleigh. Father and son try to help him get safely home back to Lapland, but end up on the run from the police when an attempt to recover his missing reindeer lands Santa behind bars. Festive comedy, starring Jim Broadbent, Rafe Spall and Warwick Davis</desc>
    <credits>
      <director>Christopher Smith</director>
      <actor>Ewen Bremner</actor>
      <actor>Joanna Scanlan</actor>
      <actor>Rafe Spall</actor>
      <actor>Kit Connor</actor>
      <actor>Stephen Graham</actor>
      <actor>Warwick Davis</actor>
      <actor>Jim Broadbent</actor>
      <actor>Jodie Whittaker</actor>
    </credits>
    <date>2014</date>
    <category lang="en">Comedy</category>
 <video>
      <aspect>16:9</aspect>
    </video>
    <rating system="MPAA">
      <value>PG</value>
      <icon src="http://www.webgrabplus.com/%3Ca%20href%3D"http://www.webgrabplus.com/pg_symbol.png">http://www.webgrabplus.com/pg_symbol.png" />
    </rating>
    <star-rating>
      <value>3/3</value>
    </star-rating>
    </programme>
 <programme>
    <title lang="en">Ride Along 2</title>
  </programme>

then for your webgrab++config.xml

      <channel update="f" site="fixed_database" site_id="00:00-23:59##title:Get Santa####" xmltv_id="PPV 1">PPV 1</channel>

<channel update="f" site="fixed_database" site_id="00:00-23:59##title:Ride Along 2####" xmltv_id="PPV 2">PPV 2</channel>

notice here the start(00:00) and stop(23:59) time.this covers a full day(one show) so this would shows as 2 separate channel each with the above show playing from 00:00 to 23:59

so you get this..

<channel id="PPV 1">
    <display-name lang="en">PPV 1</display-name>
  </channel>
  <channel id="PPV 2">
    <display-name lang="en">PPV 2</display-name>
  </channel>
  <programme start="20161116000000 +0000" stop="20161116235900 +0000" channel="PPV 1">
    <title lang="en">Get Santa</title>
    <desc lang="en">An ex-convict trying to reconnect with his son discovers Santa Claus hiding in his garden shed, having crashed his new sleigh. Father and son try to help him get safely home back to Lapland, but end up on the run from the police when an attempt to recover his missing reindeer lands Santa behind bars. Festive comedy, starring Jim Broadbent, Rafe Spall and Warwick Davis</desc>
    <credits>
      <director>Christopher Smith</director>
      <actor>Ewen Bremner</actor>
      <actor>Joanna Scanlan</actor>
      <actor>Rafe Spall</actor>
      <actor>Kit Connor</actor>
      <actor>Stephen Graham</actor>
      <actor>Warwick Davis</actor>
      <actor>Jim Broadbent</actor>
      <actor>Jodie Whittaker</actor>
    </credits>
    <date>2014</date>
    <category lang="en">Comedy</category>
    <video>
      <aspect>16:9</aspect>
    </video>
    <rating>
      <value>PG</value>
      <icon src="http://www.webgrabplus.com/%3Ca%20href%3D"http://www.webgrabplus.com/pg_symbol.png">http://www.webgrabplus.com/pg_symbol.png" />
    </rating>
    <star-rating>
      <value>3/3</value>
    </star-rating>
  </programme>
  <programme start="20161116000000 +0000" stop="20161116235900 +0000" channel="PPV 2">
    <title lang="en">Ride Along 2</title>
  </programme>

you post above this one i assume these shows are the same channel but different times during the day?

you do multi shows like this...

say same 2 shows but on same channel,first one from 00:00-12:00 and second 12:00-23:59

 <channel update="f" site="fixed_database" site_id="00:00-12:00##title:Get Santa####12:00-23:59##title:Ride Along 2" xmltv_id="PPV 1">PPV 1</channel>

<channel id="PPV 1">
    <display-name lang="en">PPV 1</display-name>
  </channel>
  <programme start="20161116000000 +0000" stop="20161116120000 +0000" channel="PPV 1">
    <title lang="en">Get Santa</title>
    <desc lang="en">An ex-convict trying to reconnect with his son discovers Santa Claus hiding in his garden shed, having crashed his new sleigh. Father and son try to help him get safely home back to Lapland, but end up on the run from the police when an attempt to recover his missing reindeer lands Santa behind bars. Festive comedy, starring Jim Broadbent, Rafe Spall and Warwick Davis</desc>
    <credits>
      <director>Christopher Smith</director>
      <actor>Ewen Bremner</actor>
      <actor>Joanna Scanlan</actor>
      <actor>Rafe Spall</actor>
      <actor>Kit Connor</actor>
      <actor>Stephen Graham</actor>
      <actor>Warwick Davis</actor>
      <actor>Jim Broadbent</actor>
      <actor>Jodie Whittaker</actor>
    </credits>
    <date>2014</date>
    <category lang="en">Comedy</category>
    <video>
      <aspect>16:9</aspect>
    </video>
    <rating>
      <value>PG</value>
      <icon src="http://www.webgrabplus.com/%3Ca%20href%3D"http://www.webgrabplus.com/pg_symbol.png">http://www.webgrabplus.com/pg_symbol.png" />
    </rating>
    <star-rating>
      <value>3/3</value>
    </star-rating>
  </programme>
  <programme start="20161116120000 +0000" stop="20161116235900 +0000" channel="PPV 1">
    <title lang="en">Ride Along 2</title>
  </programme>

you can add as many shows to to day as you need(to cover all or part of the 24 hr period).

heres the ini

edit the url_index {url|file:///.....} path to your database.xml

the file format is url|file://  then your path,in the ini i use linux so its file:///path/to/file.xml

if your on windows its file://C:\path\to\file.xml

dont think the 3 /// for linux are a typo,they are not.

 

 

 

Attachments: 
myraspxbmc
Offline
Joined: 1 year
Last seen: 9 months

Yes these programs are form same channel in this case “SIC” from Portuguese TV.

I miss the time setting: “full day” LOL

Must study this well then do some real try….

If I understood the database fields are the fields from xmltv output, correct?

Blackbear199
Offline
Joined: 2 years
Last seen: 6 hours

how are you getting your database information?

entering it manually?

when i made the ini changes it set it to look for <programme>....</programme> for a show entry.

if your doing all this manually as i said earlier you could have used the existing fixed.ini and added anything you wanted without the hastle of creating a database.

if your using something to grab the database info from the net then i need a example of what the information looks like.

 

Blackbear199
Offline
Joined: 2 years
Last seen: 6 hours

so looking at you database example above its using..

<xmltv_id="xxxxx">

..

</xmltv_id>

 

for show entries.

so in the fixed_database.ini change this..

index_temp_8.modify {substring(type=regex)|'index_variable_element' "<programme>[^<]*<title lang=\"[^\"]*\">'index_title'<\/title>.*?<\/programme>"}

to

index_temp_8.modify {substring(type=regex)|'index_variable_element' "<xmltv_id[^>]*>[^<]*<title lang=\"[^\"]*\">'index_title'<\/title>.*?<\/xmltv_id>"}

then for you show entries..seeing they are all on the same channel..

<channel update="f" site="fixed" site_id="14:45-16:00##title:Laços de Sangue####19:15-19:57##title:Sassaricando####21:45-22:30##title:Amor Maior####" xmltv_id="Channel Name">Channel Name</channel>

Channel Name is the channel that these shows are on as it appears in your epg viewing software.

 

 

myraspxbmc
Offline
Joined: 1 year
Last seen: 9 months

I again thanks for your great help…

I’m doing this manually, basic the idea is add some programs that last from long time, to add info that normally don’t exist, and are always the same…

I will use your info on the post and then try to “fix” a sample from one channel, if all goes well I can try another and another until all EPG info where there :)

I will report later how things work :)

 

myraspxbmc
Offline
Joined: 1 year
Last seen: 9 months

Looks like this is not what I’m looking for if I understand correct the input of this...

Is very possible that I made myself not understand…

I do the test and give me this error:

Quote:

[Critical]    message: 
[Error   ] error in channel list of the config file!!
[Error   ]      duplicate xmltv_id value --  -- !!
[Error   ]      in :
[Error   ] <channel update="f" site="vodafone.pt" site_id="390" xmltv_id="SIC HD">SIC HD</channel>
[Error   ] <channel update="f" site="telenovelas.pt" site_id="14:45-16:00##title:Laços de Sangue####19:15-19:57##title:Sassaricando####21:45-22:30##title:Amor Maior####" xmltv_id="SIC HD">SIC HD</channel>
[Error   ] duplicate xmltv-id entries will mess-up the xmltv output!
[Error   ] ---- correct the channel-list to have unique xmltv-id values ---
[Critical] For detailed info, see log file WebGrab++.log.txt
[Critical] Execution stopped

Then I understand that fix is to add a new channel, without scrub it with full information likes his:

Quote:

  <programme start="20161117144500 +0000" stop="20161117160000 +0000" channel="SIC HD">
    <title lang="pt">Laços de Sangue</title>
    <desc lang="pt">A história gira em torno de duas irmãs, que há 25 anos, viram os seus destinos separados pela correnteza de um rio, tendo o pai salvo apenas a mais velha, Inês e morrido ao tentar salvar a outra, cujo corpo nunca chega a aparecer... até que se passam 25 anos(n)</desc>
    <icon src="http://www.webgrabplus.com/SIC%20HD_22207341/16_9/325/244" />
    <episode-num system="onscreen">E28</episode-num>
  </programme>

 

And the output I whant is something like this:

Quote:

  <programme start="20161117144500 +0000" stop="20161117160000 +0000" channel="SIC HD">
    <title lang="pt">Laços de Sangue</title>
    <desc lang="pt">A história gira em torno de duas irmãs, que há 25 anos, viram os seus destinos separados pela correnteza de um rio, tendo o pai salvo apenas a mais velha, Inês e morrido ao tentar salvar a outra, cujo corpo nunca chega a aparecer... até que se passam 25 anos(n)</desc>
    <icon src="http://www.webgrabplus.com/SIC%20HD_22207341/16_9/325/244" />
    <episode-num system="onscreen">E28</episode-num>
  <credits>
      <director>Pedro Lopes</director>
      <actor>Diana Chaves</actor>
      <actor>Joana Santos</actor>
    </credits>
 <category>Telenovela</category>
    <video>
    <aspect>16:9</aspect>
    </video>
    <rating system="PT">
      <value>12AP</value>
      <icon src="http://www.webgrabplus.com/12AP.png" />
    </rating>
    <star-rating>
      <value></value>
    </star-rating>
<imdb_id>
      <value>tt1700448</value>
</imdb_id>
  </programme>

Then if I think this correct, we can do a search using a file on MDB, something like you made with the fix ini?

If so by adding the ini file you made with some changes can we add this information to the output file?

Sorry for all that mess… But I still study this program and I’m not a coder…

One more time let me tell you, 

Thanks’ for your great help…

:)

 

 

Blackbear199
Offline
Joined: 2 years
Last seen: 6 hours

so your trying to add information to a existing program and not a totally new program?
this is what mdb was made for but i can pretty much gurantee you are not going to have any success with it.

if you look up that program on imdb one of the matches are..

http://www.imdb.com/title/tt1700448/?ref_=fn_al_tt_4

as you can see there nothing for season information.

so its going to get skipped as there not enough information for mdb to get a match.

 

Blackbear199
Offline
Joined: 2 years
Last seen: 6 hours

but if its not to many programs you wan to add some information to you do have another option,it may be time consuming but what about doing this..

open the vodafone.pt.ini file

at the bottom before the channels.xml creation section and before the end_scope add..this is for the show "Laços de Sangue" only.you would have to do the same thing for the information you want to add for every program for this site.

index_director.modify {set('index_title' "Laços de Sangue")|Pedro Lopes}

index_actor.modify {set('index_title' "Laços de Sangue")|Diana Chaves\|Joana Santos}

index_category.modify {set('index_title' "Laços de Sangue")|Telenovela}

index_videoaspect.modify {set('index_title' "Laços de Sangue")|16:9}

index_rating.modify {set('index_title' "Laços de Sangue")|12AP}

index_ratingicon.modify {set('index_title' "Laços de Sangue")|http://rest_of_web_addy}

index_starrating.modify {set('index_title' "Laços de Sangue")|6/10}

 

so all i'm doing is checking if the index_title matches the show you want to add the additional information.if it matches its added,if it doesnt its skipped.you need a section like this for every program on vodafone.pt that you want to add info to.just change the program name at the beginning that you compare the index_title to.

few notes:

if you only adding one piece of information as you can see on the end you just add it but for the actors for example you have 2 in this case.the \| inbetween the names makes the element multi value(list each actor name on a separate line).without this they would both be on the same line in one tag(<actor>name 1 name2</actor>).so if you want more than one value for a element add the \| as a separator between.it works exactly the same for any element,not just the actor in this case.

also if you look at vodafone.pt all this information your adding is not obtained from the site so you wont have any conflicts with information scrubbed from the site with the ini itself.for other sites you want to do this to you may,it depends on the site.you may have to do some trial and error.

also there is no element for <imdb_id>(or it hasnt been added to webgrab if it does exist) so there nothing we can do for the imdb number.you cound add it say to the end of the description though..

index_description.modify {addend('index_title' "Laços de Sangue")|Imdb: tt1700448}

 

myraspxbmc
Offline
Joined: 1 year
Last seen: 9 months

I like this new approach, you mention, I didn’t think this is possible, will try it.

Thanks

 

myraspxbmc
Offline
Joined: 1 year
Last seen: 9 months
Quote:

  <programme start="20161117144500 +0000" stop="20161117160000 +0000" channel="SIC HD">
    <title lang="pt">Laços de Sangue</title>
    <desc lang="pt">A história gira em torno de duas irmãs, que há 25 anos, viram os seus destinos separados pela correnteza de um rio, tendo o pai salvo apenas a mais velha, Inês e morrido ao tentar salvar a outra, cujo corpo nunca chega a aparecer... até que se passam 25 anos(n)</desc>
    <credits>
      <director>Pedro Lopes</director>
      <actor>Diana Chaves</actor>
      <actor>Joana Santos</actor>
    </credits>
    <category lang="pt">Telenovela</category>
    <icon src="http://www.webgrabplus.com/SIC%20HD_22207341/16_9/325/244" />
    <episode-num system="onscreen">E28</episode-num>
    <video>
      <aspect>16:9</aspect>
    </video>
    <rating system="Pt">
      <value>12AP</value>
      <icon src="http://www.webgrabplus.com/CPT-12AP.png" />
    </rating>
    <star-rating>
      <value>6/10</value>
    </star-rating>
  </programme>

 

Just perfect... :) :)

Log in or register to post comments

Brought to you by Jan van Straaten

Program Development - Jan van Straaten ------- Web design - Francis De Paemeleere
Supported by: servercare.nl