Danish ONTV will only download once

Discussion of Version 3 and developing lua grabbers
Post Reply
Alf69
Posts: 5
Joined: Thu Mar 13, 2008 2:53 pm

Danish ONTV will only download once

Post by Alf69 »

Even though I've already made a temporary solution to this problem, I'm going to post it anyway. Mainly because others could have the same problem, but also to give you a chance to make a permanent solution. I'm using XMLTV GUI 3.09.03W
The problem is, that the first time I downloaded the xmltv file from ontv.dk it worked fine, but all later attempts would just recycle the first download.
When pressing "Grab Listings" I get the following log:

14:42:39 - Starting pass 1 of grabber DK_ONTV
14:42:39 - Downloading http://ontv.dk/xmltv/(deleted: my personal site)
14:42:39 - Processing XML
14:42:40 - Finished pass 1 of grabber DK_ONTV
14:42:40 - 4091 programs found
14:42:40 - Combining Grabber Programs
14:42:40 - Finished Combining Grabber Programs
14:42:40 - Writing XML
14:42:41 - XML Written

As you can see there is no line saying "Clearing cache". I found out, that if I deleted the cache file, it would work, but since it is not practical to do this manually every day, I made the following batch file, witch will delete the cache and start XMLTV GUI with the /grab parameter:

CD "C:\Programmer\XMLTV GUI\cache\DK_ONTV"
DEL "C:\Programmer\XMLTV GUI\cache\DK_ONTV\*.*" /F /Q
CD "C:\Programmer\XMLTV GUI\"
START XmltvGUI.exe /GRAB

(Copy/paste to notepad, change paths to your system, save as yourname.bat.)
Even though it works now, it's not a very elegant solution, and the function should be in the program, not in a batch file.
If you need to test it, ontv.dk has a xmltv test site called:
http://ontv.dk/xmltv/c81e728d9d4c2f636f067f89cc14862c
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Post by alanbirtles »

the clearing cache statement is just when the grabber deletes unused cache files, this is not relevant to the ontv grabber as it only uses one file. If you arent downloading more than once a day simply disable the cache by changing:

Code: Select all

local page,err = HTTP.Get(URL,grabber,_,_,hash(URL),1)
to

Code: Select all

local page,err = HTTP.Get(URL,grabber)
in dk_ontv.lua
I have been meaning to change the caching behaviour to 23 hours instead of 1 day (if you download at exactly the same time each day it will only download every other day at the moment)
Alf69
Posts: 5
Joined: Thu Mar 13, 2008 2:53 pm

Post by Alf69 »

Thanks for the quick reply, it works perfect now.
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Post by alanbirtles »

i have already implemented the 22 hours instead of 1 day caching so i dont see why you were having a problem. doesnt ontv prevent you from downloading more than once a day? this is why i didn't make the cache disable in the first place
Alf69
Posts: 5
Joined: Thu Mar 13, 2008 2:53 pm

Post by Alf69 »

I may have been a bit impatient getting it to work. The first 4 days you can download as many times as you want from ontv for testing purposes, after that only once a day. During the testing I chose some channels, downloaded, made some adjustments, chose some more channels, downloaded again from ontv, but just couldn't get the new channels I had chosen. In one of the other posts someone had posted his grab log and I noticed the Clearing Cashe statement. I tried to delete the cashe file, and it suddenly worked. Not knowing anything about the 1 day or 22 hour cashing, I assumed it was a bug and posted this topic.
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Re: Danish ONTV will only download once

Post by alanbirtles »

the latest svn version of the script now has an option to turn the cache on or off https://www.birtles.org.uk/svn/xmltv/co ... k_ontv.lua
Post Reply