diff --git a/lib/svtplay_dl/service/vimeo.py b/lib/svtplay_dl/service/vimeo.py index 5482367..3b33899 100644 --- a/lib/svtplay_dl/service/vimeo.py +++ b/lib/svtplay_dl/service/vimeo.py @@ -7,7 +7,7 @@ import re from svtplay_dl.service import Service, OpenGraphThumbMixin from svtplay_dl.utils import get_http_data -from svtplay_dl.fetcher.http import download_http +from svtplay_dl.fetcher.http import HTTP from svtplay_dl.log import log class Vimeo(Service, OpenGraphThumbMixin): @@ -24,29 +24,8 @@ class Vimeo(Service, OpenGraphThumbMixin): if player_data: jsondata = json.loads(player_data) avail_quality = jsondata["request"]["files"]["h264"] - if options.quality: - try: - selected = avail_quality[options.quality] - except KeyError: - log.error("Can't find that quality. (Try one of: %s)", - ", ".join([str(elm) for elm in avail_quality])) - sys.exit(4) - else: - try: - selected = self.select_highest_quality(avail_quality) - except KeyError: - log.error("Can't find any streams.") - sys.exit(4) - url = selected['url'] - download_http(options, url) + for i in avail_quality.keys(): + yield HTTP(options, avail_quality[i]["url"], avail_quality[i]["height"]) else: log.error("Can't find any streams.") - sys.exit(2) - - def select_highest_quality(self, available): - if 'hd' in available: - return available['hd'] - elif 'sd' in available: - return available['sd'] - else: - raise KeyError() + sys.exit(2) \ No newline at end of file