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

⌈⌋ ⎇ branch:  streamtuner2


Check-in [4b66ed9ef8]

Overview
Comment:Remove force= parameter from update_streams
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4b66ed9ef8e22fb54945299add5cbc7f6d5b80ed
User & Date: mario on 2014-06-02 01:43:34
Other Links: manifest | tags
Context
2014-06-02
01:43
Add server-search, slim down search dialog. check-in: bd29eb4ee9 user: mario tags: trunk
01:43
Remove force= parameter from update_streams check-in: 4b66ed9ef8 user: mario tags: trunk
01:42
Allow repainting bookmarks categories after channel init check-in: f17890596d user: mario tags: trunk
Changes

Added channels/icast.png version [22dae14bc0].

cannot compute difference between binary files

Modified channels/internet_radio.py from [fff2459591] to [b9fa0242be].

65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
        html = http.get(self.homepage)
        rx = re.compile("""<option[^>]+value="/stations/[-+&.\w\s%]+/">([^<]+)</option>""")
        
        self.categories = rx.findall(html)


    # fetch station lists
    def update_streams(self, cat, force=0):    
    
        entries = []
        if cat not in self.categories:
            return []

        rx_pages = re.compile('href="/stations/[-+\w%\d\s]+/page(\d+)">\d+</a>')








|







65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
        html = http.get(self.homepage)
        rx = re.compile("""<option[^>]+value="/stations/[-+&.\w\s%]+/">([^<]+)</option>""")
        
        self.categories = rx.findall(html)


    # fetch station lists
    def update_streams(self, cat):
    
        entries = []
        if cat not in self.categories:
            return []

        rx_pages = re.compile('href="/stations/[-+\w%\d\s]+/page(\d+)">\d+</a>')

Added channels/itunes.png version [890e4b0fbd].

cannot compute difference between binary files

Modified channels/jamendo.py from [4d9a276a72] to [8860de0fa3].

273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
                "soft",
                ]
        ]
        return self.categories


    # retrieve category or search
    def update_streams(self, cat, search="", force=0):

        entries = []
        fmt = self.stream_mime(conf.jamendo_stream_format)
        
        # Static list of Radios
        if cat == "radios":
            for radio in ["BestOf", "Pop", "Rock", "Lounge", "Electro", "HipHop", "World", "Jazz", "Metal", "Soundtrack", "Relaxation", "Classical"]:







|







273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
                "soft",
                ]
        ]
        return self.categories


    # retrieve category or search
    def update_streams(self, cat, search=None):

        entries = []
        fmt = self.stream_mime(conf.jamendo_stream_format)
        
        # Static list of Radios
        if cat == "radios":
            for radio in ["BestOf", "Pop", "Rock", "Lounge", "Electro", "HipHop", "World", "Jazz", "Metal", "Soundtrack", "Relaxation", "Classical"]:

Modified channels/modarchive.py from [fad6b89c33] to [2d0aeb3385].

100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
        cache = conf.load("cache/catmap_" + self.module)
        if (cache):
            self.catmap = cache
        pass


    # download links from dmoz listing
    def update_streams(self, cat, force=0):

        url = "http://modarchive.org/index.php"
        params = dict(query=self.catmap[cat], request="search", search_type="genre")
        html = http.get(url, params)
        entries = []
        
        rx_mod = re.compile("""







|







100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
        cache = conf.load("cache/catmap_" + self.module)
        if (cache):
            self.catmap = cache
        pass


    # download links from dmoz listing
    def update_streams(self, cat):

        url = "http://modarchive.org/index.php"
        params = dict(query=self.catmap[cat], request="search", search_type="genre")
        html = http.get(url, params)
        entries = []
        
        rx_mod = re.compile("""

Modified channels/myoggradio.py from [75bad296bf] to [bf19ca282c].

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
    # this is simple, there are no categories
    def update_categories(self):
        pass



    # download links from dmoz listing
    def update_streams(self, cat, force=0):

        # result list
        entries = []
        
        # common
        if (cat == "common"):
            # fetch







|







69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
    # this is simple, there are no categories
    def update_categories(self):
        pass



    # download links from dmoz listing
    def update_streams(self, cat):

        # result list
        entries = []
        
        # common
        if (cat == "common"):
            # fetch

Modified channels/punkcast.py from [0e12904925] to [31af6f440a].

54
55
56
57
58
59
60
61
62
63
64
65
66
67
68

    # don't do anything
    def update_categories(self):
        pass


    # get list
    def update_streams(self, cat, force=0):

        rx_link = re.compile("""
            <a\shref="(http://punkcast.com/(\d+)/index.html)">
            \s+<img[^>]+ALT="([^<">]+)"
        """, re.S|re.X)

        entries = []







|







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68

    # don't do anything
    def update_categories(self):
        pass


    # get list
    def update_streams(self, cat):

        rx_link = re.compile("""
            <a\shref="(http://punkcast.com/(\d+)/index.html)">
            \s+<img[^>]+ALT="([^<">]+)"
        """, re.S|re.X)

        entries = []

Modified channels/surfmusik.py from [38f14e35ce] to [02e3c00437].

102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
                subcats = [x.replace("+", " ").title() for x in subcats]
                r.append(sorted(subcats))

        self.categories = r


    # summarize links from surfmusik
    def update_streams(self, cat, force=0):

        (base_url, path_genre, path_country) = self.base[conf.surfmusik_lang]
        entries = []
        i = 0
        max = int(conf.max_streams)
        is_tv = 0
        







|







102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
                subcats = [x.replace("+", " ").title() for x in subcats]
                r.append(sorted(subcats))

        self.categories = r


    # summarize links from surfmusik
    def update_streams(self, cat):

        (base_url, path_genre, path_country) = self.base[conf.surfmusik_lang]
        entries = []
        i = 0
        max = int(conf.max_streams)
        is_tv = 0
        

Modified channels/xiph.py from [921a2a9392] to [97b65b9a1c].

99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
            data = http.get(self.json_url, params=params)
            #__print__(dbg.DATA, data)
            
            #-- extract
            l = []
            __print__( dbg.PROC, "processing api.dir.xiph.org JSON (via api.include-once.org cache)" )
            data = json.loads(data)
            for e in data.values():
                #__print__(dbg.DATA, e)
                bitrate = int(e["bitrate"])
                if conf.xiph_min_bitrate and bitrate and bitrate >= int(conf.xiph_min_bitrate):
                  l.append({
                    "title": e["stream_name"],
                    "url": e["listen_url"],
                    "format": e["type"],







|







99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
            data = http.get(self.json_url, params=params)
            #__print__(dbg.DATA, data)
            
            #-- extract
            l = []
            __print__( dbg.PROC, "processing api.dir.xiph.org JSON (via api.include-once.org cache)" )
            data = json.loads(data)
            for e in data:
                #__print__(dbg.DATA, e)
                bitrate = int(e["bitrate"])
                if conf.xiph_min_bitrate and bitrate and bitrate >= int(conf.xiph_min_bitrate):
                  l.append({
                    "title": e["stream_name"],
                    "url": e["listen_url"],
                    "format": e["type"],