mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-27 21:54:17 +01:00
Make pylint bit happier
This commit is contained in:
parent
9b5a67e874
commit
9345284547
@ -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']
|
||||
|
@ -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")
|
||||
|
@ -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"])
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user