387
388
389
390
391
392
393
394
395
396
397
398
399
400
401 | row["url"] = url
new_rows.append(row)
# Or just allow one stream per station in a playlist entry
if not self.multiply:
break
rows = new_rows
debug(dbg.DATA, "conversion to:", dest, " from:", self.source, "with rows=", rows)
# call conversion schemes
converter = getattr(self, dest) or self.pls
return converter(rows)
# save directly
def file(self, rows, dest, fn): |
|
| 387
388
389
390
391
392
393
394
395
396
397
398
399
400
401 | row["url"] = url
new_rows.append(row)
# Or just allow one stream per station in a playlist entry
if not self.multiply:
break
rows = new_rows
debug(dbg.DATA, "conversion to:", dest, " with rows=", rows)
# call conversion schemes
converter = getattr(self, dest) or self.pls
return converter(rows)
# save directly
def file(self, rows, dest, fn): |
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472 |
# SMIL
def smil(self, rows):
txt = """<smil>\n<head>\n\t<meta name="title" content="%s"/>\n</head>\n<body>\n\t<seq>\n""" % (rows[0]["title"])
for row in rows:
if row.get("url"):
txt += """\t\t<audio src="%s"/>\n""" % row["url"]
txt += """\t</seq>\n</body>\n</smil>\n"""
return txt
# Generate filename for temporary .m3u, if possible with unique id |
|
| 458
459
460
461
462
463
464
465
466
467
468
469
470
471
472 |
# SMIL
def smil(self, rows):
txt = """<smil>\n<head>\n\t<meta name="title" content="%s"/>\n</head>\n<body>\n\t<seq>\n""" % (rows[0]["title"])
for row in rows:
if row.get("url"):
txt += """\t\t<{} src="{}"/>\n""".format(row.get("format", "audio").split("/")[0], row["url"])
txt += """\t</seq>\n</body>\n</smil>\n"""
return txt
# Generate filename for temporary .m3u, if possible with unique id |