From 474f4d724a796426db99c398dfe56756549cd223 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sat, 3 Dec 2016 17:40:29 +0100 Subject: [PATCH 1/2] [common] pass valid filename in download_url_ffmpeg --- src/you_get/common.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/you_get/common.py b/src/you_get/common.py index 27998cf5..7db4fba2 100755 --- a/src/you_get/common.py +++ b/src/you_get/common.py @@ -968,11 +968,15 @@ def download_url_ffmpeg(url,title, ext,params={}, total_size=0, output_dir='.', from .processor.ffmpeg import has_ffmpeg_installed, ffmpeg_download_stream assert has_ffmpeg_installed(), "FFmpeg not installed." + global output_filename - if(output_filename): + if output_filename: dotPos = output_filename.rfind(".") title = output_filename[:dotPos] ext = output_filename[dotPos+1:] + + title = tr(get_filename(title)) + ffmpeg_download_stream(url, title, ext, params, output_dir) def playlist_not_supported(name): From 61d9bf124edf5bd89283eb5e373cabae5e8953b6 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sat, 3 Dec 2016 17:41:23 +0100 Subject: [PATCH 2/2] [youtube] download hlsvp via ffmpeg --- src/you_get/extractors/youtube.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/you_get/extractors/youtube.py b/src/you_get/extractors/youtube.py index 61dc2cb7..c403cb74 100644 --- a/src/you_get/extractors/youtube.py +++ b/src/you_get/extractors/youtube.py @@ -148,6 +148,17 @@ class YouTube(VideoExtractor): elif video_info['status'] == ['ok']: if 'use_cipher_signature' not in video_info or video_info['use_cipher_signature'] == ['False']: self.title = parse.unquote_plus(video_info['title'][0]) + + # YouTube Live + if 'url_encoded_fmt_stream_map' not in video_info: + hlsvp = video_info['hlsvp'][0] + + if 'info_only' in kwargs and kwargs['info_only']: + return + else: + download_url_ffmpeg(hlsvp, self.title, 'mp4') + exit(0) + stream_list = video_info['url_encoded_fmt_stream_map'][0].split(',') # Parse video page (for DASH)