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

⌈⌋ ⎇ branch:  streamtuner2


Check-in [151c826bb2]

Overview
Comment:Add category tree reloading (implicit capitalization of genres).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 151c826bb22727bba87f01786c3537975ff78895
User & Date: mario on 2015-03-25 01:18:37
Other Links: manifest | tags
Context
2015-03-25
01:19
Release as 2.1.4 check-in: b8c3abacb6 user: mario tags: trunk, 2.1.4
01:18
Add category tree reloading (implicit capitalization of genres). check-in: 151c826bb2 user: mario tags: trunk
01:18
Document Jamenda API count always 1. check-in: f9f113c1e4 user: mario tags: trunk
Changes

Modified channels/internet_radio.py from [411d4564a5] to [1c5b48beed].

59
60
61
62
63
64
65
66
67


68
69
70
71
72
73
74
75
    default = ""


    # load genres
    def update_categories(self):
    
        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:







|
|
>
>
|







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
    default = ""


    # load genres
    def update_categories(self):
    
        html = http.get(self.homepage)
        rx = re.compile("""="/stations/[-+&.\w\s%]+/">([^<]+)<""")
        cats = rx.findall(html)
        cats = list(set(cats))
        cats = [s.capitalize() for s in cats]
        self.categories = sorted(cats)


    # fetch station lists
    def update_streams(self, cat):
    
        entries = []
        if cat not in self.categories:
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
            html.append(
                http.get(
                    self.homepage + "stations/" +
                    cat.lower().replace(" ", "%20") +
                    "/" + ("page"+str(page) if page>1 else "")
                )
            )
            
            # Is there a next page?
            if str(page+1) not in rx_pages.findall(html[-1]):
                break
            self.parent.status(float(page)/float(max_pages+1))

        # Alternatively try regex or pyquery parsing
        #__print__(dbg.HTTP, html)







|







88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
            html.append(
                http.get(
                    self.homepage + "stations/" +
                    cat.lower().replace(" ", "%20") +
                    "/" + ("page"+str(page) if page>1 else "")
                )
            )

            # Is there a next page?
            if str(page+1) not in rx_pages.findall(html[-1]):
                break
            self.parent.status(float(page)/float(max_pages+1))

        # Alternatively try regex or pyquery parsing
        #__print__(dbg.HTTP, html)