Internet radio browser GUI for music/video streams from various directory services.

⌈⌋ branch:  streamtuner2


Check-in [921d100bbc]

Overview
Comment:exportcat: Strip non-filename characters (slash) from genre prefix.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:921d100bbc54b273bcff60d10376522119857a1b
User & Date: mario on 2016-11-11 22:23:07
Other Links: manifest | tags
Context
2016-11-11
22:24
dirble: Fix unexpected Null/None for content_type and bitrate stream[] values. check-in: 6c6c870008 user: mario tags: trunk
22:23
exportcat: Strip non-filename characters (slash) from genre prefix. check-in: 921d100bbc user: mario tags: trunk
2016-11-10
17:35
Custom .quote() cmd argument escaping for windows. check-in: 89f9b52549 user: mario tags: trunk
Changes

Modified channels/exportcat.py from [66f2154eb8] to [761166da1a].

1
2
3
4
5
6
7
8
9
10
11
12
..
46
47
48
49
50
51
52

53
54
55
56
57
58
59
60
61
62
63
# encoding: UTF-8
# api: streamtuner2
# title: Export Category
# description: Exports a complete channel category (all stations into one file).
# version: 0.2
# type: feature
# category: file
# priority: optional
# -disabled-config:
#   { name: export_format, value: xspf, type: select, select: "pls|xspf|m3u|jspf|smil|asx|json", description: Default export format. }
# hooks: config_save
#
................................................................................
            uikit.add_menu([parent.extensions, parent.extensions_context], "Export all stations", self.savewindow)

    # Fetch streams from category, show "Save as" dialog, then convert URLs and export as playlist file
    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, "xspf"))
        log.PROC("Exporting category to", fn)
        if fn:
            dest = re.findall("\.(m3u|pls|xspf|jspf|json|smil|asx|desktop|url)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            




|







 







>
|










1
2
3
4
5
6
7
8
9
10
11
12
..
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# encoding: UTF-8
# api: streamtuner2
# title: Export Category
# description: Exports a complete channel category (all stations into one file).
# version: 0.3
# type: feature
# category: file
# priority: optional
# -disabled-config:
#   { name: export_format, value: xspf, type: select, select: "pls|xspf|m3u|jspf|smil|asx|json", description: Default export format. }
# hooks: config_save
#
................................................................................
            uikit.add_menu([parent.extensions, parent.extensions_context], "Export all stations", self.savewindow)

    # Fetch streams from category, show "Save as" dialog, then convert URLs and export as playlist file
    def savewindow(self, *w):
        cn = self.parent.channel()
        source = cn.listformat
        streams = cn.streams[cn.current]
        category = re.sub(r"[^\w&-+]+", "_", cn.current)
        fn = uikit.save_file("Export category", None, "%s.%s.%s" % (cn.module, category, "xspf"))
        log.PROC("Exporting category to", fn)
        if fn:
            dest = re.findall("\.(m3u|pls|xspf|jspf|json|smil|asx|desktop|url)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