Problem using xmltv

Forum rules
Get Help using the Schedules Direct service. NOTE: application issues are probably better resolved via the application's support methods. If you post here, at least include your application name!

Problem using xmltv

Postby CFGuy1 » Mon Jun 08, 2015 9:18 am

I've been using xmltv to download an xml file from my Schedules Direct account.
When I use:
xmltv tv_grab_na_dd --days 1 --offset 0 --output filename
I get todays listings which is expected.

If I use
xmltv tv_grab_na_dd --days 1 --offset 1 --output filename
I get yesterdays listings. If should be tomorrows listings.

Any number over 1 for offset returns only a list of channels with no programs.
CFGuy1
 
Posts: 4
Joined: Mon Jun 08, 2015 9:07 am

Re: Problem using xmltv

Postby rmeden » Mon Jun 08, 2015 6:08 pm

very strange...

Try the --list-times parameter to tv_grab_na_dd to help with debugging.
rmeden
SD Board Member
 
Posts: 1511
Joined: Tue Aug 14, 2007 2:31 pm
Location: Cedar Hill, TX

Re: Problem using xmltv

Postby CFGuy1 » Tue Jun 09, 2015 7:12 pm

I'm not sure what to look for in the file when using --list-times.


I ran three tests.

xmltv.exe tv_grab_na_dd --days 1 --offset 1 --list-times --output "C:\Program Files\HomeSeer HS3\data\hstv\listings\tv_grab_na_dd20150610.xml"
The programs has starttime of programme start="20150608080000 -0500" stop="20150608100000 -0500"
Timezone is -0500
adding '--share=C:/Program Files/HomeSeer HS3/Data/HSTV/xmltv/share/xmltv'
using config filename ./.xmltv/tv_grab_na_dd.conf
blockedTime |2015-06-10T02:55:56Z
suggestedTime |2015-06-10T22:21:56Z
Fetching from Schedules Direct Fetched 2881 k/bytes in 4 seconds
loading data: ##################################################
NOTE: Your subscription will expire: 2016-05-06T23:25:20Z
Writing schedule: #################################################
Downloaded 3200 programs in 22 seconds

xmltv.exe tv_grab_na_dd --days 1 --offset 2 --list-times --output "C:\Program Files\HomeSeer HS3\data\hstv\listings\tv_grab_na_dd20150611.xml"
The first program has programme start="20150607210000 -0500" stop="20150607220000 -0500"
Timezone is -0500
adding '--share=C:/Program Files/HomeSeer HS3/Data/HSTV/xmltv/share/xmltv'
using config filename ./.xmltv/tv_grab_na_dd.conf
blockedTime |2015-06-10T02:57:00Z
suggestedTime |2015-06-10T17:15:00Z
Fetching from Schedules Direct Fetched 604 k/bytes in 2 seconds
loading data: ##################################################
NOTE: Your subscription will expire: 2016-05-06T23:25:20Z
Writing schedule: #################################################
Downloaded 611 programs in 6 seconds

xmltv.exe tv_grab_na_dd --days 1 --offset 3 --list-times --output "C:\Program Files\HomeSeer HS3\data\hstv\listings\tv_grab_na_dd20150612.xml"
There is no program info at all. Just the list of channels from my lineup.
Timezone is -0500
adding '--share=C:/Program Files/HomeSeer HS3/Data/HSTV/xmltv/share/xmltv'
using config filename ./.xmltv/tv_grab_na_dd.conf
blockedTime |2015-06-10T03:02:01Z
suggestedTime |2015-06-10T22:04:01Z
Fetching from Schedules Direct Fetched 20 k/bytes in 1 seconds
loading data: ##################################################
NOTE: Your subscription will expire: 2016-05-06T23:25:20Z
Writing schedule:
Downloaded 0 programs in 3 seconds
CFGuy1
 
Posts: 4
Joined: Mon Jun 08, 2015 9:07 am

Re: Problem using xmltv

Postby rmeden » Tue Jun 09, 2015 9:22 pm

Sorry, the poorly named "--list-times" gives the suggested download ( I don't remember the reason for using that, but I'm sure I had one).

--debug Will print the start/stop time in the request

Keep in mind that dates may act differently before/after midnight UTC. I think the math is only done in UTC.
rmeden
SD Board Member
 
Posts: 1511
Joined: Tue Aug 14, 2007 2:31 pm
Location: Cedar Hill, TX

Re: Problem using xmltv

Postby CFGuy1 » Tue Jun 09, 2015 10:44 pm

I ran the downloads again with --debug.
It looks like the offset is being subtracted instead of added to the current date.
I ran offset 0,1,2 and 7. The date for offset of 7 is 06/03/2015. I ran it on the 10th. Due to the Time Zone difference I could see being off by a day during the 5 hours that my time zone is behind date wise but I wouldn't think it would be off by 7 days.

