summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 243a053)
raw | patch | inline | side by side (parent: 243a053)
author | Anthoine Bourgeois <anthoine.bourgeois@gmail.com> | |
Wed, 21 Jul 2010 06:02:09 +0000 (08:02 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Wed, 21 Jul 2010 06:02:09 +0000 (08:02 +0200) |
lyrics/30-leoslyrics.py | patch | blob | history |
index 2a40f37a8bab6833a60d248652efa4d5eabf0a1f..87953e81840d598fc8007c90271b4274c2ac800c 100755 (executable)
--- a/lyrics/30-leoslyrics.py
+++ b/lyrics/30-leoslyrics.py
'artist': artist,
'songtitle': title})
url = "http://api.leoslyrics.com/api_search.php?" + query
- f = urlopen(url)
+ try:
+ f = urlopen(url)
+ except IOError:
+ stderr.write("Failed to connect to http://api.leoslyrics.com, it seems down!\n")
+ exit(1)
handler = SearchContentHandler()
parser = make_parser()
parser.setContentHandler(handler)