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

⌈⌋ ⎇ branch:  streamtuner2


Check-in [4ebb6babed]

Overview
Comment:Adapt GenericChannel to use state icon for multi-URL stations. Fix RadioSure slightly to use spaces instead of TABs for `url` lists.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4ebb6babed509b779025de89a9405466e2a86552
User & Date: mario on 2016-11-11 22:58:00
Other Links: manifest | tags
Context
2016-11-13
13:23
action: optionalize quoting for BSD/Linux if plain http:// url without special chars. And fix regex to properly caret-escape + quote for Windows. check-in: 52f8cb3961 user: mario tags: trunk
2016-11-11
22:58
Adapt GenericChannel to use state icon for multi-URL stations. Fix RadioSure slightly to use spaces instead of TABs for `url` lists. check-in: 4ebb6babed user: mario tags: trunk
22:24
dirble: Fix unexpected Null/None for content_type and bitrate stream[] values. check-in: 6c6c870008 user: mario tags: trunk
Changes

Modified channels/__init__.py from [a62aaaa5c0] to [55add89636].

402
403
404
405
406
407
408


409
410
411
412
413
414
415
    def prepare_filter_icons(self, row):
        if conf.show_bookmarks:
            # and "bookmarks" in self.parent.channels:
            row["favourite"] = self.parent.bookmarks.is_in(row.get("url", "file:///tmp/none"))
            # this should really go into bookmarks plugin itself,
            # disadvantage: would decelerate processing loop further
        if not row.get("state"):


            if row.get("favourite"):
                row["state"] = gtk.STOCK_ABOUT
            if row.get("deleted"):
                row["state"] = gtk.STOCK_DELETE


    # Stream list cleanup - invoked directly after reload(),







>
>







402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
    def prepare_filter_icons(self, row):
        if conf.show_bookmarks:
            # and "bookmarks" in self.parent.channels:
            row["favourite"] = self.parent.bookmarks.is_in(row.get("url", "file:///tmp/none"))
            # this should really go into bookmarks plugin itself,
            # disadvantage: would decelerate processing loop further
        if not row.get("state"):
            if row.get("url", "").find(" ") > 0:
                row["state"] = gtk.STOCK_UNINDENT
            if row.get("favourite"):
                row["state"] = gtk.STOCK_ABOUT
            if row.get("deleted"):
                row["state"] = gtk.STOCK_DELETE


    # Stream list cleanup - invoked directly after reload(),

Modified contrib/radiosure.py from [5396599cac] to [e1d926fd86].

1
2
3
4
5
6
7
8
9
10
11
12
# encoding: UTF-8
# api: streamtuner2
# title: RadioSure
# description: Huge radio station collection
# version: 0.4
# type: channel
# category: radio
# url: http://radiosure.com/
# config: -
# priority: extra
# png: 
#   iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEULDgpKTEmQko/19/S0inLcAAAAUklEQVQI12P4DwQMDvuBBIs92zcGHh2G




|







1
2
3
4
5
6
7
8
9
10
11
12
# encoding: UTF-8
# api: streamtuner2
# title: RadioSure
# description: Huge radio station collection
# version: 0.5
# type: channel
# category: radio
# url: http://radiosure.com/
# config: -
# priority: extra
# png: 
#   iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEULDgpKTEmQko/19/S0inLcAAAAUklEQVQI12P4DwQMDvuBBIs92zcGHh2G
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
            with open(self.tmp, "wb") as f:
                f.write(ahttp.get(self.zip, binary=1))
        # get first file
        zip = zipfile.ZipFile(self.tmp)
        csv = zip.read(zip.namelist()[0])
        self.status("Updating streams from RadioSure CSV database")
        # fields = ["title", "playing", "genre", "country", "language", "url"]
        for e in re.findall("^([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+(?:\t[^\t]{3,})*)", csv, re.M):
            if cat == e[2]:
                streams.append(dict(
                    title = e[0],
                    playing = e[1],
                    genre = e[2],
                    country = e[3],
                    language = e[4],
                    url = e[5]#...
                ))
        return streams









|







|




82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
            with open(self.tmp, "wb") as f:
                f.write(ahttp.get(self.zip, binary=1))
        # get first file
        zip = zipfile.ZipFile(self.tmp)
        csv = zip.read(zip.namelist()[0])
        self.status("Updating streams from RadioSure CSV database")
        # fields = ["title", "playing", "genre", "country", "language", "url"]
        for e in re.findall(r"^([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+(?:\t[^\t\n]{3,})*)", csv, re.M):
            if cat == e[2]:
                streams.append(dict(
                    title = e[0],
                    playing = e[1],
                    genre = e[2],
                    country = e[3],
                    language = e[4],
                    url = e[5].replace("\t", " ")#...
                ))
        return streams