From 1ad363ca35d11abd506ce7e6f150c8c96d8bd37d Mon Sep 17 00:00:00 2001 From: girst Date: Sat, 19 Sep 2020 20:12:58 +0200 Subject: [PATCH] expose hls/dash streams to template note that this can't be used, since no browsers implement native hls/dash, and any js-polyfills will trigger cors-errors. --- app/common/common.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/common/common.py b/app/common/common.py index 02f50a7..f4d3eb9 100644 --- a/app/common/common.py +++ b/app/common/common.py @@ -252,6 +252,8 @@ def get_video_info(video_id, sts=0, algo=""): adaptive[i]['url'] = unscramble(cipher, algo) stream_map = {'adaptive': adaptive, 'muxed': formats} + stream_map.update({'hlsManifestUrl': metadata['streamingData'].get('hlsManifestUrl')}) + stream_map.update({'dashManifestUrl': metadata['streamingData'].get('dashManifestUrl')}) # todo: check if we have urls or try again url = sorted(formats, key=lambda k: k['height'], reverse=True)[0]['url'] -- 2.39.3