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

⌈⌋ ⎇ branch:  streamtuner2


Diff

Differences From Artifact [946f14f97b]:

To Artifact [53641222c8]:


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38


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):

    # keeps category titles->urls    
    catmap = {}







|







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38


import re
import ahttp as http
from config import conf
import action
from channels import *
from config import *


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

    # keeps category titles->urls    
    catmap = {}
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
    def play(self, row):
    
        rx_sound = re.compile("""(http://[^"<>]+[.](mp3|ogg|m3u|pls|ram))""")
        html = http.get(row["homepage"])
        
        # look up ANY audio url
        for uu in rx_sound.findall(html):
            __print__( dbg.DATA, uu )
            (url, fmt) = uu
            action.play(url, self.mime_fmt(fmt), "srv")
            return
        
        # or just open webpage
        action.browser(row["homepage"])








|







77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
    def play(self, row):
    
        rx_sound = re.compile("""(http://[^"<>]+[.](mp3|ogg|m3u|pls|ram))""")
        html = http.get(row["homepage"])
        
        # look up ANY audio url
        for uu in rx_sound.findall(html):
            log.DATA( uu )
            (url, fmt) = uu
            action.play(url, self.mime_fmt(fmt), "srv")
            return
        
        # or just open webpage
        action.browser(row["homepage"])