1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

Fix exceptions

This commit is contained in:
Johan Andersson 2011-11-10 20:48:20 +01:00
parent cad51ab2d6
commit 7d1243740b

View File

@ -22,11 +22,11 @@ class Common(object):
request.add_data(data)
try:
response = urllib2.urlopen(request)
except urllib2.HTTPError, e:
except urllib2.HTTPError as e:
print "Something wrong with that url"
print "Error code:", e.code
sys.exit(2)
except urllib2.URLError, e:
except urllib2.URLError as e:
print "Something wrong with that url"
print "Error code:", e.reason
sys.exit(2)
@ -160,7 +160,7 @@ class Qbrick(Common):
try:
path = streams[int(self.quality)]
except:
except KeyError:
print "Err: cant find that quality. try: "
for i in sort:
print i
@ -214,7 +214,7 @@ class Kanal5(Common):
try:
test = streams[int(self.quality)]
except:
except KeyError:
print "Err: cant find that quality. try: "
for i in sort:
print i
@ -256,7 +256,7 @@ class Expressen(Common):
try:
test = streams[str(self.quality)]
except:
except KeyError:
print "Err: cant find that quality. try: "
for i in sort:
print i
@ -358,7 +358,7 @@ class Tv4play(Common):
try:
test = streams[str(self.quality)]
except:
except KeyError:
print "Err: cant find that quality. try: "
for i in sort:
print i