xmltv.exe tv_grab_na_dd --days 1 --offset 0 --debug --output "C:\Program Files\HomeSeer HS3\data\hstv\listings\tv_grab_na_dd20150610.xml"

Timezone is -0500
adding '--share=C:/Program Files/HomeSeer HS3/Data/HSTV/xmltv/share/xmltv'
using config filename ./.xmltv/tv_grab_na_dd.conf
blockedTime |2015-06-10T02:57:00Z
suggestedTime |2015-06-10T17:15:00Z
Fetching from Schedules Direct Fetched 604 k/bytes in 2 seconds
loading data: ##################################################
NOTE: Your subscription will expire: 2016-05-06T23:25:20Z
Writing schedule: #################################################
Downloaded 611 programs in 6 seconds



xmltv.exe tv_grab_na_dd --days 1 --offset 1 --debug --output "C:\Program Files\HomeSeer HS3\data\hstv\listings\tv_grab_na_dd20150611.xml"

Timezone is -0500
adding '--share=C:/Program Files/HomeSeer HS3/Data/HSTV/xmltv/share/xmltv'
using config filename ./.xmltv/tv_grab_na_dd.conf
Using TZ=<-0500> offset=<-18000>
dd_start: 2015060900:00:01,2015-06-09T05:00:01Z
dd_stop : 2015061000:00:01,2015-06-10T05:00:01Z
Fetching from Schedules Direct
dd_data is in C:\Users\Jeff\AppData\Local\Temp\tv_grab_na_dd_k_ro.tmp
Fetched 3263 k/bytes in 3 seconds
loading data: ##################################################
NOTE: Your subscription will expire: 2016-05-06T23:25:20Z
Writing schedule: #################################################
Downloaded 3240 programs in 24 seconds


xmltv.exe tv_grab_na_dd --days 1 --offset 2 --debug --output "C:\Program Files\HomeSeer HS3\data\hstv\listings\tv_grab_na_dd20150612.xml"

Timezone is -0500
adding '--share=C:/Program Files/HomeSeer HS3/Data/HSTV/xmltv/share/xmltv'
using config filename ./.xmltv/tv_grab_na_dd.conf
Using TZ=<-0500> offset=<-18000>
dd_start: 2015060800:00:01,2015-06-08T05:00:01Z
dd_stop : 2015060900:00:01,2015-06-09T05:00:01Z
Fetching from Schedules Direct
dd_data is in C:\Users\Jeff\AppData\Local\Temp\tv_grab_na_dd_TE02.tmp
Fetched 2881 k/bytes in 3 seconds
loading data: ##################################################
NOTE: Your subscription will expire: 2016-05-06T23:25:20Z
Writing schedule: #################################################
Downloaded 3200 programs in 23 seconds


xmltv.exe tv_grab_na_dd --days 1 --offset 7 --debug --output "C:\Program Files\HomeSeer HS3\data\hstv\listings\tv_grab_na_dd20150617.xml"

Timezone is -0500
adding '--share=C:/Program Files/HomeSeer HS3/Data/HSTV/xmltv/share/xmltv'
using config filename ./.xmltv/tv_grab_na_dd.conf
Using TZ=<-0500> offset=<-18000>
dd_start: 2015060300:00:01,2015-06-03T05:00:01Z
dd_stop : 2015060400:00:01,2015-06-04T05:00:01Z
Fetching from Schedules Direct
dd_data is in C:\Users\Jeff\AppData\Local\Temp\tv_grab_na_dd_m__m.tmp
Fetched 20 k/bytes in 2 seconds
loading data: ##################################################
NOTE: Your subscription will expire: 2016-05-06T23:25:20Z
Writing schedule:
Downloaded 0 programs in 2 seconds
CFGuy1
 
Posts: 4
Joined: Mon Jun 08, 2015 9:07 am

Re: Problem using xmltv

Postby rmeden » Wed Jun 10, 2015 10:52 pm

This is the code in question:
Code: Select all
    my $start = DateCalc("00:00:01","+ $opt_offset days")

Of course that section of code hasn't changed in over a decade. Date::Manip may not be perfect, but surely it would get *THAT* right!

I had a XMLTV.EXE from 2014 lying around and it worked fine.

I rebuilt xmltv.exe and it seems to work. http://alpha-exe.xmltv.org

Sorry for not believing the problem! Very, Very strange!
rmeden
SD Board Member
 
Posts: 1511
Joined: Tue Aug 14, 2007 2:31 pm
Location: Cedar Hill, TX

Re: Problem using xmltv

Postby CFGuy1 » Thu Jun 11, 2015 12:21 pm

I downloaded xmltv from the link you posted and ran it this morning.
The offset is working as expected.

Thank you!!
CFGuy1
 
Posts: 4
Joined: Mon Jun 08, 2015 9:07 am


Return to Support

Who is online

Users browsing this forum: No registered users and 6 guests