Discussion:
[Xmltv-devel] new grabber (HR)
Josip Makarevic
2014-05-12 09:52:10 UTC
Permalink
Hi guys,

I'm kinda new to this so forgive me if I'm doing something wrong.
I'm using xmltv and gonix source is just out of date and I had to do
something about it.
I've found this one http://mojtv.hr/xmltv/
The thing is that it uses ASP http://mojtv.hr/xmltv/service.ashx?kanal_id=
*1*&date=*12.5.2014.*<http://mojtv.hr/xmltv/service.ashx?kanal_id=1&date=12.5.2014.>for
specific channel so I had to write my own xml file that
looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<tv source-data-url="http://mojtv.hr/xmltv/" source-info-name="Phazer XML
servis 4.5" source-info-url="http://mojtv.hr/xmltv/">
<channel id="1">
<display-name>HTV1</display-name>
<url>http://mojtv.hr/xmltv/service.ashx?kanal_id=1&amp;date=
</url>
</channel>
<channel id="2">
<display-name>HTV2</display-name>
<url>http://mojtv.hr/xmltv/service.ashx?kanal_id=2&amp;date=
</url>
</channel>

Then I had to put that xml somewhere where I can download it from and
modify the grabber (it's a copy of tv_grab_hr called tv_grab_hr_mojtv) and
here is the code:

128c128
< my $default_root_url = 'http://www.gonix.net/xmltv/channels.xml.gz';
---
my $default_root_url = 'http://www.nevermind.com/download/listing2.xml';
132c132
< grabber_name => "tv_grab_hr",
---
grabber_name => "tv_grab_hr_mojtv",
138c138
< description => "Croatia",
---
description => "Croatia-mojtv",
201a202,203
#t "YOMG: $url";
#t "YOMG: $channel_id";
204c206
< UnixDate( $date, "%Y-%m-%d" ) . "." );
---
UnixDate( $date, "%d.%m.%Y" ) . "." );
218c220
< # All data fetched ok.
---
# All data fetched ok.ž1
381,382c383,386
< my $url = $rooturl . $channel_id . "_" . UnixDate( $date, "%Y-%m-%d"
) .
< ".xml.gz";
---
# my $url = $rooturl . $channel_id . "_" . UnixDate( $date, "%d.%m.%Y"
) .
# ".";
my $url = $rooturl . UnixDate( $date, "%d.%m.%Y" ) . "." ;
#print $url;
So what I was hoping that someone, who is better devel than I am, will take
a look into it and maybe find a way to make it even better. But this semi
automatic version is working well for me.

Thanks, and If someone needs some help feel free to ask.


Best regards,
J.
h***@gmail.com
2014-05-19 10:17:20 UTC
Permalink
On Mon, 12 May 2014 11:52:10 +0200, Josip Makarevic wrote:
[snip info on proposed data source http://mojtv.hr/xmltv/ ]

Hi,

Thanks for the info. I've had a look at this and it's not practical to write an automatic grabber for this site at the moment.

The XMLTV data for the tv guide looks ok :-) but I couldn't find an XML list of all the channels. All they seem to have is the html on the front page ( http://mojtv.hr/xmltv/ ). Normally this wouldn't be a problem to parse out the channel ids but unfortunately the channel ids *inside* the xmltv files do not match this html.

E.g. the front page lists
id= 247 name= 24Kitchen

but the xmltv file says
id= 24kitch.eu name= 24Kitchen

There is no way to get from 247 (which is needed to get the xmltv data file) to 24kitch.eu (which is needed by "--list-channels") without reading each and every xmltv file. (Or maintaining the data manually, but that becomes a chore!)

If they could provide an XMLTV file listing all the channel ids (like http://www.gonix.net/xmltv/channels.xml.gz does) and including a cross-reference between xmltv id ("24kitch.eu") and url id ("247") then it would be simple to write a grabber for this site.

Perhaps you would like to contact the site and ask if they would provide a suitable channels.xml file?

Regards,
Geoff
Josip Makarevic
2014-05-19 11:40:41 UTC
Permalink
Hi,

Yes, it's a shame that they don't have list of all channels in xml.gz
format. I can give you mine, that I generated "manually" if that helps.
I'll see if I can write some helper script that can generate xml file from
site.
I'll write them an email regarding full channel list.


Regards,
Josip
Post by h***@gmail.com
[snip info on proposed data source http://mojtv.hr/xmltv/ ]
Hi,
Thanks for the info. I've had a look at this and it's not practical to
write an automatic grabber for this site at the moment.
The XMLTV data for the tv guide looks ok :-) but I couldn't find an XML
list of all the channels. All they seem to have is the html on the front
page ( http://mojtv.hr/xmltv/ ). Normally this wouldn't be a problem to
parse out the channel ids but unfortunately the channel ids *inside* the
xmltv files do not match this html.
E.g. the front page lists
id= 247 name= 24Kitchen
but the xmltv file says
id= 24kitch.eu name= 24Kitchen
There is no way to get from 247 (which is needed to get the xmltv data
file) to 24kitch.eu (which is needed by "--list-channels") without
reading each and every xmltv file. (Or maintaining the data manually, but
that becomes a chore!)
If they could provide an XMLTV file listing all the channel ids (like
http://www.gonix.net/xmltv/channels.xml.gz does) and including a
cross-reference between xmltv id ("24kitch.eu") and url id ("247") then
it would be simple to write a grabber for this site.
Perhaps you would like to contact the site and ask if they would provide a
suitable channels.xml file?
Regards,
Geoff
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform
available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
xmltv-devel mailing list
https://lists.sourceforge.net/lists/listinfo/xmltv-devel
h***@gmail.com
2014-05-21 06:53:08 UTC
Permalink
Post by Josip Makarevic
I'll write them an email regarding full channel list.
Cool. Let me know how you get on. It would be good if they can provide a channels xml file and cross-reference between the station id and channel id, but if they won't play then we'll find another way of doing it.

Geoff

Loading...