diff --git a/script.audio.motherearth/CHANGELOG.md b/script.audio.motherearth/CHANGELOG.md index d4784f1ce..495c794a3 100644 --- a/script.audio.motherearth/CHANGELOG.md +++ b/script.audio.motherearth/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.1 +- updated to https +- added artist fanart background when available + ## v2.0 - metadata for the streams diff --git a/script.audio.motherearth/README.md b/script.audio.motherearth/README.md index ddb35d6bc..1b50f98dc 100644 --- a/script.audio.motherearth/README.md +++ b/script.audio.motherearth/README.md @@ -1,6 +1,6 @@ # script.audio.motherearth -Kodi addon for Mother Earth Radio, a free FLAC/AAC 96k/24bits webradio +Mother Earth Radio - Hi Res Audio and Vinyl 192kHz/24bit FLAC streaming -Version 2.0 +Version 2.1 -Choose FLAC or AAC-stream (AAC is the default) in addon options. +Choose FLAC or AAC-stream in addon options. diff --git a/script.audio.motherearth/addon.xml b/script.audio.motherearth/addon.xml index 41aa89a2e..c9390b8c0 100644 --- a/script.audio.motherearth/addon.xml +++ b/script.audio.motherearth/addon.xml @@ -1,5 +1,5 @@ - + @@ -9,15 +9,14 @@ - Mother Earth Radio addon for Kodi - Free High Resolution FLAC 96kHz/24bit Radio. 429hz music tuned to the Faslak's Frequency. Choose FLAC or AAC stream in addon-options + Mother Earth Radio - 192kHz/24bit streaming + Hi Res Audio and Vinyl- Mother Earth is a free HD music station without advertising. Best audio quality, selected tracks, audiophile only. Stream now! https://motherearthradio.de/ https://github.com/FlorianReiterer/repo-scripts/tree/script.audio.motherearth GPL-3.0-or-later all -- added Classical and Instrumental stream -- Metadata for the streams +- updated to https streaming resources/icon.png diff --git a/script.audio.motherearth/motherearth.py b/script.audio.motherearth/motherearth.py index c61b7e371..4da90315a 100644 --- a/script.audio.motherearth/motherearth.py +++ b/script.audio.motherearth/motherearth.py @@ -4,26 +4,26 @@ KEY_FILTER_RE = re.compile(r'[^\w\']+') -NOWPLAYING_URL = 'http://server9.streamserver24.com:9090/api/nowplaying/{}' +NOWPLAYING_URL = 'https://motherearth.streamserver24.com/api/nowplaying/{}' STREAMS = [ { 'channel': 0, 'title': 'Mother Earth Radio', - 'url_aac': 'http://server9.streamserver24.com:18900/motherearth.aac', - 'url_flac': 'http://server9.streamserver24.com:18900/motherearth', + 'url_aac': 'https://motherearth.streamserver24.com/listen/motherearth/motherearth.aac', + 'url_flac': 'https://motherearth.streamserver24.com/listen/motherearth/motherearth', }, { 'channel': 1, 'title': 'Mother Earth Klassik', - 'url_aac': 'http://server9.streamserver24.com:18910/motherearth.klassik.aac', - 'url_flac': 'http://server9.streamserver24.com:18910/motherearth.klassik', + 'url_aac': 'https://motherearth.streamserver24.com/listen/motherearth_klassik/motherearth.klassik.aac', + 'url_flac': 'https://motherearth.streamserver24.com/listen/motherearth_klassik/motherearth.klassik', }, { 'channel': 2, 'title': 'Mother Earth Instrumental', - 'url_aac': 'http://server9.streamserver24.com:18920/motherearth.instrumental.aac', - 'url_flac': 'http://server9.streamserver24.com:18920/motherearth.instrumental', + 'url_aac': 'https://motherearth.streamserver24.com/listen/motherearth_instrumental/motherearth.instrumental.aac', + 'url_flac': 'https://motherearth.streamserver24.com/listen/motherearth_instrumental/motherearth.instrumental', }, ] STREAM_INFO = {s['url_aac']: s for s in STREAMS} @@ -74,12 +74,12 @@ def update(self): now = time.time() if now < self.next_update: return - res = requests.get(self.url, timeout=2) - res.raise_for_status() - data = res.json() + response = requests.get(self.url, timeout=2) + response.raise_for_status() + data = response.json() current = None songs = {} - key = build_key((data['now_playing']['song']['artist'], data['now_playing']['song']['title'])) + key = build_key((data['now_playing']['song']['artist'], data['now_playing']['song']['title'])) songs[key] = { 'artist': data['now_playing']['song']['artist'], 'cover': data['now_playing']['song']['art'], @@ -88,6 +88,7 @@ def update(self): 'album': data['now_playing']['song']['album'], } current = songs[key] + self._current = current self.songs = songs self.next_update = now + data['now_playing']['remaining'] diff --git a/script.audio.motherearth/resources/icon.png b/script.audio.motherearth/resources/icon.png index c770da139..81b4f4093 100644 Binary files a/script.audio.motherearth/resources/icon.png and b/script.audio.motherearth/resources/icon.png differ diff --git a/script.audio.motherearth/resources/settings.xml b/script.audio.motherearth/resources/settings.xml index c5de23604..ab9b7f6fd 100644 --- a/script.audio.motherearth/resources/settings.xml +++ b/script.audio.motherearth/resources/settings.xml @@ -5,7 +5,7 @@ 0 - aac + flac diff --git a/script.audio.motherearth/resources/skins/Default/media/logo.png b/script.audio.motherearth/resources/skins/Default/media/logo.png index 954d7f03a..c64ab5da2 100644 Binary files a/script.audio.motherearth/resources/skins/Default/media/logo.png and b/script.audio.motherearth/resources/skins/Default/media/logo.png differ diff --git a/script.audio.motherearth/resources/skins/Default/media/menu-focus.png b/script.audio.motherearth/resources/skins/Default/media/menu-focus.png index 3837a2b50..db92fb786 100644 Binary files a/script.audio.motherearth/resources/skins/Default/media/menu-focus.png and b/script.audio.motherearth/resources/skins/Default/media/menu-focus.png differ diff --git a/script.audio.motherearth/service.py b/script.audio.motherearth/service.py index 4a90c71e1..797d4b322 100644 --- a/script.audio.motherearth/service.py +++ b/script.audio.motherearth/service.py @@ -3,17 +3,17 @@ import xbmc import xbmcaddon import xbmcgui +import urllib from collections import namedtuple from motherearth import STREAM_INFO, NowPlaying - RESTART_INTERVAL = 1.0 RESTART_TIMEOUT = 1.0 +FANART_URL = "https://motherearthradio.de/artist/{}/fanart.jpg" Song = namedtuple('Song', 'data cover') - class Player(xbmc.Player): """Adds xbmc.Player callbacks and integrates with the API.""" @@ -84,12 +84,12 @@ def update_player(self): rating = float(song.data['rating']) info['rating'] = rating info['userrating'] = int(round(rating)) - if 'year' in song.data: - info['year'] = int(song.data['year']) item = xbmcgui.ListItem() item.setPath(self.getPlayingFile()) item.setArt({'thumb': song.cover}) - item.setArt({'fanart': song.cover}) + fanart = urllib.parse.quote(song.data['artist']) + fanart = FANART_URL.format(fanart) + item.setArt({'fanart' : fanart}) item.setInfo('music', info) self.updateInfoTag(item)