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

⌈⌋ branch:  streamtuner2


Check-in [3717a70b32]

Overview
Comment:Update for new action.play() signature, scale down banner images.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3717a70b32750be8494d8344a182927b781ec721
User & Date: mario on 2015-05-26 00:41:22
Other Links: manifest | tags
Context
2015-05-26
00:42
Fix row[`url`] reference. check-in: 388ef679b7 user: mario tags: trunk
00:41
Update for new action.play() signature, scale down banner images. check-in: 3717a70b32 user: mario tags: trunk
00:40
Fix action.browser() to use only row{}, not pass url= argument. Native JAMJSON extractor now tests for ["tracks"] or uses plain ["results"] list. check-in: 84114ae636 user: mario tags: trunk
Changes

Modified contrib/punkcast.py from [f8b9acfb69] to [23a7617735].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
..
33
34
35
36
37
38
39
40



41
42
43
44
45
46
47
..
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

86
87
88
89
90
91

# api: streamtuner2
# title: PunkCast
# description: Online video site that covered NYC artists. Not updated anymore.
# type: channel
# category: video
# version: 0.2
# url: http://www.punkcast.com/
# png:
#   iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAyxJREFUOI0FwUlvG2UAgOH3++abxfsy2dtmcRsnghpBKyKhQA7lgsShPwEk/gVcKn4HN+6AynKIkEgFUkFF
#   okrlpEkap2nqxHFsx/bYHs/m4XmE0s1Yyhjf8/niy6/49utv+PPf57x4sk3083cUzZgwZWElE9hL60yyc1zU39A8PsRxhijLMBFahO/5dFotwvGIeDxkOHJwNYvCwgyRYeElslTPu7ivTnFaTU6dkG4E
#   ytANoskYgMb5W64b51jEuJ6Lq3Rmy2tEUcz1WR1pGGiyiIhMDOlQGHZRQRAQRR4CqJ2eUNvbJcAiEYz45NMtKrdvkc8a1G5M81e1RuiGjDpt1CTASKeQytDxowmmZdLpdDl8+QJLBqTxKSYkc0afbOyz
#   OD/F/fIynhA0wwChazhIpOuNYCJI6hpxPOHiqk1K8+ldthDumFhXnLUHjEZj9DggKyWfbWywPpXHVqBEOKayXubDyl1qx0f0eh1E6GLaRX7aO8NLJjG9PvNLt0kpuJWeMHPTxnan6V81UWmpYacTVN57
#   H9uewu01+OPJDle9AY//O+Dj++9yr3wHUnl8PyCTyzL2PE5aPUgYaFlNPDKigGe7VW6U1iDwcXuXzBbz+K5PThMEvQ6xjJjEAi2Z4Wn1mP03FyR1DaU0jUbnGj81IZXLkckoSpUV7JTB0HF4urvH3IMN
................................................................................

# basic.ch broadcast archive
class punkcast (ChannelPlugin):

    # keeps category titles->urls    
    catmap = {}
    categories = ["list"]
    titles = dict(playing=False, listeners=False, bitrate=False, homepage=False) 





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


................................................................................
            })

        # done    
        return entries


    # special handler for play
    def play(self, row):
    
        rx_sound = re.compile("""(http://[^"<>]+[.](mp3|ogg|m3u|pls|ram))""")
        html = ahttp.get(row["homepage"])
        
        # look up ANY audio url
        for uu in rx_sound.findall(html):
            log.DATA( uu )
            (url, fmt) = uu

            action.play(url, mime_fmt(fmt), "srv")
            return
        
        # or just open webpage
        action.browser(row["homepage"])







|







 







|
>
>
>







 







|
|







>
|





1
2
3
4
5
6
7
8
9
10
11
12
13
14
..
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
..
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

# api: streamtuner2
# title: PunkCast
# description: Online video site that covered NYC artists. Not updated anymore.
# type: channel
# category: video
# version: 0.3
# url: http://www.punkcast.com/
# png:
#   iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAyxJREFUOI0FwUlvG2UAgOH3++abxfsy2dtmcRsnghpBKyKhQA7lgsShPwEk/gVcKn4HN+6AynKIkEgFUkFF
#   okrlpEkap2nqxHFsx/bYHs/m4XmE0s1Yyhjf8/niy6/49utv+PPf57x4sk3083cUzZgwZWElE9hL60yyc1zU39A8PsRxhijLMBFahO/5dFotwvGIeDxkOHJwNYvCwgyRYeElslTPu7ivTnFaTU6dkG4E
#   ytANoskYgMb5W64b51jEuJ6Lq3Rmy2tEUcz1WR1pGGiyiIhMDOlQGHZRQRAQRR4CqJ2eUNvbJcAiEYz45NMtKrdvkc8a1G5M81e1RuiGjDpt1CTASKeQytDxowmmZdLpdDl8+QJLBqTxKSYkc0afbOyz
#   OD/F/fIynhA0wwChazhIpOuNYCJI6hpxPOHiqk1K8+ldthDumFhXnLUHjEZj9DggKyWfbWywPpXHVqBEOKayXubDyl1qx0f0eh1E6GLaRX7aO8NLJjG9PvNLt0kpuJWeMHPTxnan6V81UWmpYacTVN57
#   H9uewu01+OPJDle9AY//O+Dj++9yr3wHUnl8PyCTyzL2PE5aPUgYaFlNPDKigGe7VW6U1iDwcXuXzBbz+K5PThMEvQ6xjJjEAi2Z4Wn1mP03FyR1DaU0jUbnGj81IZXLkckoSpUV7JTB0HF4urvH3IMN
................................................................................

# basic.ch broadcast archive
class punkcast (ChannelPlugin):

    # keeps category titles->urls    
    catmap = {}
    categories = ["list"]
    titles = dict(playing=False, listeners=False, bitrate=False, homepage=False)
    
    img_resize = 196
    fixed_size = [128,32]


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


................................................................................
            })

        # done    
        return entries


    # special handler for play
    def play(self):
        row = self.row()
        rx_sound = re.compile("""(http://[^"<>]+[.](mp3|ogg|m3u|pls|ram))""")
        html = ahttp.get(row["homepage"])
        
        # look up ANY audio url
        for uu in rx_sound.findall(html):
            log.DATA( uu )
            (url, fmt) = uu
            row["url"] = url
            action.play(row, mime_fmt(fmt), "srv")
            return
        
        # or just open webpage
        action.browser(row["homepage"])