#NEWLINE# def _real_extract( self , url ) : #NEWLINE# #INDENT# mobj = re . match ( self . _VALID_URL , url ) #NEWLINE# video_id = mobj . group ( 'id' ) #NEWLINE# media = self . _download_json ( ( '%s?json' % mobj . group ( 'url' ) ) , video_id , 'Downloading video JSON' ) #NEWLINE# title = media . get ( 'name' ) #NEWLINE# description = media . get ( 'desc' ) #NEWLINE# thumbnail = ( media . get ( 'image_300' ) or media . get ( 'image_medium' ) or media . get ( 'image' ) ) #NEWLINE# duration = parse_duration ( media . get ( 'length' ) ) #NEWLINE# uploader = media . get ( 'author' ) #NEWLINE# upload_date = unified_strdate ( media . get ( 'date' ) ) #NEWLINE# formats = [ ] #NEWLINE# for format_id in [ 'wmv' , 'm3u8' , 'mediaUri' , 'h264' ] : #NEWLINE# #INDENT# media_url = media . get ( format_id ) #NEWLINE# if ( not media_url ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# formats . append ( { #NEWLINE# #INDENT# 'url' : media_url , #NEWLINE# 'format_id' : format_id , #NEWLINE# 'ext' : 'mp4' , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# if self . _downloader . params . get ( 'listsubtitles' , False ) : #NEWLINE# #INDENT# page = self . _download_webpage ( url , video_id ) #NEWLINE# self . _list_available_subtitles ( video_id , page ) #NEWLINE# return #NEWLINE# #UNINDENT# subtitles = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if self . _have_to_download_any_subtitles : #NEWLINE# #INDENT# page = self . _download_webpage ( url , video_id ) #NEWLINE# subtitles = self . extract_subtitles ( video_id , page ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'id' : video_id , #NEWLINE# 'title' : title , #NEWLINE# 'description' : description , #NEWLINE# 'thumbnail' : thumbnail , #NEWLINE# 'uploader' : uploader , #NEWLINE# 'upload_date' : upload_date , #NEWLINE# 'duration' : duration , #NEWLINE# 'formats' : formats , #NEWLINE# 'subtitles' : subtitles , #NEWLINE# #UNINDENT# }