Merge pull request #1 from soimort/develop

merge from upstream
This commit is contained in:
anguiao 2016-12-06 08:42:02 +08:00 committed by GitHub
commit 37b40992c8
2 changed files with 16 additions and 1 deletions

View File

@ -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 from .processor.ffmpeg import has_ffmpeg_installed, ffmpeg_download_stream
assert has_ffmpeg_installed(), "FFmpeg not installed." assert has_ffmpeg_installed(), "FFmpeg not installed."
global output_filename global output_filename
if(output_filename): if output_filename:
dotPos = output_filename.rfind(".") dotPos = output_filename.rfind(".")
title = output_filename[:dotPos] title = output_filename[:dotPos]
ext = output_filename[dotPos+1:] ext = output_filename[dotPos+1:]
title = tr(get_filename(title))
ffmpeg_download_stream(url, title, ext, params, output_dir) ffmpeg_download_stream(url, title, ext, params, output_dir)
def playlist_not_supported(name): def playlist_not_supported(name):

View File

@ -148,6 +148,17 @@ class YouTube(VideoExtractor):
elif video_info['status'] == ['ok']: elif video_info['status'] == ['ok']:
if 'use_cipher_signature' not in video_info or video_info['use_cipher_signature'] == ['False']: if 'use_cipher_signature' not in video_info or video_info['use_cipher_signature'] == ['False']:
self.title = parse.unquote_plus(video_info['title'][0]) 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(',') stream_list = video_info['url_encoded_fmt_stream_map'][0].split(',')
# Parse video page (for DASH) # Parse video page (for DASH)