Extra Digiguide Data

Discussion of Version 3 and developing lua grabbers
Post Reply
rickgillyon
Posts: 34
Joined: Wed Oct 25, 2006 12:20 pm

Extra Digiguide Data

Post by rickgillyon » Fri Oct 31, 2008 9:50 am

Hi Alan,

I'm using the Digiguide Grabber, and it's working well generally. However, DG2XML gives me some extra items in the XML, i.e.:

Code: Select all

    <audio>
      <stereo>Stereo</stereo>
    </audio>
    <video>
      <aspect>16:9</aspect>
    </video>
    <subtitles type = "teletext"/>
    <subtitles type = "onscreen"/>
    <rating system = "BBFC">
      <value>U</value>
    </rating>
    <star-rating>
      <value>2/5</value>
    </star-rating>
Is there any chance of getting these from the Grabber? If not, any pointer how they could be added by someone such as me? :D

BTW, saw a small problem with the data handling this week: in one description the was something along the lines of "Bob tries to sell his B&B; what sort of sad sack watches this stuff?". Looks like the grabber saw the ampersand but didn't replace it, probably because of the following semicolon (I'm guessing!). Normally I assume it would always replace these with "&".

Thanks as ever,
Rick

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

Re: Extra Digiguide Data

Post by alanbirtles » Fri Oct 31, 2008 11:00 am

I will have a look at the ampersand handling, it does indeed nievely assume that an ampersand followed less than 3 characters later by a semicolon is an escape sequence.
The simplest way to get the extra details would be to download the data using dg2xml and then import the xml into XMLTV GUI. To do it properly you would need to edit lib\xmltv_parse.lua. If you do make any digiguide changes then be sure to wrap the relevant sections with "if digiguideMode then". If you get it working then please upload the new file here and I will add it to the next release

rickgillyon
Posts: 34
Joined: Wed Oct 25, 2006 12:20 pm

Re: Extra Digiguide Data

Post by rickgillyon » Fri Oct 31, 2008 11:08 am

Unfortunately DG2XML gives errors in the data (incorrect episode numbers) for me, so I need to use your grabber. I'll have a look at lib\xmltv_parse.lua as you suggest, but the last time I looked it was all Greek to me... ;)

Thanks!

rickgillyon
Posts: 34
Joined: Wed Oct 25, 2006 12:20 pm

Re: Extra Digiguide Data

Post by rickgillyon » Mon Nov 03, 2008 12:01 pm

Had a look at this, unfortunately I can't really make sense of it all. Read a little of the LUA manual, but really couldn't sort out where the data is after the grab, seeing its content and how to manipulate it. Duh. :?

If anyone reading is able to have a go, it would be appreciated, or even a starter for me to look at it - where and what I would need to change, etc. Otherwise I'm sure I'll manage without the extra data! :D

Thanks,
Rick

rickgillyon
Posts: 34
Joined: Wed Oct 25, 2006 12:20 pm

Re: Extra Digiguide Data

Post by rickgillyon » Wed Nov 05, 2008 12:08 am

:oops:

Serves me right for not searching first. I had another problem with HTTP Protocol Errors, so searched for it (ended up fixing by just collecting 2 channels at a time). Anyway, while searching I came across a post (by Alan) saying that there was a version of xmltv_parse.lua in SVN that included most of the extra Digiguide items - and sure enough, it's working!

Thanks for the great software Alan, even if you forgot about that change! :lol:

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

Re: Extra Digiguide Data

Post by alanbirtles » Tue Nov 11, 2008 10:48 pm

I thought I had released everything that I had done recently!

rickgillyon
Posts: 34
Joined: Wed Oct 25, 2006 12:20 pm

Re: Extra Digiguide Data

Post by rickgillyon » Wed Nov 12, 2008 10:13 am

The comments did post-date the note in the thread that changes were in the latest release...

There is a problem with Part numbers and the importer I use (e.g. with Digiguide "The Commander" this week had three episodes as S5.1, but with "Part 1 of 3" in the sub-title). My importer sees this as the same episode as it bases it on the ep numbers, Stephane says it should be like:
Part 1 of 3 is: 4.0.0/3

Do you think this is possible? I'm happy to puzzle at it for a week or so before giving up... :lol:
Would it be best in xmltv_parse.lua or a post-processor?

Thanks,
Rick

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

Re: Extra Digiguide Data

Post by alanbirtles » Wed Nov 12, 2008 11:07 am

this would probably be best in a post processor

rickgillyon
Posts: 34
Joined: Wed Oct 25, 2006 12:20 pm

Re: Extra Digiguide Data

Post by rickgillyon » Wed Nov 12, 2008 11:32 pm

Okay, this seems to be working now, producing the results expected. Can't test it too widely, as there only seems to be a couple of shows with Eps and Parts, works so far. Would appreciate it if someone could eyeball my string.find sytax as I'm guessing... :)

Edit: removed the "Part" stuff from the subtitle as well as fixing the Ep Numbers...

Code: Select all

require("XGUI_Lib")

local function Pass1Func(proc,program)
	local str
	XGUI.SetStatus(2,"Processing "..XGUI_Lib.XS.Val(program.Title))

	if program.Episode and program.Sub_Title and (not string.find(program.Episode.Number,"/")) then
		local _,_,newsub,newpart,newtot = string.find(program.Sub_Title,"(.*) %(Part (%d-) of (%d-)%)");

		if newpart and newtot then
			str = program.Episode.Number..(newpart-1).."/"..(newtot)
			program.Episode.Number = str
			program.Sub_Title = newsub
		end
	end
	return program
	end

PostProcs.UK_Digi_Part={
	Name = "Digi",
	Version = "1.00.00",
	Author = "Rick Gillyon",
	InfoURL = "http://www.birtles.org.uk/xmltv/",
	Grabber = "UK_Digi",
	Passes={
		Pass1={
			Type=XGUI.PassTypes.Program,
			Func=Pass1Func,
			},
		},
	}

Post Reply