1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-28 06:04:17 +01:00

Make pylint bit happier

This commit is contained in:
Johan Andersson 2013-12-30 01:43:59 +01:00
parent 9b5a67e874
commit 9345284547
4 changed files with 5 additions and 5 deletions

View File

@ -17,7 +17,7 @@ def download_http(options, url):
response = urlopen(request)
except HTTPError as e:
log.error("Something wrong with that url")
log.error("Error code: %s" % e.code)
log.error("Error code: %s", e.code)
sys.exit(5)
try:
total_size = response.info()['Content-Length']

View File

@ -33,7 +33,7 @@ class Mtvservices(Service):
for i in sa:
streams[int(i.attrib["height"])] = i.find("src").text
if len(streams) == 0:
log.error("Can't find video file: %s" % ss.text)
log.error("Can't find video file: %s", ss.text)
sys.exit(2)
stream = select_quality(options, streams)
temp = stream.index("gsp.comedystor")

View File

@ -79,7 +79,7 @@ class Svtplay(Service):
if parse.scheme == "rtmp":
embedurl = "%s?type=embed" % url
data = get_http_data(embedurl)
match = re.search("value=\"(/(public)?(statiskt)?/swf(/video)?/svtplayer-[0-9\.a-f]+swf)\"", data)
match = re.search(r"value=\"(/(public)?(statiskt)?/swf(/video)?/svtplayer-[0-9\.a-f]+swf)\"", data)
swf = "http://www.svtplay.se%s" % match.group(1)
options.other = "-W %s" % swf
download_rtmp(options, test["url"])

View File

@ -58,11 +58,11 @@ def get_http_data(url, header=None, data=None, useragent=FIREFOX_UA,
response = opener.open(request)
except HTTPError as e:
log.error("Something wrong with that url")
log.error("Error code: %s" % e.code)
log.error("Error code: %s", e.code)
sys.exit(5)
except URLError as e:
log.error("Something wrong with that url")
log.error("Error code: %s" % e.reason)
log.error("Error code: %s", e.reason)
sys.exit(5)
except ValueError as e:
log.error("Try adding http:// before the url")