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

⌈⌋ branch:  streamtuner2


Check-in [35e6840757]

Overview
Comment:streema: fix search using right parameter (search= instead of cat=)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:35e68407577c7e6f8ef8f78201fe4faa5a9f7766
User & Date: mario on 2016-12-17 10:52:33
Other Links: manifest | tags
Context
2016-12-17
11:01
Adapt urn_resolve() invocation. Most handlers update the dict in place. A few will return a new row however. (This can be utilized to return a copy, instead of changing station entries → menat for user "script stations" plugin.) check-in: 0a425cfb5d user: mario tags: trunk
10:52
streema: fix search using right parameter (search= instead of cat=) check-in: 35e6840757 user: mario tags: trunk
10:51
fix .save_formats reference for file dialog check-in: 440ac1977d user: mario tags: trunk
Changes

Modified contrib/streema.py from [8d8eaf7b58] to [13e4a521b2].

1
2
3
4
5
6
7
8
9
10
11
12
13
..
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
# api: streamtuner2
# title: Streema
# description: 
# type: channel
# category: radio
# version: 0.1
# url: http://www.streema.com/
# png:
#   iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABF0lEQVR42oWTMWsCURCE/Y/Bxh+QLrUIloKdELCxTOOBRSSgpZVYhCAWCtcEETGQJmCTkG7k47HcereeA4vnu32zszt7jceRFMXDQGoN
#   pd40RXci9d+kpxep+VzkNaLLXBzMpe1R+vu/jq8fabxKOSEBL6YfqgVEnSwgsMoen9+JcJlL5990xv9QAYf5qbhMC/RrQf/trLgctoA8A/0yPCO38PkVApPpAdFsndyoJeDlaKFarPZ3FJj3i12qHIEh
#   sichgSfi18j8bHDmpgvlQfFMNe/O5hAoMOnMoJMVRNjHCnsFbGKFgCl7IJPloZoHLrEPlRYi+8ogh724uUiv72ny0QeEQl+5QmDDIomeLVhdzuzzLrt1AQVnVKF/yji7AAAAAElFTkSuQmCC
# config: -
# priority: optional
................................................................................

    # get streems
    def update_streams(self, cat, search=None):
        r = []
        if cat:
            html = ahttp.get(self.base + "/genre/" + cat)
        elif search:
            html = ahttp.get(self.base + "/search/?q=" + cat)
        else:
            return
        
        # split into blocks
        for html in re.split('<div[^>]+class="item"', html):

            # not very efficient
            url = re.findall('data-url="/radios/play/(\d+)"', html)
            homepage = re.findall('data-profile-url="/radios/(.+?)"', html)
            title = re.findall('title="(.+?)"', html)
            img = re.findall('<img\s*src="(.+?)"', html)
            playing = re.findall('<span class="now-playing-text">(.*?)</span>', html, re.S)
            genre = re.findall('<p class="genre">(.*?)</p>', html, re.S)
            listeners = re.findall('<p>(\d+) Listen\w*s</p>', html)

            # catch absent fields
            try:





|







 







|









|







1
2
3
4
5
6
7
8
9
10
11
12
13
..
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
# api: streamtuner2
# title: Streema
# description: 
# type: channel
# category: radio
# version: 0.2
# url: http://www.streema.com/
# png:
#   iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABF0lEQVR42oWTMWsCURCE/Y/Bxh+QLrUIloKdELCxTOOBRSSgpZVYhCAWCtcEETGQJmCTkG7k47HcereeA4vnu32zszt7jceRFMXDQGoN
#   pd40RXci9d+kpxep+VzkNaLLXBzMpe1R+vu/jq8fabxKOSEBL6YfqgVEnSwgsMoen9+JcJlL5990xv9QAYf5qbhMC/RrQf/trLgctoA8A/0yPCO38PkVApPpAdFsndyoJeDlaKFarPZ3FJj3i12qHIEh
#   sichgSfi18j8bHDmpgvlQfFMNe/O5hAoMOnMoJMVRNjHCnsFbGKFgCl7IJPloZoHLrEPlRYi+8ogh724uUiv72ny0QeEQl+5QmDDIomeLVhdzuzzLrt1AQVnVKF/yji7AAAAAElFTkSuQmCC
# config: -
# priority: optional
................................................................................

    # get streems
    def update_streams(self, cat, search=None):
        r = []
        if cat:
            html = ahttp.get(self.base + "/genre/" + cat)
        elif search:
            html = ahttp.get(self.base + "/search/?q=" + search)
        else:
            return
        
        # split into blocks
        for html in re.split('<div[^>]+class="item"', html):

            # not very efficient
            url = re.findall('data-url="/radios/play/(\d+)"', html)
            homepage = re.findall('data-profile-url="/radios/(.+?)"', html)
            title = re.findall('title="Play (.+?)"', html)
            img = re.findall('<img\s*src="(.+?)"', html)
            playing = re.findall('<span class="now-playing-text">(.*?)</span>', html, re.S)
            genre = re.findall('<p class="genre">(.*?)</p>', html, re.S)
            listeners = re.findall('<p>(\d+) Listen\w*s</p>', html)

            # catch absent fields
            try: