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 » Thu Mar 13, 2008 3:39 pm

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 » Thu Mar 13, 2008 6:42 pm

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 » Thu Mar 13, 2008 9:41 pm

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 » Sat Mar 15, 2008 8:25 pm

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 » Sun Mar 16, 2008 2:42 pm

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 » Sun Mar 30, 2008 5:13 pm

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