- best_encoding_rate = 0
- best_url = None
- for item in doc['renditions']:
- encoding_rate = item['encodingRate']
- if encoding_rate > best_encoding_rate:
- best_encoding_rate = encoding_rate
- best_url = item['url']
-
- if best_url is None:
- raise Exception("Could not find video URL: " + desc_url)
-
- vbase, vpath = best_url.split("&")
- filename = self.title + ".mp4"
- return download_rtmp(filename, vbase, vpath, HASH_URL)
-
+ filename = self.title + ".ts"
+ return download_hls(filename, video_url)