From bf43f65995a5093efc393da81bd975b720d641ee Mon Sep 17 00:00:00 2001 From: rembo10 Date: Wed, 25 Jul 2012 18:12:30 +0530 Subject: [PATCH] Added a timeout to last.fm album art calls from the post processor --- headphones/albumart.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/headphones/albumart.py b/headphones/albumart.py index 3b80e5f5..5fd6f8a8 100644 --- a/headphones/albumart.py +++ b/headphones/albumart.py @@ -13,6 +13,7 @@ # You should have received a copy of the GNU General Public License # along with Headphones. If not, see . +import urllib2 from headphones import db def getAlbumArt(albumid): @@ -36,7 +37,7 @@ def getCachedArt(albumid): return None if artwork_path.startswith('http://'): - artwork = urllib.urlopen(artwork_path).read() + artwork = urllib2.urlopen(artwork_path, timeout=20).read() return artwork else: artwork = open(artwork_path, "r").read()