kgroeneveld / tv_grab_sd_json

XMLTV grabber for the Schedules Direct JSON API
8 stars 6 forks source link

Does the XMLTV Config file allow... #5

Open bonelifer opened 8 years ago

bonelifer commented 8 years ago

Does the XMLTV Config file allow comments beside the channel list(ie.): channel=10445 # USA

If so could you add the channel names as a comment. Would be easier for me to add all the channels and then edit the ones I don't want out if they had the names in the file.

kgroeneveld commented 8 years ago

I actually don't know. tv_grab_sd_json uses the config file parsing and output functions from the main XMLTV project libraries.

I just did a quick test and it seems the parsing functions are okay with comments after a # character. I don't know if I can easily include comments using the standard XMLTV library functions. When I have time I will try to remember to look into this further. I agree that including channel names as comments would be useful.

MikeB2013 commented 8 years ago

Another approach is to provide --list-channels option within the grabber (some grabbers have this option). This option would display a list of channel id's together with channel names and possibly channel number from a given config-file

I wrote a perl script (very badly as my knowledge of perl is minimal). It takes the output file from a rv_grab_sd_json run and lists in a tab delimited format the channel names together with channel id and channel number. see attached file

sd-json-channeldumper.pl.zip

Example output Freesat.map.zip

Mike

bonelifer commented 8 years ago

@MikeB2013 At least in my xml files, there are two entries that represent the name of the channel. One is the Name and the other is the Callsign initials. In the case below: Cable News Network CNN

The name always shows up first, could you alter(add option) to take the second occurance instead.
so something like: sd-json-channeldumper.pl -usename2 listing.xml

would output the second occurance instead of just taking the first.

`

Cable News Network CNN 048

`

I was able to do it by changing the '0' to '1' in the code, but some people may need or prefer it output the first occurance.

kgroeneveld commented 8 years ago

Another approach is to provide --list-channels option within the grabber (some grabbers have this option). This option would display a list of channel id's together with channel names and possibly channel number from a given config-file

My understanding is that the --list-channels option is part of the apiconfig capability and is supposed to output the channel list in XML the same as the channel list at the beginning the full output. See http://wiki.xmltv.org/index.php/XmltvCapabilities. This can allow other applications to parse the output in a standard way to implement there own configuration of a grabber. Unfortunately not all of the steps of the tv_grab_sd_json grabber configuration are currently compatible with apiconfig. I at least temporarily gave up on supporting this with the complexity of the SD account setup.

I suppose other non standard command line options could be added to give more user friendly channel lists.

I still like the idea of the original suggestion of having the names as comments in the config file. I suggested a patch to the XMLTV project which does this: https://sourceforge.net/p/xmltv/mailman/message/35118310/

However this patch would impact all grabbers which there was an objection to. I haven't yet spent the time to come up with a patch that could be selectively applied to individual grabbers.

You could apply the patch to your local system if you wanted.