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

⌈⌋ ⎇ branch:  streamtuner2


Check-in [7dc72d064e]

Overview
Comment:Applied listformat= testing via action.extract_playlist.probe_ext().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7dc72d064e2676e7eaf0446b5106288a4f5b8f51
User & Date: mario on 2015-04-30 00:46:10
Other Links: manifest | tags
Context
2015-04-30
06:19
No has_search for PRF channel. check-in: dc28b4f35a user: mario tags: trunk
00:46
Applied listformat= testing via action.extract_playlist.probe_ext(). check-in: 7dc72d064e user: mario tags: trunk
00:45
iCast currently(?) down. Added JSON/HTTP log.ERR message. check-in: 56320c8678 user: mario tags: trunk
Changes

Modified contrib/publicradiofan.py from [690b9ac5b6] to [f40f0e6f24].

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
# static genre list. Podcasts, scheduled programs aren't fetched.


import re
from config import *
from channels import *
import ahttp



# Basic HTML scraping
class publicradiofan (ChannelPlugin):

    # control attributes
    has_search = True

    listformat = "href"
    titles = dict(listeners=False, bitrate=False, playing="Description")
    categories = ["adult alternative", "adult contemporary", "blues", "business", "classical", "community", "contemporary", "country", "easy", "education", "ethnic", "folk", "free-form", "full service", "government", "international", "jazz", "military", "news", "nostalgia", "oldies", "reading", "regional", "religious", "rock", "seasonal", "sports", "student", "talk", "traffic", "urban", "variety", "world", "youth"]
    

    # static
    def update_categories(self):
        pass
        

    # Extract from listing tables
    def update_streams(self, cat, search=None):

        html = ahttp.get("http://www.publicradiofan.com/cgibin/statsearch.pl?format={}&lang=".format(cat))
        html = re.split("<H2>", html, 2, re.S)[1]


        r = []
        for html in re.split("<TR VALIGN=TOP>", html, 0):
            m = re.search(r"""
                <A .*? HREF=" (?P<url> .+?) ">
                <B> (?P<title> .*?) </B>
                .*? stt> (?P<descr> .*?) [<&]
                .*? stt> (?P<genre> .*?) [<&]
                .*? <I> .*? HREF="(?P<homepage> .*?)"
            """, html, re.X|re.S)
            if m:
                r.append(dict(
                    genre = m.group("genre"),
                    url = m.group("url"),
                    title = m.group("title"),
                    playing = m.group("descr"),
                    homepage = m.group("homepage"),

                ))
        return r








>







>















>

















>



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
# static genre list. Podcasts, scheduled programs aren't fetched.


import re
from config import *
from channels import *
import ahttp
import action


# Basic HTML scraping
class publicradiofan (ChannelPlugin):

    # control attributes
    has_search = True
    format = "mp3"
    listformat = "href"
    titles = dict(listeners=False, bitrate=False, playing="Description")
    categories = ["adult alternative", "adult contemporary", "blues", "business", "classical", "community", "contemporary", "country", "easy", "education", "ethnic", "folk", "free-form", "full service", "government", "international", "jazz", "military", "news", "nostalgia", "oldies", "reading", "regional", "religious", "rock", "seasonal", "sports", "student", "talk", "traffic", "urban", "variety", "world", "youth"]
    

    # static
    def update_categories(self):
        pass
        

    # Extract from listing tables
    def update_streams(self, cat, search=None):

        html = ahttp.get("http://www.publicradiofan.com/cgibin/statsearch.pl?format={}&lang=".format(cat))
        html = re.split("<H2>", html, 2, re.S)[1]
        probe = action.extract_playlist()

        r = []
        for html in re.split("<TR VALIGN=TOP>", html, 0):
            m = re.search(r"""
                <A .*? HREF=" (?P<url> .+?) ">
                <B> (?P<title> .*?) </B>
                .*? stt> (?P<descr> .*?) [<&]
                .*? stt> (?P<genre> .*?) [<&]
                .*? <I> .*? HREF="(?P<homepage> .*?)"
            """, html, re.X|re.S)
            if m:
                r.append(dict(
                    genre = m.group("genre"),
                    url = m.group("url"),
                    title = m.group("title"),
                    playing = m.group("descr"),
                    homepage = m.group("homepage"),
                    listformat = probe.probe_ext(m.group("url")) or "srv",
                ))
        return r