1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 04:05:39 +01:00

mtvservices: better error message.

This commit is contained in:
Johan Andersson 2013-04-21 22:58:34 +02:00
parent 078df0b3e5
commit 447528d4c5

View File

@ -19,6 +19,7 @@ class Mtvservices(Service):
data = get_http_data(url)
match = re.search("mgid=\"(mgid.*[0-9]+)\" data-wi", data)
if not match:
log.error("Can't find video file")
sys.exit(2)
url = "http://media.mtvnservices.com/player/html5/mediagen/?uri=%s" % match.group(1)
data = get_http_data(url)
@ -34,6 +35,9 @@ class Mtvservices(Service):
streams = {}
for i in sa:
streams[int(i.attrib["height"])] = i.find("src").text
if len(streams) == 0:
log.error("Can't find video file")
sys.exit(2)
stream = select_quality(options, streams)
temp = stream.index("gsp.comedystor")
url = "http://mtvnmobile.vo.llnwd.net/kip0/_pxn=0+_pxK=18639+_pxE=mp4/44620/mtvnorigin/%s" % stream[temp:]