I've been following the discussion on a standardised config file format
and thought I'd throw my 2 cents in...
Firstly I think we may need more than a simple "channel=<channel_id>" line
per channel in the config file. Heres an example from tv_grab_au.conf:
+channel 251888 "ABC" 2
-channel 251862 "Southern Cross" 7
+channel 86169 "Nine" 9
This allows the grabber to know all channels that were available at the
time of configuration and what channels were selected by the user. This
info is handy so the grabber can tell with every run if a new channel has
become available for a region.
I also think its important to be able to specify a name and number for
each channel (the number could be optional). So in the above example a
user could easily change the name of "Southern Cross" to "SC" to help the
name fit inside the tv guide if they were using freevo.
In tv_grab_au, the 'channel number' option is used with the --dual-names
switch, which outputs something like this:
<channel id="251888.somesource.com.au">
<display-name lang="en">ABC</display-name>
<display-name>2</display-name>
<icon src="http://d1.com.au/icons/abc.png" />
</channel>
<channel id="251862.somesource.com.au">
<display-name lang="en">Southern Cross</display-name>
<display-name>7</display-name>
<icon src="http://d1.com.au/icons/7.png" />
</channel>
<channel id="86169.somesource.com.au">
<display-name lang="en">Nine</display-name>
<display-name>9</display-name>
<icon src="http://d1.com.au/icons/nine.png" />
</channel>
There are a few xmltv apps that make use of the two <display-name>
elements to figure out a name for a channel, and a number to tune to. Its
a shame there isnt a way to explictly state a number or frequency for each
channel in the current dtd as it would be a great feature.
Currently, if you run 'tv_grab_au --list-channels' the program will output
all channels found on the source website in xmltv format (im now not sure
if this to standard and instead it should just parse the config file and
output selected channels?). But this does bring up another point....
should we have say --list-channels, and --list-channels-source (or
something) so that --list-channels outputs channels in the config file,
and --list-channels-source output all channels from the source website?
(do/will apps want both this info?)
This feature can also be used by end user apps so they can list channels
for different regions without having to enter a config stage of the
grabber.
For another example this how tv_grab_au does its --list-channels thing:
[rohbags@... 0.6.2]$ ./tv_grab_au --list-channels
tv_grab_au - (version 0.6.2 - release 2005-05-31)
using config filename /home/rohbags/.xmltv/tv_grab_au.conf
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE tv SYSTEM "xmltv.dtd">
--loc option required with --list-channels:
--loc Canberra for ACT - Canberra
--loc NSWReg for NSW - Regional
--loc Sydney for NSW - Sydney
--loc Darwin for NT - Darwin
--loc NTReg for NT - Regional
--loc Brisbane for Queensland - Brisbane
--loc QLDReg for Queensland - Regional
--loc Adelaide for SA - Adelaide
--loc SAReg for SA - Regional
--loc Hobart for Tasmania - Hobart
--loc TASReg for Tasmania - Regional
--loc Melbourne for Victoria - Melbourne
--loc VICReg for Victoria - Regional
--loc Perth for WA - Perth
--loc WAReg for WA - Regional
So then i (or gui tool) run:
[rohbags@... 0.6.2]$ ./tv_grab_au --list-channels --loc Melbourne
tv_grab_au - (version 0.6.2 - release 2005-05-31)
using config filename /home/rohbags/.xmltv/tv_grab_au.conf
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE tv SYSTEM "xmltv.dtd">
--srv option required with --list-channels:
--srv austar for Austar Analogue
--srv austard for Austar Digital
--srv foxtel for Foxtel Analogue
--srv foxteld for Foxtel Digital
--srv free for Free to Air
--srv freesd for Free to Air Digital
--srv freehd for Free to Air Digital (High Definition)
--srv optus for Optus
ok, so now we do this:
[rohbags@... 0.6.2]$ ./tv_grab_au --list-channels --loc Melbourne --srv free
tv_grab_au - (version 0.6.2 - release 2005-05-31)
using config filename /home/rohbags/.xmltv/tv_grab_au.conf
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE tv SYSTEM "xmltv.dtd">
grabing channels: ##################################################
ERROR! - no channel icon found for free.Melbourne.9!
<tv source-info-url="http://www.d1.com.au/" source-info-name="D1
Australia"
source-data-url="http://www.d1.com.au/d1xmltv.asmx/GetChannels?provider=free&region=Melbourne"
generator-info-name="XMLTV - tv_grab_au v0.6.2"
generator-info-url="http://www.onlinetractorparts.com.au/rohbags/">
<channel id="free.Melbourne.10.d1.com.au">
<display-name lang="en">Network TEN</display-name>
<icon src="http://d1.com.au/icons/10.png" />
</channel>
<channel id="free.Melbourne.2.d1.com.au">
<display-name lang="en">ABC Victoria</display-name>
<icon src="http://d1.com.au/icons/abc.png" />
</channel>
<channel id="free.Melbourne.31.d1.com.au">
<display-name lang="en">Channel 31</display-name>
<icon src="http://d1.com.au/icons/31.png" />
</channel>
<channel id="free.Melbourne.7.d1.com.au">
<display-name lang="en">Channel Seven</display-name>
<icon src="http://d1.com.au/icons/7.png" />
</channel>
<channel id="free.Melbourne.9.d1.com.au">
<display-name lang="en">Channel Nine</display-name>
</channel>
<channel id="free.Melbourne.SBS.d1.com.au">
<display-name lang="en">SBS</display-name>
<icon src="http://d1.com.au/icons/sbs.png" />
</channel>
</tv>
The above may seem like a messy way to get a simple list of channels for a
region/service, but its half way there to being able to let end user apps
completely ignore the config file and use the grabber as a 'utility' as
well. If tv_grab_au had a command line option to pass a list of wanted
channels (and a few other tweaks), then apps could do stuff like:
tv_grab_au --no-config-file --output /tmp/tv.xml --days 1 --quiet --loc
Melbourne --srv free --grab-channels
free.Melbourne.10.d1.com.au,free.Melbourne.7.d1.com.au
OR maybe something like:
tv_grab_au --list-programs --loc Melbourne --src free --days 1
Of course there isnt any way to specify a name or number for channels in
the above exampes (or even a list of channels in the later), but if we do
make this a standard we could work that out later :p
One last thing, what do you guys think of having an option to set/override
the repeatitive part of the channel id, something like:
from config file: global_id .d1.com.au
from cmd line: --global-id .d1.com.au
A few of the other aussie grabbers support a similar method of doing this,
great for us when one day only the ninemsn one works, then the d1 grabber
works, then nothing so we have to use the old yahoo one just to get basic
titles and start times, so to make things a little easier they can all
output the same .d1.com.au, and the config file can be edited to allow a
channel with a yahoo id of 26845 to use D1's id (Ten.Melbourne) so we get
Ten.Melbourne.d1.com.au not 26845.d1.com.au.
Personally I think the grabbers should be able to do more than just be
configured and run a preset way. They should offer the power and
flexibilty to end user apps to have as much or as little control of the
grabber as they please, including the ability to run with out a config
file at all. If the grabber requires a username and/or a password then
maybe this could also be a command line option(s), or the gui would have
to either accept and handle the prompt for a username/password from the
grabber or force the user to manually run the grabber to store a
username/password in the grabber's config file.
Just some ideas to ponder over.
Cheers all,
Rohan (tv_grab_au dev)
PS: yes, we really need a neat format to handle errors in all the
grabbers. thats something ive thought about for a while now.
|