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

⌈⌋ ⎇ branch:  streamtuner2


Diff

Differences From Artifact [12c0c0ed91]:

To Artifact [80c3e098ef]:


87
88
89
90
91
92
93

94


95
96
97
98
99
100
101
        return entries


    # Fetch real `url` on stream access/playback (delay)
    def resolve_urn(self, r):
        if r["url"].startswith("urn:"):
            id = r["url"].split(":")[2]

            html = ahttp.get("https://radios.reciva.com/streamer?stationid=%s&streamnumber=0" % id)


            ls = re.findall("""(?:<iframe src=|iframe\()['"]([^'"]+)['"]""", html)
            if ls:
                r["url"] = ls[0]
            else:
                log.ERR("No stream found for reciva station #%s", row["id"])
        return r








>
|
>
>







87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
        return entries


    # Fetch real `url` on stream access/playback (delay)
    def resolve_urn(self, r):
        if r["url"].startswith("urn:"):
            id = r["url"].split(":")[2]
            html = ahttp.get(
                "https://radios.reciva.com/streamer?stationid=%s&streamnumber=0" % id,
                timeout=4, quieter=True, statusmsg="Resolving actual stream URL for `%s`" % r["url"]
            )
            ls = re.findall("""(?:<iframe src=|iframe\()['"]([^'"]+)['"]""", html)
            if ls:
                r["url"] = ls[0]
            else:
                log.ERR("No stream found for reciva station #%s", row["id"])
        return r