Not all data grabbed from DigiGuide

Discussion of Version 3 and developing lua grabbers
Post Reply
mortstar
Posts: 4
Joined: Mon Aug 11, 2008 3:16 pm

Not all data grabbed from DigiGuide

Post by mortstar » Wed Mar 04, 2009 1:48 am

Hi, I posted this on the SageTV - DG2XML Forum but I thing it may have been deleted for mentioning MediaPortal - which is a shame.

I'm using DG2XML and XMLTV GUI (thanks!) to create an xmltv file for import into MediaPortal. I've begun playing around with the Program Detail postprocessor and wanted to suffix the program description with some video-metadata, as Digiguide provides data as to whether the program is widescreen or HD etc.

I've looked at the xml file created by XMLTV GUI and the audio and video metadata is not being downloaded from Digiguide. For example this program in Digiguide:
Image

Produces this data from XMLTV GUI:

Code: Select all

<programme start="20090305031500 +0000" stop="20090305041500 +0000" channel="441">
<title>Christianity: A History</title>
<desc>Eminent scientist Colin Blakemore examines Christianity&apos;s relationship with science. He argues that science is the biggest challenge Christianity has ever faced, and questions whether the fundamental tension between the two can ever be resolved. Or will science eventually make religion redundant?</desc>
<category>Religious</category>
<previously-shown/>
<subtitles type="teletext"></subtitles>
</programme>
Is this normal behaviour or is there something I am missing? Any help, as always, very much appreciated!

alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Re: Not all data grabbed from DigiGuide

Post by alanbirtles » Wed Mar 04, 2009 8:34 am

i'm not processing those elements. if you look in lib\xmltv_parse.lua from line 352 onwards. i cant really do much myself as my digiguide subscription has expired

mortstar
Posts: 4
Joined: Mon Aug 11, 2008 3:16 pm

Re: Not all data grabbed from DigiGuide

Post by mortstar » Wed Mar 04, 2009 7:59 pm

Thanks Alan for pointing me the right way. I've got the tags I want (HD or not, Part x of y ) in to descriptions. Having a bit of a problem with a cosmetic change I'd like to make.

I'd like Programme Details to convert 'Part 1 of 3' to just display as 1/3 (or 1 of 3 if '/' is not a valid character). I'm okay following the logic in lua to move things around but this manipulation of strings would probably take me an age.

I'm looking at functions like this in the code:
local function splitEpisodeNumString(str)
if string.find(str,"%/") then
local _,_,a,b = string.find(str,"%s*(%d*)%s*%/%s*(%d*)%s*")
a = tonumber(a)
b = tonumber(b)
if a and b then
if ShortEpisodeForm then
return (a+1).."/"..b
else
return (a+1).." of "..b
end
end
end
local num = tonumber(str)
if num then
return num+1
else
return ""
end
end
the highlighted bit is the one I just can't work out.

alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Re: Not all data grabbed from DigiGuide

Post by alanbirtles » Wed Mar 04, 2009 8:11 pm

for more information about string patterns see http://www.lua.org/pil/20.2.html.
The pattern means find any number of whitespace characters (%s*, %=white space *=0 or more times), folowed by any number of numbers (%d*) followed by whitespace followed by a slash (%/) followed by whitespace, numbers and more whitespace. The brackets represent captures. The first results are the locations in the string where the captues are found (we dont need these so they are both assigned to "_" (ignored)), the next results are the contents of the captures.

Post Reply