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

⌈⌋ ⎇ branch:  streamtuner2


Check-in [8130cc2cdc]

Overview
Comment:Updated punkcast to display again, also show banners now instead of empty columns, and embedded favicon/png.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8130cc2cdcffb6001ff6fe6ad97636b292235c7a
User & Date: mario on 2015-04-02 15:26:40
Other Links: manifest | tags
Context
2015-04-02
15:27
Fix config defaults registration. check-in: b49c38af77 user: mario tags: trunk
15:26
Updated punkcast to display again, also show banners now instead of empty columns, and embedded favicon/png. check-in: 8130cc2cdc user: mario tags: trunk
15:24
Removed dirble plugin for now (new API coming in April...?) check-in: 23f4e4608e user: mario tags: trunk
Changes

Deleted channels/punkcast.png version [25917b4a86].

cannot compute difference between binary files

Modified channels/punkcast.py from [fca198bf93] to [b745bf426e].

1
2
3
4
5
6
7
8
9









10
11
12

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

73
74
75
76
77
78
79

80

81
82
83
84
85
86
87

# api: streamtuner2
# title: PunkCast
# description: Online video site that covered NYC artists. Not updated anymore.
# type: channel
# category: video
# version: 0.1
# url: http://www.punkcast.com/
# config: -









# priority: rare
#
#

# Disables itself per default.
# ST1 looked prettier with random images within.
#


import re
import ahttp as http
from config import conf
import action
from channels import *
from config import __print__, dbg





# disable plugin per default
if "punkcast" not in vars(conf): 
    conf.plugins["punkcast"] = 0









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

    # description
    title = "punkcast"
    module = "punkcast"
    homepage = "http://www.punkcast.com/"

    # keeps category titles->urls    
    catmap = {}
    categories = ["list"]
    default = "list"
    current = "list"
 


    # 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 = []
 
        #-- all from frontpage

        for uu in rx_link.findall(http.get(self.homepage)):
            (homepage, id, title) = uu
            entries.append({
                    "genre": "?",
                    "title": title,
                    "playing": "PUNKCAST #"+id,
                    "format": "audio/mpeg",

                    "homepage": homepage,

            })

        # done    
        return entries


    # special handler for play






|

|
>
>
>
>
>
>
>
>
>
|

<
>
|
<
|








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<















|












|





>
|


|

|

>

>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

21
22

23
24
25
26
27
28
29
30
31















32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

# 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
#   jG6XbGGWemeAkc+hNEE0DtCSmngUCkFSixn321iWyVzGImEIVssllAh5e9kkCDV2T05pD4dMTeWpv6ohwghp6opCOOHh1kfcXZzm8S/bPNs/ZOC4mELj4eYGWiT54Z896qMJ9vws4XBE3lRIBeqmDmk/
#   Qmnw+YNNlsur/PrbDqv5NFm7SHMwpNbuMggClmYL5JWkqytErKGPPVQmilhLSpbtBE1nxMFhjedHrymkNUrv3KHTuqLvjWl7MQevL+gNXaqNLlGzSyUvUVuEzMzkWVhZYqd6xPc//o6MBfWrAZcdBxnH
#   zOcy/F1rsf3yFFmtEcWwOZ2h1R8hP5jATGmRQE+wXz0gjiMWihnO2z1qjS6ZQoF76yuU7DSxFFhJC10phmHIhVT8D1yefHn5PzXrAAAAAElFTkSuQmCC
# -off-config: { name: punkcast_img, type: boolean, value: 0, desciption: Load banners. (Channel > Update favicons) }
# priority: obsolete
#

# Punkcast is no longer updated. This plugin is kept for
# historic reasons. It was one of the default streamtuner1

# channels.


import re
import ahttp as http
from config import conf
import action
from channels import *
from config import __print__, dbg

















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

    # description
    title = "punkcast"
    module = "punkcast"
    homepage = "http://www.punkcast.com/"

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


    # 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)">
            .*? ALT="([^<">]+)"
        """, re.S|re.X)

        entries = []
 
        #-- all from frontpage
        html = http.get(self.homepage)
        for uu in rx_link.findall(html):
            (homepage, id, title) = uu
            entries.append({
                    "genre": "%s" % id,
                    "title": title,
                    "playing": "PUNKCAST #%s" % id,
                    "format": "audio/mpeg",
                    "url": "none:",
                    "homepage": homepage,
                    "img": "http://punkcast.com/%s/PUNK%s.jpg" % (id, id),
            })

        # done    
        return entries


    # special handler for play
95
96
97
98
99
100
101
102
103
104
105
106
107
108
            __print__( dbg.DATA, uu )
            (url, fmt) = uu
            action.action.play(url, self.mime_fmt(fmt), "url/direct")
            return
        
        # or just open webpage
        action.action.browser(row["homepage"])
            
        













<
<
<
<
<
<
91
92
93
94
95
96
97
98






            __print__( dbg.DATA, uu )
            (url, fmt) = uu
            action.action.play(url, self.mime_fmt(fmt), "url/direct")
            return
        
        # or just open webpage
        action.action.browser(row["homepage"])