Compare commits
No commits in common. "76425437960f1cd56df4f0bd342e7cc9c788bd8c" and "fab83e733a1ea0938c79534dc314206e932fbe42" have entirely different histories.
7642543796
...
fab83e733a
1 changed files with 0 additions and 3 deletions
|
@ -30,17 +30,14 @@ class XMLTV:
|
||||||
open('data/channels.xml', mode='a', encoding='UTF-8').write(c)
|
open('data/channels.xml', mode='a', encoding='UTF-8').write(c)
|
||||||
|
|
||||||
def add_programme(self, channel, title, desc, start, stop, category, attr, icon):
|
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 = '<programme start="{} +0000" stop="{} +0000" channel="{}">'.format(start, stop, channel)
|
||||||
programme += '<title>{}</title>'.format(title)
|
programme += '<title>{}</title>'.format(title)
|
||||||
programme += '<desc>{}</desc>'.format(desc)
|
programme += '<desc>{}</desc>'.format(desc)
|
||||||
programme += '<category lang="ja">{}</category>'.format(category)
|
programme += '<category lang="ja">{}</category>'.format(category)
|
||||||
if icon: programme += '<icon src="{}" />'.format(icon)
|
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 'stereo' in attr: programme += '<audio><stereo>stereo</stereo></audio>'
|
||||||
if 'mono' in attr: programme += '<audio><stereo>mono</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 '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" />'
|
if 'cp1' in attr: programme += '<subtitles type="teletext" />'
|
||||||
programme += '</programme>\n'
|
programme += '</programme>\n'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue