mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-24 12:15:40 +01:00
Return instead of sys.exit
This commit is contained in:
parent
adc39782d7
commit
0f93c5c1ce
@ -19,7 +19,7 @@ class Bigbrother(Service, OpenGraphThumbMixin):
|
||||
match = re.search(r'id="(bcPl[^"]+)"', self.get_urldata())
|
||||
if not match:
|
||||
log.error("Can't find flash id.")
|
||||
sys.exit(2)
|
||||
return
|
||||
flashid = match.group(1)
|
||||
|
||||
match = re.search(r'playerID" value="([^"]+)"', self.get_urldata())
|
||||
|
@ -105,7 +105,7 @@ class Svtplay(Service, OpenGraphThumbMixin):
|
||||
self.get_urldata())
|
||||
if match is None:
|
||||
log.error("Couldn't retrieve episode list")
|
||||
sys.exit(2)
|
||||
return
|
||||
|
||||
xml = ET.XML(get_http_data(match.group(1)))
|
||||
|
||||
|
@ -68,8 +68,8 @@ class Tv4play(Service, OpenGraphThumbMixin):
|
||||
if xml.find("live").text != "false":
|
||||
options.live = True
|
||||
if xml.find("drmProtected").text == "true":
|
||||
log.error("DRM protected content.")
|
||||
sys.exit(2)
|
||||
log.error("We cant download DRM protected content from this site.")
|
||||
return
|
||||
|
||||
if options.output_auto:
|
||||
directory = os.path.dirname(options.output)
|
||||
|
@ -59,7 +59,7 @@ class Urplay(Service, OpenGraphThumbMixin):
|
||||
self.get_urldata())
|
||||
if match is None:
|
||||
log.error("Couldn't retrieve episode list")
|
||||
sys.exit(2)
|
||||
return
|
||||
url = "http://urplay.se%s" % match.group(1).replace("&", "&")
|
||||
xml = ET.XML(get_http_data(url))
|
||||
|
||||
|
@ -98,8 +98,8 @@ class Viaplay(Service, OpenGraphThumbMixin):
|
||||
parse = urlparse(filename)
|
||||
match = re.search("^(/[^/]+)/(.*)", parse.path)
|
||||
if not match:
|
||||
log.error("Somthing wrong with rtmpparse")
|
||||
sys.exit(2)
|
||||
log.error("Something wrong with rtmpparse")
|
||||
return
|
||||
filename = "%s://%s:%s%s" % (parse.scheme, parse.hostname, parse.port, match.group(1))
|
||||
path = "-y %s" % match.group(2)
|
||||
options.other = "-W http://flvplayer.viastream.viasat.tv/flvplayer/play/swf/player.swf %s" % path
|
||||
@ -113,8 +113,8 @@ class Viaplay(Service, OpenGraphThumbMixin):
|
||||
def find_all_episodes(self, options):
|
||||
format_id = re.search(r'data-format-id="(\d+)"', self.get_urldata())
|
||||
if not format_id:
|
||||
log.error("Can't find video info")
|
||||
sys.exit(2)
|
||||
log.error("Can't find video info for all episodes")
|
||||
return
|
||||
data = get_http_data("http://playapi.mtgx.tv/v1/sections?sections=videos.one,seasons.videolist&format=%s" % format_id.group(1))
|
||||
jsondata = json.loads(data)
|
||||
videos = jsondata["_embedded"]["sections"][1]["_embedded"]["seasons"][0]["_embedded"]["episodelist"]["_embedded"]["videos"]
|
||||
|
@ -29,4 +29,4 @@ class Vimeo(Service, OpenGraphThumbMixin):
|
||||
yield HTTP(copy.copy(options), avail_quality[i]["url"], avail_quality[i]["bitrate"])
|
||||
else:
|
||||
log.error("Can't find any streams.")
|
||||
sys.exit(2)
|
||||
return
|
Loading…
Reference in New Issue
Block a user