Compare commits
2 commits
fab83e733a
...
7642543796
Author | SHA1 | Date | |
---|---|---|---|
7642543796 | |||
ef97a070e6 |
1 changed files with 3 additions and 0 deletions
|
@ -30,14 +30,17 @@ class XMLTV:
|
|||
open('data/channels.xml', mode='a', encoding='UTF-8').write(c)
|
||||
|
||||
def add_programme(self, channel, title, desc, start, stop, category, attr, icon):
|
||||
# TODO: add `duo` attribute (bilingual)
|
||||
programme = '<programme start="{} +0000" stop="{} +0000" channel="{}">'.format(start, stop, channel)
|
||||
programme += '<title>{}</title>'.format(title)
|
||||
programme += '<desc>{}</desc>'.format(desc)
|
||||
programme += '<category lang="ja">{}</category>'.format(category)
|
||||
if icon: programme += '<icon src="{}" />'.format(icon)
|
||||
if '5.1' in attr: programme += '<audio><stereo>surround</stereo></audio>'
|
||||
if 'stereo' in attr: programme += '<audio><stereo>stereo</stereo></audio>'
|
||||
if 'mono' in attr: programme += '<audio><stereo>mono</stereo></audio>'
|
||||
if 'hd' in attr: programme += '<video><present>yes</present><aspect>16:9</aspect><quality>HDTV</quality></video>'
|
||||
if '4k' in attr: programme += '<video><present>yes></present><aspect>16:9</aspect><quality>3840x2160</quality></video>'
|
||||
if 'cp1' in attr: programme += '<subtitles type="teletext" />'
|
||||
programme += '</programme>\n'
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue