edit4ever / script.module.zap2epg

zap2epg - EPG grabber for USA/Canada
GNU General Public License v3.0
41 stars 25 forks source link

Convert to using python3 & force HTML for escape characters #35

Closed th0ma7 closed 3 years ago

th0ma7 commented 3 years ago

First comment: it runs really well and it's really fast! Nice work!

  1. Using the following changes I am now able to manually call the script using python3
  2. Also, in order for the title & description to be fully functional in TVH & Kodi all escape characters needs to be converted to legacy style HTML such as:
        data = data.replace('&','&')
        data = data.replace('"','"')
        data = data.replace("'",''')
        data = data.replace('<','&lt;')
        data = data.replace('>','&gt;')

Other opportunities for improvement:

Language...I believe it can be better managed. Issue is: if set in frech I believe it sets it for everything, which is not true at all. I think any non-english channels should have a representative flag. Then, having a category dictionary, the categories could be added for those channels in both languages (default lang=en + specific to that channel)

Food for thoughts:

th0ma7 commented 3 years ago

@edit4ever I tried adding a few features and make the code compatible to direct python3 call from shell. Let me know what you think of it and whether some of the commits are applicable.

th0ma7 commented 3 years ago

@edit4ever I've added configuration xml files as demonstration on how language could be auto-managed.

  1. A channel list containing only non-english channels. Currently only what I know related to fr_CA channels are in place but that could be of use for other channels/languages as well. Idea here is to parse the channel ID and match language from the xml file, set lang=en when not found or proper language when found.
  2. I've sort of mapped the ETSI EN 300 468 V1.16.1 (2019-08) nibble assignment in XML (most probably needs rework). Idea here is to have an equivalent for the matching language (currently not translated, there to show the general idea).

Again, food for thoughts.

edit4ever commented 3 years ago

I'll take a look at these ideas as I get some time. However - it looks like you've been referencing the Master branch - but there is a Python 3 branch that would be more appropriate for you to be working off of. Master was left in the python 2 old code and I hadn't gotten around to merging the Python 3 branch into Master.

So you might want to relook at your pull requests and rework them onto the Python 3 branch - as the current Master branch is not up to date.

th0ma7 commented 3 years ago

@edit4ever I've created a new PR https://github.com/edit4ever/script.module.zap2epg/pull/37 to replace most of this one (besides the python2-3 convert).

I'll come back with another PR relating the language management proposal I have in mind. There really is a need to allow setting lang=fr for french channels so accentuated characters gets interpreted properly in both kodi and TVH as otherwise éèê... ends-up being î or é ... In the meantime I'll open-up an issue to follow that.