1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# encoding: UTF-8
# api: streamtuner2
# title: Export All
# description: Exports a complete channel category (all stations into one file).
# version: -0.1
# type: feature
# category: file
# priority: optional
# config:
# { name: export_format, value: pls, type: select, select: "pls|xspf|jspf", description: Export format. }
# hooks: config_save
#
# Use "Extensions > Export all" in the desired channel and category,
# to export all station entries at once. Currently just export PLS,
# which in turn references other .pls file). Luckily most players
# can cover up for this horrid misdesign.
#
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# encoding: UTF-8
# api: streamtuner2
# title: Export All
# description: Exports a complete channel category (all stations into one file).
# version: -0.1
# type: feature
# category: file
# priority: optional
# config:
# { name: export_format, value: pls, type: select, select: "pls|xspf|m3u|jspf|smil|asx|json", description: Export format. }
# hooks: config_save
#
# Use "Extensions > Export all" in the desired channel and category,
# to export all station entries at once. Currently just export PLS,
# which in turn references other .pls file). Luckily most players
# can cover up for this horrid misdesign.
#
|
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
def savewindow(self, *w):
cn = self.parent.channel()
source = cn.listformat
streams = cn.streams[cn.current]
fn = uikit.save_file("Export category", None, "%s.%s.%s" % (cn.module, cn.current, conf.export_format))
__print__(dbg.PROC, "Exporting category to", fn)
if fn:
dest = re.findall("\.(m3u8?|pls|xspf|jspf|json|smil|asx)$", fn.lower())
if dest:
dest = dest[0]
else:
self.parent.status("Unsupported export playlist type (file extension).")
return
if dest == "m3u8":
dest = "m3u"
action.save_playlist(source="asis", multiply=False).file(rows=streams, fn=fn, dest=dest)
pass
|
|
<
<
|
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
def savewindow(self, *w):
cn = self.parent.channel()
source = cn.listformat
streams = cn.streams[cn.current]
fn = uikit.save_file("Export category", None, "%s.%s.%s" % (cn.module, cn.current, conf.export_format))
__print__(dbg.PROC, "Exporting category to", fn)
if fn:
dest = re.findall("\.(m3u8?|pls|xspf|jspf|json|smil|asx)8?$", fn.lower())
if dest:
dest = dest[0]
else:
self.parent.status("Unsupported export playlist type (file extension).")
return
action.save_playlist(source="asis", multiply=False).file(rows=streams, fn=fn, dest=dest)
pass
|