diff --git a/supysonic/api/media.py b/supysonic/api/media.py index a7aa68e..52533fc 100644 --- a/supysonic/api/media.py +++ b/supysonic/api/media.py @@ -201,7 +201,7 @@ def lyrics(): try: r = requests.get("http://api.chartlyrics.com/apiv1.asmx/SearchLyricDirect", - params = { 'artist': artist, 'song': title }) + params = { 'artist': artist, 'song': title }, timeout = 5) root = ElementTree.fromstring(r.content) ns = { 'cl': 'http://api.chartlyrics.com/' } diff --git a/supysonic/lastfm.py b/supysonic/lastfm.py index e74a8e7..bd803a2 100644 --- a/supysonic/lastfm.py +++ b/supysonic/lastfm.py @@ -77,9 +77,9 @@ class LastFm: try: if write: - r = requests.post('http://ws.audioscrobbler.com/2.0/', data = kwargs) + r = requests.post('http://ws.audioscrobbler.com/2.0/', data = kwargs, timeout = 5) else: - r = requests.get('http://ws.audioscrobbler.com/2.0/', params = kwargs) + r = requests.get('http://ws.audioscrobbler.com/2.0/', params = kwargs, timeout = 5) except requests.exceptions.RequestException as e: self.__logger.warning('Error while connecting to LastFM: ' + str(e)) return None